imdb: parse tenical info

This commit is contained in:
j 2019-02-21 17:43:05 +05:30
parent 0b9a3966b0
commit da38ba3839

View file

@ -90,6 +90,20 @@ def parse_aspectratio(value):
value = '.'.join(value.strip().split('.')[:2]) value = '.'.join(value.strip().split('.')[:2])
return value return value
def technical(label):
return {
'page': 'technical',
're': [
'<td class="label">\s*?%s\s*?</td>.*?<td>\s*?(.*?)\s*?</td>' % label,
lambda data: [
re.sub('\s+', ' ', d.strip()) for d in data.strip().split('<br>')
] if data else []
],
'type': 'list'
}
''' '''
'posterIds': { 'posterIds': {
'page': 'posters', 'page': 'posters',
@ -300,6 +314,11 @@ class Imdb(SiteParser):
], ],
'type': 'list' 'type': 'list'
}, },
'laboratory': technical('Laboratory'),
'camera': technical('Camera'),
'negative format': technical('Negative Format'),
'cinematographic process': technical('Cinematographic Process'),
'printed film format': technical('Printed Film Format'),
} }
def read_url(self, url, timeout): def read_url(self, url, timeout):