parse year not any 4 digit number in title

This commit is contained in:
j 2007-06-28 11:14:23 +00:00
parent 93f21420ba
commit c941b9877d

View file

@ -176,9 +176,10 @@ class IMDb:
html_title = soup('title')
if html_title:
html_title = str(html_title[0])
year = re.compile('(\d\d\d\d)').findall(html_title)
html_title = stripTags(html_title)
year = re.compile('\((\d\d\d\d)\)').findall(html_title)
if not year:
year = re.compile('(\d\d\d\d/I)').findall(html_title)
year = re.compile('\((\d\d\d\d/I)\)').findall(html_title)
if year:
year = year[0]
else: year = ''