fix parsing video url
This commit is contained in:
parent
66d8252362
commit
e17d7ebaf1
1 changed files with 3 additions and 1 deletions
|
|
@ -33,7 +33,6 @@ __all__ = ['VideoPage']
|
||||||
|
|
||||||
|
|
||||||
class VideoPage(BasePage):
|
class VideoPage(BasePage):
|
||||||
|
|
||||||
def get_video(self, video=None):
|
def get_video(self, video=None):
|
||||||
_id = to_unicode(self.group_dict['id'])
|
_id = to_unicode(self.group_dict['id'])
|
||||||
if video is None:
|
if video is None:
|
||||||
|
|
@ -54,6 +53,9 @@ class VideoPage(BasePage):
|
||||||
else:
|
else:
|
||||||
raise BrokenPageError('Unable to retrieve video duration')
|
raise BrokenPageError('Unable to retrieve video duration')
|
||||||
|
|
||||||
|
real_id = int(_id.split('-')[-1])
|
||||||
|
data = self.browser.readurl('http://www.youjizz.com/videos/embed/%s' % real_id)
|
||||||
|
|
||||||
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:
|
if len(video_file_urls) == 0:
|
||||||
raise BrokenPageError('Video URL not found')
|
raise BrokenPageError('Video URL not found')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue