From d6db3256f9d7cba2a1de58a2b1c258f1d53d8faf Mon Sep 17 00:00:00 2001 From: Bezleputh Date: Thu, 3 Apr 2014 08:49:54 +0200 Subject: [PATCH] [arte] fix bug when there no item programImage in json --- modules/arte/browser.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/arte/browser.py b/modules/arte/browser.py index b9ae0a62..54a62fe8 100644 --- a/modules/arte/browser.py +++ b/modules/arte/browser.py @@ -172,9 +172,12 @@ class ArteBrowser(BaseBrowser): else: video.title = u'%s' % (item['VTI']) video.rating = int(item['VRT']) - url = u'%s' % item['programImage'] - video.thumbnail = BaseImage(url) - video.thumbnail.url=video.thumbnail.id + + if 'programImage' in item: + url = u'%s' % item['programImage'] + video.thumbnail = BaseImage(url) + video.thumbnail.url=video.thumbnail.id + video.duration = datetime.timedelta(seconds=int(item['videoDurationSeconds'])) video.set_empty_fields(NotAvailable, ('url',)) if 'VDE' in item: