[weboob] [PATCH 1/1] Fix bug module francetelevisions : remove "latest" feature

Vincent Texier vit at free.fr
Tue Nov 18 23:46:43 CET 2014


"Latest videos" page no longer on new website.

Signed-off-by: Vincent Texier <vit at free.fr>
---
 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 5ef4cff..679a05c 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<pattern>.*)', IndexPage)
-    latest_page = URL(r'lesplusrecents', IndexPage)
     video_page = URL(r'http://webservices.francetelevisions.fr/tools/getInfosOeuvre/v2/\?idDiffusion=(?P<id>.*)&catalogue=Pluzz', VideoPage)
 
     def search_videos(self, pattern):
@@ -49,6 +48,3 @@ class PluzzBrowser(PagesBrowser):
         buf = r.iter_lines()
         r.close()
         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 8619b75..75e78d1 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 568d770..98b89e5 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
-- 
1.9.1




More information about the weboob mailing list