diff options
author | Sergey M․ <dstftw@gmail.com> | 2015-04-07 21:00:22 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2015-04-07 21:00:22 +0600 |
commit | beb10f843f245efab24bec8ac6fead2834c5cce3 (patch) | |
tree | 2d98a4b161d4e478ded6148fc649c7d74b02edaa /youtube_dl/extractor | |
parent | 29713e4268623ce5d471d5d25beea9ef433a2216 (diff) |
[addanime] Add format quality (Closes #5371)
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/addanime.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/youtube_dl/extractor/addanime.py b/youtube_dl/extractor/addanime.py index 203936e54..d2a60a056 100644 --- a/youtube_dl/extractor/addanime.py +++ b/youtube_dl/extractor/addanime.py @@ -11,6 +11,7 @@ from ..compat import ( ) from ..utils import ( ExtractorError, + qualities, ) @@ -63,8 +64,10 @@ class AddAnimeIE(InfoExtractor): note='Confirming after redirect') webpage = self._download_webpage(url, video_id) + FORMATS = ('normal', 'hq') + quality = qualities(FORMATS) formats = [] - for format_id in ('normal', 'hq'): + for format_id in FORMATS: rex = r"var %s_video_file = '(.*?)';" % re.escape(format_id) video_url = self._search_regex(rex, webpage, 'video file URLx', fatal=False) @@ -73,6 +76,7 @@ class AddAnimeIE(InfoExtractor): formats.append({ 'format_id': format_id, 'url': video_url, + 'quality': quality(format_id), }) self._sort_formats(formats) video_title = self._og_search_title(webpage) |