From 1377b6315c81c475ea831cfb0b15e59375d44dae Mon Sep 17 00:00:00 2001 From: Ruud Date: Mon, 14 Oct 2013 22:05:32 +0200 Subject: [PATCH] Allow imdb id with int of 4-7 --- couchpotato/core/helpers/variable.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/couchpotato/core/helpers/variable.py b/couchpotato/core/helpers/variable.py index 15f9936..79181d2 100644 --- a/couchpotato/core/helpers/variable.py +++ b/couchpotato/core/helpers/variable.py @@ -137,7 +137,7 @@ def getImdb(txt, check_inside = False, multiple = False): output.close() try: - ids = re.findall('(tt\d{7})', txt) + ids = re.findall('(tt\d{4,7})', txt) if multiple: return list(set(ids)) if len(ids) > 0 else [] return ids[0] @@ -146,7 +146,7 @@ def getImdb(txt, check_inside = False, multiple = False): return False -def tryInt(s, default=0): +def tryInt(s, default = 0): try: return int(s) except: return default