mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-30 20:32:29 +00:00
[addanime] Add format quality (Closes #5371)
This commit is contained in:
parent
29713e4268
commit
beb10f843f
1 changed files with 5 additions and 1 deletions
|
@ -11,6 +11,7 @@
|
|||
)
|
||||
from ..utils import (
|
||||
ExtractorError,
|
||||
qualities,
|
||||
)
|
||||
|
||||
|
||||
|
@ -63,8 +64,10 @@ def _real_extract(self, url):
|
|||
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 @@ def _real_extract(self, url):
|
|||
formats.append({
|
||||
'format_id': format_id,
|
||||
'url': video_url,
|
||||
'quality': quality(format_id),
|
||||
})
|
||||
self._sort_formats(formats)
|
||||
video_title = self._og_search_title(webpage)
|
||||
|
|
Loading…
Reference in a new issue