rename iter_search_results to either search_videos and search_gallery (closes #779)
This commit is contained in:
parent
46f94a1d78
commit
56691d7ea7
39 changed files with 52 additions and 52 deletions
|
|
@ -48,9 +48,9 @@ class CanalplusBackend(BaseBackend, ICapVideo, ICapCollection):
|
|||
def create_default_browser(self):
|
||||
return self.create_browser(quality=self.config['quality'].get())
|
||||
|
||||
def iter_search_results(self, pattern=None, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False, max_results=None):
|
||||
def search_videos(self, pattern=None, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False, max_results=None):
|
||||
with self.browser:
|
||||
return self.browser.iter_search_results(pattern)
|
||||
return self.browser.search_videos(pattern)
|
||||
|
||||
def get_video(self, _id):
|
||||
m = re.match('https?://www\.canal-?plus\.fr/.*\?vid=(\d+)', _id)
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class CanalplusBrowser(BaseBrowser):
|
|||
def home(self):
|
||||
self.location('http://service.canal-plus.com/video/rest/initPlayer/cplus/')
|
||||
|
||||
def iter_search_results(self, pattern):
|
||||
def search_videos(self, pattern):
|
||||
self.location('http://service.canal-plus.com/video/rest/search/cplus/' + urllib.quote_plus(pattern.replace('/', '').encode('utf-8')))
|
||||
return self.page.iter_results()
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class CanalPlusTest(BackendTest):
|
|||
BACKEND = 'canalplus'
|
||||
|
||||
def test_canalplus(self):
|
||||
l = list(self.backend.iter_search_results('guignol'))
|
||||
l = list(self.backend.search_videos('guignol'))
|
||||
self.assertTrue(len(l) > 0)
|
||||
v = l[0]
|
||||
self.backend.fillobj(v, ('url',))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue