aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorAbdulelah Alfntokh <iAbdulelah@Gmail.com>2013-10-27 13:36:43 +0300
committerAbdulelah Alfntokh <iAbdulelah@Gmail.com>2013-10-27 13:36:43 +0300
commitaee5e18c8f4c4360216ab27a2b1362a2ce24881e (patch)
treef78768f0dfae957d2c98e4f3663cf15aa583b8dd /youtube_dl
parent14e10b2b6ec0d1ac3af36cc0458673ec89a88f03 (diff)
[addanime] catch 'RegexNotFoundError'
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/addanime.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/youtube_dl/extractor/addanime.py b/youtube_dl/extractor/addanime.py
index adbda194a..45aac15c3 100644
--- a/youtube_dl/extractor/addanime.py
+++ b/youtube_dl/extractor/addanime.py
@@ -8,6 +8,7 @@ from ..utils import (
compat_urllib_parse_urlparse,
ExtractorError,
+ RegexNotFoundError,
)
@@ -60,11 +61,13 @@ class AddAnimeIE(InfoExtractor):
note=u'Confirming after redirect')
webpage = self._download_webpage(url, video_id)
- video_url = self._search_regex(r"var hq_video_file = '(.*?)';",
- webpage, u'video file URL')
- if not video_url: # if there's no hq_video_file, get normal_video_file
+ 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_extension = video_url[-3:] # mp4 or flv ?
video_title = self._og_search_title(webpage)
video_description = self._og_search_description(webpage)