From e17d7ebaf11b4c7571dbd4cd96bb1c1f982c49d4 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Fri, 28 Sep 2012 14:52:59 +0200 Subject: [PATCH] fix parsing video url --- modules/youjizz/pages/video.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/youjizz/pages/video.py b/modules/youjizz/pages/video.py index e0250354..43b98850 100644 --- a/modules/youjizz/pages/video.py +++ b/modules/youjizz/pages/video.py @@ -33,7 +33,6 @@ __all__ = ['VideoPage'] class VideoPage(BasePage): - def get_video(self, video=None): _id = to_unicode(self.group_dict['id']) if video is None: @@ -54,6 +53,9 @@ class VideoPage(BasePage): else: 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) if len(video_file_urls) == 0: raise BrokenPageError('Video URL not found')