Fix getting youjizz video URLs, better test
This commit is contained in:
parent
65251c4ceb
commit
4d628112d5
2 changed files with 3 additions and 1 deletions
|
|
@ -54,7 +54,7 @@ class VideoPage(BasePage):
|
|||
else:
|
||||
raise BrokenPageError('Unable to retrieve video duration')
|
||||
|
||||
video_file_urls = re.findall(r'"(http://[^",]+\.youjizz\.com[^",]+\.flv)[\?"]', data)
|
||||
video_file_urls = re.findall(r'"(http://[^",]+\.youjizz\.com[^",]+\.flv(?:\?[^"]*)?)"', data)
|
||||
if len(video_file_urls) == 0:
|
||||
raise BrokenPageError('Video URL not found')
|
||||
elif len(video_file_urls) > 1:
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
from weboob.tools.test import BackendTest
|
||||
|
||||
|
||||
class YoujizzTest(BackendTest):
|
||||
BACKEND = 'youjizz'
|
||||
|
||||
|
|
@ -31,3 +32,4 @@ class YoujizzTest(BackendTest):
|
|||
v = l[0]
|
||||
self.backend.fillobj(v, ('url',))
|
||||
self.assertTrue(v.url and v.url.startswith('http://'), 'URL for video "%s" not found: %s' % (v.id, v.url))
|
||||
self.backend.browser.openurl(v.url)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue