strip '/' in search pattern to avoid a 404 HTTP error
This commit is contained in:
parent
8fcf695783
commit
a9603b4b2d
2 changed files with 4 additions and 3 deletions
|
|
@ -70,7 +70,7 @@ class CanalplusBrowser(BaseBrowser):
|
||||||
self.location('http://service.canal-plus.com/video/rest/initPlayer/cplus/')
|
self.location('http://service.canal-plus.com/video/rest/initPlayer/cplus/')
|
||||||
|
|
||||||
def iter_search_results(self, pattern):
|
def iter_search_results(self, pattern):
|
||||||
self.location('http://service.canal-plus.com/video/rest/search/cplus/' + urllib.quote_plus(pattern.encode('utf-8')))
|
self.location('http://service.canal-plus.com/video/rest/search/cplus/' + urllib.quote_plus(pattern.replace('/', '').encode('utf-8')))
|
||||||
return self.page.iter_results()
|
return self.page.iter_results()
|
||||||
|
|
||||||
@id2url(CanalplusVideo.id2url)
|
@id2url(CanalplusVideo.id2url)
|
||||||
|
|
|
||||||
|
|
@ -46,10 +46,11 @@ class DailymotionBrowser(BaseBrowser):
|
||||||
if not pattern:
|
if not pattern:
|
||||||
self.home()
|
self.home()
|
||||||
else:
|
else:
|
||||||
|
pattern = pattern.replace('/', '').encode('utf-8')
|
||||||
if sortby is None:
|
if sortby is None:
|
||||||
url = '/search/%s/1' % quote_plus(pattern.encode('utf-8'))
|
url = '/search/%s/1' % quote_plus(pattern)
|
||||||
else:
|
else:
|
||||||
url = '/%s/search/%s/1' % (sortby, quote_plus(pattern.encode('utf-8')))
|
url = '/%s/search/%s/1' % (sortby, quote_plus(pattern))
|
||||||
self.location(url)
|
self.location(url)
|
||||||
|
|
||||||
assert self.is_on_page(IndexPage)
|
assert self.is_on_page(IndexPage)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue