Move the "empty search for latest" to collections
There is now a "latest" collection (or "latest_nsfw"). The feature didn't look much used, since it didn't work on many backends. Using collections will make it easy to support other things like most viewed, featured, etc. As a bonus, I added tests for every backend with the feature.
This commit is contained in:
parent
4d628112d5
commit
e958c229e6
32 changed files with 366 additions and 112 deletions
|
|
@ -59,10 +59,13 @@ class PluzzBrowser(BaseBrowser):
|
|||
self.location('/replay/1')
|
||||
|
||||
def search_videos(self, pattern):
|
||||
if not pattern:
|
||||
self.home()
|
||||
else:
|
||||
self.location(self.buildurl('/recherche.html', q=pattern.encode('utf-8')))
|
||||
self.location(self.buildurl('/recherche.html', q=pattern.encode('utf-8')))
|
||||
|
||||
assert self.is_on_page(IndexPage)
|
||||
return self.page.iter_videos()
|
||||
|
||||
def latest_videos(self):
|
||||
self.home()
|
||||
|
||||
assert self.is_on_page(IndexPage)
|
||||
return self.page.iter_videos()
|
||||
|
|
@ -79,11 +82,11 @@ class PluzzBrowser(BaseBrowser):
|
|||
|
||||
for vid in root.find('videos'):
|
||||
if vid.findtext('statut') == 'ONLINE' and vid.findtext('format') == 'wmv':
|
||||
video.url = vid.findtext('url')
|
||||
video.url = vid.findtext('url')
|
||||
|
||||
date = root.findtext('diffusions/diffusion')
|
||||
if date:
|
||||
video.date = datetime.datetime.strptime(date, '%d/%m/%Y %H:%M')
|
||||
video.date = datetime.datetime.strptime(date, '%d/%m/%Y %H:%M')
|
||||
|
||||
video.description = root.findtext('synopsis')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue