mirror of
https://codeberg.org/polarisfm/youtube-dl.git
synced 2024-12-25 01:01:39 +00:00
[addanime] better regex.
This commit is contained in:
parent
3e6a330d38
commit
198e370f23
1 changed files with 2 additions and 7 deletions
|
@ -8,7 +8,6 @@ from ..utils import (
|
||||||
compat_urllib_parse_urlparse,
|
compat_urllib_parse_urlparse,
|
||||||
|
|
||||||
ExtractorError,
|
ExtractorError,
|
||||||
RegexNotFoundError,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,11 +60,7 @@ class AddAnimeIE(InfoExtractor):
|
||||||
note=u'Confirming after redirect')
|
note=u'Confirming after redirect')
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
try:
|
video_url = self._search_regex(r"var (?:hq|normal)_video_file = '(.*?)';",
|
||||||
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')
|
webpage, u'video file URL')
|
||||||
|
|
||||||
video_extension = video_url[-3:] # mp4 or flv ?
|
video_extension = video_url[-3:] # mp4 or flv ?
|
||||||
|
|
Loading…
Reference in a new issue