normalizeTitle
This commit is contained in:
parent
fadb8e384f
commit
50e9f3e819
2 changed files with 904 additions and 4 deletions
|
|
@ -15,6 +15,7 @@ from utils import stripTags, htmldecode
|
|||
|
||||
import utils
|
||||
import chardet
|
||||
import imdbpy_utils
|
||||
|
||||
cache_base = "/var/cache/scrapeit/cache/"
|
||||
|
||||
|
|
@ -183,18 +184,18 @@ class IMDb:
|
|||
title = title.replace(t, '')
|
||||
if title.find(u'\xa0') > -1:
|
||||
title = title[:title.find(u'\xa0')]
|
||||
title = title.strip()
|
||||
title = imdbpy_utils.normalizeTitle(title.strip())
|
||||
if title.startswith('"') and title.endswith('"'):
|
||||
title = title[1:-1]
|
||||
title = imdbpy_utils.normalizeTitle(title[1:-1])
|
||||
elif title.startswith('"') and title.find('"',1) > 0 and \
|
||||
title.find('"',1) == title.rfind('"'):
|
||||
se = re.compile("Season (\d*), Episode (\d*)\)").findall(data)
|
||||
if se:
|
||||
se = se[0]
|
||||
se = ' (S%02dE%02d)' % (int(se[0]), int(se[1]))
|
||||
title = title[1:title.rfind('"')] + se + title[title.rfind('"')+1:]
|
||||
title = imdbpy_utils.normalizeTitle(title[1:title.rfind('"')]) + se + title[title.rfind('"')+1:]
|
||||
else:
|
||||
title = title[1:title.rfind('"')] + ':' + title[title.rfind('"')+1:]
|
||||
title = imdbpy_utils.normalizeTitle(title[1:title.rfind('"')]) + ':' + title[title.rfind('"')+1:]
|
||||
return title
|
||||
|
||||
def parseYear(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue