[imdb] fix 'N/A' value in movie release date
This commit is contained in:
parent
e2547b5c84
commit
5506fdb46e
1 changed files with 20 additions and 17 deletions
|
|
@ -125,6 +125,10 @@ class ImdbBrowser(Browser):
|
||||||
if m:
|
if m:
|
||||||
duration = int(m.group(1))
|
duration = int(m.group(1))
|
||||||
if 'Released' in jres:
|
if 'Released' in jres:
|
||||||
|
released_string = str(jres['Released'])
|
||||||
|
if released_string == 'N/A':
|
||||||
|
release_date = NotAvailable
|
||||||
|
else:
|
||||||
months = {
|
months = {
|
||||||
'Jan':'01',
|
'Jan':'01',
|
||||||
'Feb':'02',
|
'Feb':'02',
|
||||||
|
|
@ -139,7 +143,6 @@ class ImdbBrowser(Browser):
|
||||||
'Nov':'11',
|
'Nov':'11',
|
||||||
'Dec':'12',
|
'Dec':'12',
|
||||||
}
|
}
|
||||||
released_string = str(jres['Released'])
|
|
||||||
for st in months:
|
for st in months:
|
||||||
released_string = released_string.replace(st,months[st])
|
released_string = released_string.replace(st,months[st])
|
||||||
release_date = datetime.strptime(released_string, '%d %m %Y')
|
release_date = datetime.strptime(released_string, '%d %m %Y')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue