dailymotion: Fix search
And avoid redirects
This commit is contained in:
parent
5104b7a6e1
commit
dc4fa48e53
1 changed files with 3 additions and 3 deletions
|
|
@ -34,7 +34,7 @@ class DailymotionBrowser(BaseBrowser):
|
||||||
ENCODING = None
|
ENCODING = None
|
||||||
PAGES = {r'http://[w\.]*dailymotion\.com/1': IndexPage,
|
PAGES = {r'http://[w\.]*dailymotion\.com/1': IndexPage,
|
||||||
r'http://[w\.]*dailymotion\.com/[a-z\-]{2,5}/1': IndexPage,
|
r'http://[w\.]*dailymotion\.com/[a-z\-]{2,5}/1': IndexPage,
|
||||||
r'http://[w\.]*dailymotion\.com/(\w+/)?search/.*': IndexPage,
|
r'http://[w\.]*dailymotion\.com/[a-z\-]{2,5}/(\w+/)?search/.*': IndexPage,
|
||||||
r'http://[w\.]*dailymotion\.com/video/(?P<id>.+)': VideoPage,
|
r'http://[w\.]*dailymotion\.com/video/(?P<id>.+)': VideoPage,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -58,9 +58,9 @@ class DailymotionBrowser(BaseBrowser):
|
||||||
def search_videos(self, pattern, sortby):
|
def search_videos(self, pattern, sortby):
|
||||||
pattern = pattern.replace('/', '').encode('utf-8')
|
pattern = pattern.replace('/', '').encode('utf-8')
|
||||||
if sortby is None:
|
if sortby is None:
|
||||||
url = '/search/%s/1' % quote_plus(pattern)
|
url = '/en/search/%s/1' % quote_plus(pattern)
|
||||||
else:
|
else:
|
||||||
url = '/%s/search/%s/1' % (sortby, quote_plus(pattern))
|
url = '/en/%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