imdb parser fixes
This commit is contained in:
parent
2f5c0ad31b
commit
87e73406eb
1 changed files with 6 additions and 3 deletions
|
@ -137,7 +137,7 @@ class Imdb(SiteParser):
|
||||||
},
|
},
|
||||||
'year': {
|
'year': {
|
||||||
'page': 'combined',
|
'page': 'combined',
|
||||||
're': '<a href="/year/(\d{4})/">',
|
're': '<meta name="og:title" content=".*?\((\d{4})\)"',
|
||||||
'type': 'int'
|
'type': 'int'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,13 +146,16 @@ class Imdb(SiteParser):
|
||||||
self.baseUrl = "http://www.imdb.com/title/tt%s/" % id
|
self.baseUrl = "http://www.imdb.com/title/tt%s/" % id
|
||||||
super(Imdb, self).__init__()
|
super(Imdb, self).__init__()
|
||||||
|
|
||||||
if 'runtime' in self:
|
if 'runtime' in self and self['runtime']:
|
||||||
if 'min' in self['runtime']: base=60
|
if 'min' in self['runtime']: base=60
|
||||||
else: base=1
|
else: base=1
|
||||||
self['runtime'] = int(findRe(self['runtime'], '([0-9]+)')) * base
|
self['runtime'] = int(findRe(self['runtime'], '([0-9]+)')) * base
|
||||||
|
else:
|
||||||
|
self['runtime'] = 0
|
||||||
if 'connections' in self:
|
if 'connections' in self:
|
||||||
cc={}
|
cc={}
|
||||||
|
if len(self['connections']) == 2 and isinstance(self['connections'][0], basestring):
|
||||||
|
self['connections'] = [self['connections']]
|
||||||
for rel, data in self['connections']:
|
for rel, data in self['connections']:
|
||||||
cc[unicode(rel)] = re.compile('<a href="/title/tt(\d{7})/">').findall(data)
|
cc[unicode(rel)] = re.compile('<a href="/title/tt(\d{7})/">').findall(data)
|
||||||
self['connections'] = cc
|
self['connections'] = cc
|
||||||
|
|
Loading…
Reference in a new issue