audio format reordering and minor fixes

pull/12679/head
doe1080 4 months ago
parent 48d2370a96
commit d2f77bdb15

@ -51,6 +51,7 @@ class StreaksBaseIE(InfoExtractor):
formats, subtitles = [], {} formats, subtitles = [], {}
for source in streaks.get('sources', []): for source in streaks.get('sources', []):
ext = mimetype2ext(source.get('type')) ext = mimetype2ext(source.get('type'))
has_drm = bool(source.get('key_systems'))
if src := source.get('src'): if src := source.get('src'):
if ext == 'm3u8': if ext == 'm3u8':
if is_live := live_status == 'is_live' and ssai: if is_live := live_status == 'is_live' and ssai:
@ -73,8 +74,10 @@ class StreaksBaseIE(InfoExtractor):
src, media_id, mpd_id='dash', fatal=False) src, media_id, mpd_id='dash', fatal=False)
else: else:
raise ExtractorError(f'Unsupported type: {ext}') raise ExtractorError(f'Unsupported type: {ext}')
if source.get('key_systems'): for n, f in enumerate(fmts):
for f in fmts: if f.get('vcodec') == 'none':
f['quality'] = -n
if has_drm:
f['has_drm'] = True f['has_drm'] = True
formats.extend(fmts) formats.extend(fmts)
subtitles = self._merge_subtitles(subtitles, subs) subtitles = self._merge_subtitles(subtitles, subs)
@ -100,7 +103,7 @@ class StreaksBaseIE(InfoExtractor):
'duration': ('duration', {float_or_none}), 'duration': ('duration', {float_or_none}),
'episode_id': ('program_id', {str_or_none}), 'episode_id': ('program_id', {str_or_none}),
'tags': ('tags', ..., {str}), 'tags': ('tags', ..., {str}),
'thumbnail': (('poster', 'thumbnail'), 'src', {url_or_none}, any), 'thumbnails': (('poster', 'thumbnail'), 'src', {'url': {url_or_none}}),
'timestamp': ('updated_at', {parse_iso8601}), 'timestamp': ('updated_at', {parse_iso8601}),
'uploader': ('project_id', {str_or_none}), 'uploader': ('project_id', {str_or_none}),
}), }),
@ -138,7 +141,7 @@ class StreaksIE(StreaksBaseIE):
'display_id': 'ref:mycoffeetime_250317', 'display_id': 'ref:mycoffeetime_250317',
'duration': 122.99, 'duration': 122.99,
'live_status': 'not_live', 'live_status': 'not_live',
'thumbnail': r're:https://.+\.jpg', 'thumbnail': r're:https?://.+\.jpg',
'timestamp': 1741586302, 'timestamp': 1741586302,
'upload_date': '20250310', 'upload_date': '20250310',
'uploader': 'ktv-web', 'uploader': 'ktv-web',
@ -160,18 +163,17 @@ class StreaksIE(StreaksBaseIE):
}, },
'skip': 'DRM Protected', 'skip': 'DRM Protected',
}, { }, {
'url': 'https://playback.api.streaks.jp/v1/projects/ytv-news/medias/97d7a6da69e746b6aa6757e9298f0c55', 'url': 'https://playback.api.streaks.jp/v1/projects/ktv-web/medias/b5411938e1e5435dac71edf829dd4813',
'info_dict': { 'info_dict': {
'id': '97d7a6da69e746b6aa6757e9298f0c55', 'id': 'b5411938e1e5435dac71edf829dd4813',
'ext': 'mp4', 'ext': 'mp4',
'title': '225be9f3-ea14-4052-9b68-4de29366bfde.mp4', 'title': 'KANTELE_SYUSEi_0630',
'display_id': '97d7a6da69e746b6aa6757e9298f0c55', 'display_id': 'b5411938e1e5435dac71edf829dd4813',
'duration': 44.586,
'live_status': 'not_live', 'live_status': 'not_live',
'thumbnail': r're:https://.+\.jpg', 'thumbnail': r're:https?://.+\.jpg',
'timestamp': 1682407390, 'timestamp': 1737522999,
'uploader': 'ytv-news', 'uploader': 'ktv-web',
'upload_date': '20230425', 'upload_date': '20250122',
}, },
}, { }, {
# TVer Olympics: website already down, but api remains accessible # TVer Olympics: website already down, but api remains accessible

Loading…
Cancel
Save