[arte] do not crash if 'VDA' fiels is missing in json
This commit is contained in:
parent
48ccf3f079
commit
84fd839b84
1 changed files with 7 additions and 6 deletions
|
|
@ -182,12 +182,13 @@ class ArteBrowser(BaseBrowser):
|
|||
video.set_empty_fields(NotAvailable, ('url',))
|
||||
if 'VDE' in item:
|
||||
video.description = u'%s' % item['VDE']
|
||||
m = re.match('(\d{2})\s(\d{2})\s(\d{4})(.*?)', item['VDA'])
|
||||
if m:
|
||||
dd = int(m.group(1))
|
||||
mm = int(m.group(2))
|
||||
yyyy = int(m.group(3))
|
||||
video.date = datetime.date(yyyy, mm, dd)
|
||||
if 'VDA' in item:
|
||||
m = re.match('(\d{2})\s(\d{2})\s(\d{4})(.*?)', item['VDA'])
|
||||
if m:
|
||||
dd = int(m.group(1))
|
||||
mm = int(m.group(2))
|
||||
yyyy = int(m.group(3))
|
||||
video.date = datetime.date(yyyy, mm, dd)
|
||||
return video
|
||||
|
||||
def create_url_plus7(self, class_name, method_name, level, cluster, channel, limit, offset, pattern=None):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue