mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-08-11 23:18:30 +00:00
[ie/digitalconcerthall] Fix formats extraction (#13948)
Closes #13925 Authored by: bashonly
This commit is contained in:
parent
fe53ebe5b6
commit
e8d2807296
@ -4,6 +4,7 @@
|
|||||||
from ..networking.exceptions import HTTPError
|
from ..networking.exceptions import HTTPError
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
ExtractorError,
|
ExtractorError,
|
||||||
|
determine_ext,
|
||||||
jwt_decode_hs256,
|
jwt_decode_hs256,
|
||||||
parse_codecs,
|
parse_codecs,
|
||||||
try_get,
|
try_get,
|
||||||
@ -222,11 +223,18 @@ def _entries(self, items, language, type_, **kwargs):
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
for m3u8_url in traverse_obj(stream_info, ('channel', ..., 'stream', ..., 'url', {url_or_none})):
|
for fmt_url in traverse_obj(stream_info, ('channel', ..., 'stream', ..., 'url', {url_or_none})):
|
||||||
formats.extend(self._extract_m3u8_formats(m3u8_url, video_id, 'mp4', m3u8_id='hls', fatal=False))
|
ext = determine_ext(fmt_url)
|
||||||
for fmt in formats:
|
if ext == 'm3u8':
|
||||||
if fmt.get('format_note') and fmt.get('vcodec') == 'none':
|
fmts = self._extract_m3u8_formats(fmt_url, video_id, 'mp4', m3u8_id='hls', fatal=False)
|
||||||
fmt.update(parse_codecs(fmt['format_note']))
|
for fmt in fmts:
|
||||||
|
if fmt.get('format_note') and fmt.get('vcodec') == 'none':
|
||||||
|
fmt.update(parse_codecs(fmt['format_note']))
|
||||||
|
formats.extend(fmts)
|
||||||
|
elif ext == 'mpd':
|
||||||
|
formats.extend(self._extract_mpd_formats(fmt_url, video_id, mpd_id='dash', fatal=False))
|
||||||
|
else:
|
||||||
|
self.report_warning(f'Skipping unsupported format extension "{ext}"')
|
||||||
|
|
||||||
yield {
|
yield {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
|
Loading…
Reference in New Issue
Block a user