mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-06-27 05:05:01 +00:00
Compare commits
No commits in common. "d7ec22b8ef9dcbedbfe9181c7871468ab8b16161" and "d3f6e8c79c49ed77cfcf7fc12815d00066011e36" have entirely different histories.
d7ec22b8ef
...
d3f6e8c79c
@ -16,7 +16,6 @@ from ..utils import (
|
|||||||
determine_ext,
|
determine_ext,
|
||||||
float_or_none,
|
float_or_none,
|
||||||
int_or_none,
|
int_or_none,
|
||||||
parse_bitrate,
|
|
||||||
parse_duration,
|
parse_duration,
|
||||||
parse_iso8601,
|
parse_iso8601,
|
||||||
parse_qs,
|
parse_qs,
|
||||||
@ -878,27 +877,20 @@ class NiconicoLiveIE(NiconicoBaseIE):
|
|||||||
cookie['domain'], cookie['name'], cookie['value'],
|
cookie['domain'], cookie['name'], cookie['value'],
|
||||||
expire_time=unified_timestamp(cookie.get('expires')), path=cookie['path'], secure=cookie['secure'])
|
expire_time=unified_timestamp(cookie.get('expires')), path=cookie['path'], secure=cookie['secure'])
|
||||||
|
|
||||||
fmt_common = {
|
|
||||||
'live_latency': 'high',
|
|
||||||
'origin': hostname,
|
|
||||||
'protocol': 'niconico_live',
|
|
||||||
'video_id': video_id,
|
|
||||||
'ws': ws,
|
|
||||||
}
|
|
||||||
q_iter = (q for q in qualities[1:] if not q.startswith('audio_')) # ignore initial 'abr'
|
|
||||||
a_map = {96: 'audio_low', 192: 'audio_high'}
|
|
||||||
|
|
||||||
formats = self._extract_m3u8_formats(m3u8_url, video_id, ext='mp4', live=True)
|
formats = self._extract_m3u8_formats(m3u8_url, video_id, ext='mp4', live=True)
|
||||||
for fmt in formats:
|
qualities = [
|
||||||
if fmt.get('acodec') == 'none':
|
*('audio_high', 'audio_low'),
|
||||||
fmt['format_id'] = next(q_iter, fmt['format_id'])
|
*(q for q in qualities[1:] if not q.startswith('audio')),
|
||||||
elif fmt.get('vcodec') == 'none':
|
]
|
||||||
abr = parse_bitrate(fmt['url'].lower())
|
for fmt, q in zip(formats, qualities):
|
||||||
fmt.update({
|
fmt.update({
|
||||||
'abr': abr,
|
'format_id': q,
|
||||||
'format_id': a_map.get(abr, fmt['format_id']),
|
'protocol': 'niconico_live',
|
||||||
})
|
'ws': ws,
|
||||||
fmt.update(fmt_common)
|
'video_id': video_id,
|
||||||
|
'live_latency': 'high',
|
||||||
|
'origin': hostname,
|
||||||
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user