1
0
mirror of https://github.com/l1ving/youtube-dl synced 2024-12-21 21:02:52 +08:00

[addanime] better regex.

This commit is contained in:
Abdulelah Alfntokh 2013-10-27 19:48:02 +03:00
parent 3e6a330d38
commit 198e370f23

View File

@ -8,7 +8,6 @@ from ..utils import (
compat_urllib_parse_urlparse,
ExtractorError,
RegexNotFoundError,
)
@ -61,12 +60,8 @@ class AddAnimeIE(InfoExtractor):
note=u'Confirming after redirect')
webpage = self._download_webpage(url, video_id)
try:
video_url = self._search_regex(r"var hq_video_file = '(.*?)';",
webpage, u'video file URL')
except RegexNotFoundError:
video_url = self._search_regex(r"var normal_video_file = '(.*?)';",
webpage, u'video file URL')
video_url = self._search_regex(r"var (?:hq|normal)_video_file = '(.*?)';",
webpage, u'video file URL')
video_extension = video_url[-3:] # mp4 or flv ?
video_title = self._og_search_title(webpage)