tune IMDb parser

This commit is contained in:
j 2018-01-16 09:48:12 +01:00
parent 282bb0e7ee
commit e2e012c8f1

View file

@ -43,7 +43,7 @@ def zebra_list(label, more=None):
conditions = { conditions = {
'page': 'reference', 'page': 'reference',
're': [ 're': [
label + '</td>.*?<ul(.*?)</ul>', '_label">' + label + '</td>.*?<ul(.*?)</ul>',
'<li.*?>(.*?)</li>' '<li.*?>(.*?)</li>'
], ],
'type': 'list', 'type': 'list',
@ -289,7 +289,7 @@ class Imdb(SiteParser):
isinstance(self['alternativeTitles'][0], string_types): isinstance(self['alternativeTitles'][0], string_types):
self['alternativeTitles'] = [self['alternativeTitles']] self['alternativeTitles'] = [self['alternativeTitles']]
for key in ('country', 'genre', 'language', 'sound'): for key in ('country', 'genre', 'language', 'sound', 'color'):
if key in self: if key in self:
self[key] = [x[0] if len(x) == 1 and isinstance(x, list) else x for x in self[key]] self[key] = [x[0] if len(x) == 1 and isinstance(x, list) else x for x in self[key]]
self[key] = list(filter(lambda x: x.lower() != 'home', self[key])) self[key] = list(filter(lambda x: x.lower() != 'home', self[key]))