Browse Source

Zero fill imdb ids found

pull/2350/merge
Ruud 12 years ago
parent
commit
ce68a37441
  1. 8
      couchpotato/core/helpers/variable.py

8
couchpotato/core/helpers/variable.py

@ -1,6 +1,6 @@
import collections
from couchpotato.core.helpers.encoding import simplifyString, toSafeString, ss from couchpotato.core.helpers.encoding import simplifyString, toSafeString, ss
from couchpotato.core.logger import CPLog from couchpotato.core.logger import CPLog
import collections
import hashlib import hashlib
import os.path import os.path
import platform import platform
@ -138,9 +138,11 @@ def getImdb(txt, check_inside = False, multiple = False):
try: try:
ids = re.findall('(tt\d{4,7})', txt) ids = re.findall('(tt\d{4,7})', txt)
if multiple: if multiple:
return list(set(ids)) if len(ids) > 0 else [] return list(set(['tt%07d' % tryInt(x[2:]) for x in ids])) if len(ids) > 0 else []
return ids[0]
return 'tt%07d' % tryInt(ids[0][2:])
except IndexError: except IndexError:
pass pass

Loading…
Cancel
Save