mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-08-17 01:48:29 +00:00
[ie] _parse_mpd_periods
: Support mimeType="image/avif"
This commit is contained in:
parent
f2919bd28e
commit
691c15ccdf
@ -2968,7 +2968,7 @@ def extract_Initialization(source):
|
|||||||
else:
|
else:
|
||||||
codecs = parse_codecs(codec_str)
|
codecs = parse_codecs(codec_str)
|
||||||
if content_type not in ('video', 'audio', 'text'):
|
if content_type not in ('video', 'audio', 'text'):
|
||||||
if mime_type == 'image/jpeg':
|
if mime_type in ('image/avif', 'image/jpeg'):
|
||||||
content_type = mime_type
|
content_type = mime_type
|
||||||
elif codecs.get('vcodec', 'none') != 'none':
|
elif codecs.get('vcodec', 'none') != 'none':
|
||||||
content_type = 'video'
|
content_type = 'video'
|
||||||
@ -3028,14 +3028,14 @@ def extract_Initialization(source):
|
|||||||
'manifest_url': mpd_url,
|
'manifest_url': mpd_url,
|
||||||
'filesize': filesize,
|
'filesize': filesize,
|
||||||
}
|
}
|
||||||
elif content_type == 'image/jpeg':
|
elif content_type in ('image/avif', 'image/jpeg'):
|
||||||
# See test case in VikiIE
|
# See test case in VikiIE
|
||||||
# https://www.viki.com/videos/1175236v-choosing-spouse-by-lottery-episode-1
|
# https://www.viki.com/videos/1175236v-choosing-spouse-by-lottery-episode-1
|
||||||
f = {
|
f = {
|
||||||
'format_id': format_id,
|
'format_id': format_id,
|
||||||
'ext': 'mhtml',
|
'ext': 'mhtml',
|
||||||
'manifest_url': mpd_url,
|
'manifest_url': mpd_url,
|
||||||
'format_note': 'DASH storyboards (jpeg)',
|
'format_note': f'DASH storyboards ({mimetype2ext(mime_type)})',
|
||||||
'acodec': 'none',
|
'acodec': 'none',
|
||||||
'vcodec': 'none',
|
'vcodec': 'none',
|
||||||
}
|
}
|
||||||
@ -3177,7 +3177,7 @@ def add_segment_url():
|
|||||||
'url': mpd_url or base_url,
|
'url': mpd_url or base_url,
|
||||||
'fragment_base_url': base_url,
|
'fragment_base_url': base_url,
|
||||||
'fragments': [],
|
'fragments': [],
|
||||||
'protocol': 'http_dash_segments' if mime_type != 'image/jpeg' else 'mhtml',
|
'protocol': 'mhtml' if mime_type in ('image/avif', 'image/jpeg') else 'http_dash_segments',
|
||||||
})
|
})
|
||||||
if 'initialization_url' in representation_ms_info:
|
if 'initialization_url' in representation_ms_info:
|
||||||
initialization_url = representation_ms_info['initialization_url']
|
initialization_url = representation_ms_info['initialization_url']
|
||||||
@ -3192,7 +3192,7 @@ def add_segment_url():
|
|||||||
else:
|
else:
|
||||||
# Assuming direct URL to unfragmented media.
|
# Assuming direct URL to unfragmented media.
|
||||||
f['url'] = base_url
|
f['url'] = base_url
|
||||||
if content_type in ('video', 'audio', 'image/jpeg'):
|
if content_type in ('video', 'audio', 'image/avif', 'image/jpeg'):
|
||||||
f['manifest_stream_number'] = stream_numbers[f['url']]
|
f['manifest_stream_number'] = stream_numbers[f['url']]
|
||||||
stream_numbers[f['url']] += 1
|
stream_numbers[f['url']] += 1
|
||||||
period_entry['formats'].append(f)
|
period_entry['formats'].append(f)
|
||||||
|
Loading…
Reference in New Issue
Block a user