titles without countries
This commit is contained in:
parent
b147c61f5c
commit
5bf53ba463
2 changed files with 4 additions and 5 deletions
|
@ -476,7 +476,6 @@ class Imdb(SiteParser):
|
||||||
alt[title].append(c)
|
alt[title].append(c)
|
||||||
self['alternativeTitles'] = []
|
self['alternativeTitles'] = []
|
||||||
for t in sorted(alt, key=lambda a: sorted(alt[a])):
|
for t in sorted(alt, key=lambda a: sorted(alt[a])):
|
||||||
if alt[t]:
|
|
||||||
countries = sorted([normalize_country_name(c) or c for c in alt[t]])
|
countries = sorted([normalize_country_name(c) or c for c in alt[t]])
|
||||||
self['alternativeTitles'].append((t, countries))
|
self['alternativeTitles'].append((t, countries))
|
||||||
if not self['alternativeTitles']:
|
if not self['alternativeTitles']:
|
||||||
|
|
|
@ -44,9 +44,9 @@ def get_data(url):
|
||||||
if match:
|
if match:
|
||||||
m['title'] = strip_tags(decode_html(match[0])).strip()
|
m['title'] = strip_tags(decode_html(match[0])).strip()
|
||||||
if not 'title' in m:
|
if not 'title' in m:
|
||||||
match = re.compile("<title>.*?&(.*?)</title>").findall(data)
|
match = re.compile("<title>.*?&(.*?)</title>", re.DOTALL).findall(data)
|
||||||
if match:
|
if match:
|
||||||
m['title'] = match[0].strip()
|
m['title'] = re.sub('\s+', ' ', match[0]).strip()
|
||||||
if ' - ' in m['title']:
|
if ' - ' in m['title']:
|
||||||
m['title'] = m['title'].split(' - ', 1)[-1]
|
m['title'] = m['title'].split(' - ', 1)[-1]
|
||||||
if 'title' in m:
|
if 'title' in m:
|
||||||
|
|
Loading…
Reference in a new issue