series creators as directors

This commit is contained in:
j 2010-11-28 16:53:47 +01:00
parent 6e0a5036a2
commit 066bd38a01

View file

@ -61,12 +61,20 @@ class Imdb(SiteParser):
're': '<a href="/Sections/Countries/.*?/">(.*?)</a>', 're': '<a href="/Sections/Countries/.*?/">(.*?)</a>',
'type': 'list' 'type': 'list'
}, },
'creators': {
'page': 'combined',
're': [
'<h5>Creators:</h5>.*?<div class="info-content">(.*?)</div>',
'<a href="/name/.*?>(.*?)</a>'
],
'type': 'list'
},
'directors': { 'directors': {
'page': 'combined', 'page': 'combined',
're': [ 're': [
lambda data: data.split('Series Crew')[0], lambda data: data.split('Series Crew')[0],
'Directed by</a>(.*?)</table>', 'Directed by</a>(.*?)</table>',
'<a href="/name/.*?/">(.*?)</a>' '<a href="/name/.*?>(.*?)</a>'
], ],
'type': 'list' 'type': 'list'
}, },
@ -75,7 +83,7 @@ class Imdb(SiteParser):
're': [ 're': [
lambda data: data.split('Series Crew')[0], lambda data: data.split('Series Crew')[0],
'Film Editing by</a>(.*?)</table>', 'Film Editing by</a>(.*?)</table>',
'<a href="/name/.*?/">(.*?)</a>' '<a href="/name/.*?>(.*?)</a>'
], ],
'type': 'list' 'type': 'list'
}, },
@ -236,6 +244,9 @@ class Imdb(SiteParser):
if key in self: if key in self:
self[key] = filter(lambda x: x.lower() != 'home', self[key]) self[key] = filter(lambda x: x.lower() != 'home', self[key])
if 'creators' in self:
self['directors'] = self['creators']
del self['creators']
if 'series' in self: if 'series' in self:
if 'episode_title' in self: if 'episode_title' in self:
self['series_title'] = self['title'] self['series_title'] = self['title']
@ -243,6 +254,11 @@ class Imdb(SiteParser):
if 'episode_title' in self and 'season' in self and 'episode' in self: if 'episode_title' in self and 'season' in self and 'episode' in self:
self['title'] = "%s (S%02dE%02d) %s" % ( self['title'] = "%s (S%02dE%02d) %s" % (
self['series_title'], self['season'], self['episode'], self['episode_title']) self['series_title'], self['season'], self['episode'], self['episode_title'])
for key in ('directors', 'year'):
self['episode_%s'%key] = self[key]
series = Imdb(self['series'])
for key in ['directors', 'year']:
self[key] =series[key]
else: else:
for key in ('series_title', 'episode_title', 'season', 'episode'): for key in ('series_title', 'episode_title', 'season', 'episode'):
if key in self: if key in self: