From d7c483922a4688fbd5885903ec2c4478ffe484b3 Mon Sep 17 00:00:00 2001 From: Bezleputh Date: Wed, 7 Jan 2015 10:59:46 +0100 Subject: [PATCH] [arte] fix bug id was not well filled in info command and title was not filled --- modules/arte/browser.py | 5 ++++- modules/arte/pages.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/arte/browser.py b/modules/arte/browser.py index 86cbadea..b991ff0e 100644 --- a/modules/arte/browser.py +++ b/modules/arte/browser.py @@ -96,6 +96,9 @@ class ArteBrowser(Browser): result = simplejson.loads(response.read(), self.ENCODING) quality = None + if 'VTI' in result['videoJsonPlayer']: + video.title = u'%s' % result['videoJsonPlayer']['VTI'] + if 'VSR' in result['videoJsonPlayer']: for item in result['videoJsonPlayer']['VSR']: if self.quality[0] in item: @@ -177,7 +180,7 @@ class ArteBrowser(Browser): if 'programImage' in item: url = u'%s' % item['programImage'] video.thumbnail = BaseImage(url) - video.thumbnail.url=video.thumbnail.id + video.thumbnail.url = video.thumbnail.id video.duration = datetime.timedelta(seconds=int(item['videoDurationSeconds'])) video.set_empty_fields(NotAvailable, ('url',)) diff --git a/modules/arte/pages.py b/modules/arte/pages.py index fd644672..cf653ddb 100644 --- a/modules/arte/pages.py +++ b/modules/arte/pages.py @@ -29,7 +29,7 @@ from .video import ArteLiveVideo class ArteLiveVideoPage(Page): def get_video(self, video=None): if not video: - video = ArteLiveVideo(self.group_dict['id']) + video = ArteLiveVideo('/%s' % self.group_dict['id']) div = self.document.xpath('//div[@class="bloc-presentation"]')[0] @@ -47,7 +47,7 @@ class ArteLivePage(Page): def iter_resources(self): items = list() for el in self.document.xpath('//ul[@class="filter-liste"]/li'): - _id = el.attrib['data-target'].replace('video_box_tab_','') + _id = el.attrib['data-target'].replace('video_box_tab_', '') text = self.parser.select(el, 'a/span', 1, method='xpath').text item = Collection([u'arte-live', u'%s' % _id], u'%s' % (text)) items.append(item)