aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorFilippo Valsorda <filippo.valsorda@gmail.com>2013-10-27 21:14:19 -0700
committerFilippo Valsorda <filippo.valsorda@gmail.com>2013-10-27 21:14:19 -0700
commitefb4c36b1884e5de0962c4e6c7fd2f53ea633344 (patch)
tree1344e709d6e5d293bd9edab3086564527ca86f4c /youtube_dl
parent29526d0d2bafabddccb8d301b8f22608668b0d38 (diff)
parent198e370f23d9e97b335d1c2603b9fc624817b701 (diff)
Merge pull request #1660 from pyed/master
[addanime] try to download HQ before normal
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/addanime.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/youtube_dl/extractor/addanime.py b/youtube_dl/extractor/addanime.py
index 82a785a19..465df8cf0 100644
--- a/youtube_dl/extractor/addanime.py
+++ b/youtube_dl/extractor/addanime.py
@@ -17,8 +17,8 @@ class AddAnimeIE(InfoExtractor):
IE_NAME = u'AddAnime'
_TEST = {
u'url': u'http://www.add-anime.net/watch_video.php?v=24MR3YO5SAS9',
- u'file': u'24MR3YO5SAS9.flv',
- u'md5': u'1036a0e0cd307b95bd8a8c3a5c8cfaf1',
+ u'file': u'24MR3YO5SAS9.mp4',
+ u'md5': u'72954ea10bc979ab5e2eb288b21425a0',
u'info_dict': {
u"description": u"One Piece 606",
u"title": u"One Piece 606"
@@ -60,8 +60,10 @@ class AddAnimeIE(InfoExtractor):
note=u'Confirming after redirect')
webpage = self._download_webpage(url, video_id)
- video_url = self._search_regex(r"var normal_video_file = '(.*?)';",
+ 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)
video_description = self._og_search_description(webpage)
@@ -69,7 +71,7 @@ class AddAnimeIE(InfoExtractor):
'_type': 'video',
'id': video_id,
'url': video_url,
- 'ext': 'flv',
+ 'ext': video_extension,
'title': video_title,
'description': video_description
}