[francetelevisions] handle lastest replay videos
This commit is contained in:
parent
d7c483922a
commit
3540bfe2fc
4 changed files with 45 additions and 3 deletions
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
|
||||
from weboob.capabilities.video import CapVideo, BaseVideo
|
||||
from weboob.capabilities.collection import CapCollection
|
||||
from weboob.capabilities.collection import CapCollection, CollectionNotFound
|
||||
from weboob.tools.backend import Module
|
||||
|
||||
from .browser import PluzzBrowser
|
||||
|
|
@ -56,4 +56,22 @@ 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}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue