new parameter 'sortby' to searches (relevance, rating, views and date)
This commit is contained in:
parent
f1ee6d674a
commit
911cdc134b
5 changed files with 43 additions and 6 deletions
|
|
@ -43,11 +43,11 @@ class YoupornBrowser(BaseBrowser):
|
|||
else:
|
||||
return str(_id)
|
||||
|
||||
def iter_search_results(self, pattern):
|
||||
def iter_search_results(self, pattern, sortby):
|
||||
if not pattern:
|
||||
self.home()
|
||||
else:
|
||||
self.location('/search?query=%s' % urllib.quote_plus(pattern))
|
||||
self.location('/search/%s?query=%s' % (sortby, urllib.quote_plus(pattern)))
|
||||
|
||||
assert self.is_on_page(IndexPage)
|
||||
return self.page.iter_videos()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue