From 2361057e4cd42234ac7170fd21e0b12acad07f46 Mon Sep 17 00:00:00 2001 From: Ruud Date: Mon, 5 Nov 2012 17:55:45 +0100 Subject: [PATCH] Allow multiple getImdb --- couchpotato/core/helpers/variable.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/couchpotato/core/helpers/variable.py b/couchpotato/core/helpers/variable.py index 06f22bb4..28cbc88f 100644 --- a/couchpotato/core/helpers/variable.py +++ b/couchpotato/core/helpers/variable.py @@ -103,7 +103,7 @@ def cleanHost(host): return host -def getImdb(txt, check_inside = True): +def getImdb(txt, check_inside = True, multiple = False): if check_inside and os.path.isfile(txt): output = open(txt, 'r') @@ -111,8 +111,10 @@ def getImdb(txt, check_inside = True): output.close() try: - id = re.findall('(tt\d{7})', txt)[0] - return id + ids = re.findall('(tt\d{7})', txt) + if multiple: + return ids if len(ids) > 0 else [] + return ids[0] except IndexError: pass