From 026f3fb7123e4030fce4cbd0874692640fb8806d Mon Sep 17 00:00:00 2001 From: Vincent Texier Date: Mon, 15 Dec 2014 21:56:29 +0100 Subject: [PATCH] Fix bug module francetelevisions : remove "latest" feature "Latest videos" page no longer on new website. --- modules/francetelevisions/browser.py | 4 ---- modules/francetelevisions/module.py | 19 +------------------ modules/francetelevisions/test.py | 8 -------- 3 files changed, 1 insertion(+), 30 deletions(-) diff --git a/modules/francetelevisions/browser.py b/modules/francetelevisions/browser.py index b7a6cb60..e0c73e20 100644 --- a/modules/francetelevisions/browser.py +++ b/modules/francetelevisions/browser.py @@ -30,7 +30,6 @@ class PluzzBrowser(PagesBrowser): BASEURL = 'http://pluzz.francetv.fr' index_page = URL(r'recherche\?recherche=(?P.*)', IndexPage) - latest_page = URL(r'lesplusrecents', IndexPage) video_page = URL(r'http://webservices.francetelevisions.fr/tools/getInfosOeuvre/v2/\?idDiffusion=(?P.*)&catalogue=Pluzz', VideoPage) def search_videos(self, pattern): @@ -48,6 +47,3 @@ class PluzzBrowser(PagesBrowser): r = self.open(url, stream=True) buf = r.iter_lines() return buf - - def latest_videos(self): - return self.latest_page.go().iter_videos() diff --git a/modules/francetelevisions/module.py b/modules/francetelevisions/module.py index 8619b757..75e78d11 100644 --- a/modules/francetelevisions/module.py +++ b/modules/francetelevisions/module.py @@ -19,7 +19,7 @@ from weboob.capabilities.video import CapVideo, BaseVideo -from weboob.capabilities.collection import CapCollection, CollectionNotFound +from weboob.capabilities.collection import CapCollection from weboob.tools.backend import Module from .browser import PluzzBrowser @@ -52,21 +52,4 @@ class PluzzModule(Module, CapVideo, CapCollection): return video - def iter_resources(self, objs, split_path): - if BaseVideo in objs: - collection = self.get_collection(objs, split_path) - if collection.path_level == 0: - yield self.get_collection(objs, [u'latest']) - if collection.split_path == [u'latest']: - for video in self.browser.latest_videos(): - yield video - - def validate_collection(self, objs, collection): - if collection.path_level == 0: - return - if BaseVideo in objs and collection.split_path == [u'latest']: - collection.title = u'Latest France Télévisions videos' - return - raise CollectionNotFound(collection.split_path) - OBJECTS = {BaseVideo: fill_video} diff --git a/modules/francetelevisions/test.py b/modules/francetelevisions/test.py index 568d770b..98b89e50 100644 --- a/modules/francetelevisions/test.py +++ b/modules/francetelevisions/test.py @@ -19,7 +19,6 @@ from weboob.tools.test import BackendTest -from weboob.capabilities.video import BaseVideo class PluzzTest(BackendTest): @@ -32,10 +31,3 @@ class PluzzTest(BackendTest): v = l[0] self.backend.fillobj(v, ('url',)) self.assertTrue(v.url, 'URL for video "%s" not found: %s' % (v.id, v.url)) - - def test_latest(self): - l = list(self.backend.iter_resources([BaseVideo], [u'latest'])) - assert len(l) - v = l[0] - self.backend.fillobj(v, ('url',)) - assert v.url