mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-03-01 16:40:28 +01:00
parent
9807181cfb
commit
7508e34f20
@ -28,6 +28,7 @@ from ..utils import (
|
|||||||
try_get,
|
try_get,
|
||||||
unescapeHTML,
|
unescapeHTML,
|
||||||
update_url_query,
|
update_url_query,
|
||||||
|
url_basename,
|
||||||
url_or_none,
|
url_or_none,
|
||||||
urlencode_postdata,
|
urlencode_postdata,
|
||||||
urljoin,
|
urljoin,
|
||||||
@ -432,6 +433,7 @@ class NiconicoIE(InfoExtractor):
|
|||||||
'format_id': ('id', {str}),
|
'format_id': ('id', {str}),
|
||||||
'abr': ('bitRate', {float_or_none(scale=1000)}),
|
'abr': ('bitRate', {float_or_none(scale=1000)}),
|
||||||
'asr': ('samplingRate', {int_or_none}),
|
'asr': ('samplingRate', {int_or_none}),
|
||||||
|
'quality': ('qualityLevel', {int_or_none}),
|
||||||
}), get_all=False),
|
}), get_all=False),
|
||||||
'acodec': 'aac',
|
'acodec': 'aac',
|
||||||
}
|
}
|
||||||
@ -443,7 +445,9 @@ class NiconicoIE(InfoExtractor):
|
|||||||
min_abr = min(traverse_obj(audios, (..., 'bitRate', {float_or_none})), default=0) / 1000
|
min_abr = min(traverse_obj(audios, (..., 'bitRate', {float_or_none})), default=0) / 1000
|
||||||
for video_fmt in video_fmts:
|
for video_fmt in video_fmts:
|
||||||
video_fmt['tbr'] -= min_abr
|
video_fmt['tbr'] -= min_abr
|
||||||
video_fmt['format_id'] = f'video-{video_fmt["tbr"]:.0f}'
|
video_fmt['format_id'] = url_basename(video_fmt['url']).rpartition('.')[0]
|
||||||
|
video_fmt['quality'] = traverse_obj(videos, (
|
||||||
|
lambda _, v: v['id'] == video_fmt['format_id'], 'qualityLevel', {int_or_none}, any)) or -1
|
||||||
yield video_fmt
|
yield video_fmt
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user