Commit 5506fdb4 authored by Julien Veyssier's avatar Julien Veyssier Committed by Romain Bignon

[imdb] fix 'N/A' value in movie release date

parent e2547b5c
......@@ -125,24 +125,27 @@ class ImdbBrowser(Browser):
if m:
duration = int(m.group(1))
if 'Released' in jres:
months = {
'Jan':'01',
'Feb':'02',
'Mar':'03',
'Apr':'04',
'May':'05',
'Jun':'06',
'Jul':'07',
'Aug':'08',
'Sep':'09',
'Oct':'10',
'Nov':'11',
'Dec':'12',
}
released_string = str(jres['Released'])
for st in months:
released_string = released_string.replace(st,months[st])
release_date = datetime.strptime(released_string, '%d %m %Y')
if released_string == 'N/A':
release_date = NotAvailable
else:
months = {
'Jan':'01',
'Feb':'02',
'Mar':'03',
'Apr':'04',
'May':'05',
'Jun':'06',
'Jul':'07',
'Aug':'08',
'Sep':'09',
'Oct':'10',
'Nov':'11',
'Dec':'12',
}
for st in months:
released_string = released_string.replace(st,months[st])
release_date = datetime.strptime(released_string, '%d %m %Y')
if 'Country' in jres:
country = u''
for c in jres['Country'].split(', '):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment