fix parsing video url

This commit is contained in:
Romain Bignon 2012-09-28 14:52:59 +02:00
commit e17d7ebaf1

View file

@ -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')