aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkclauhk <78251477+kclauhk@users.noreply.github.com>2024-09-28 06:28:22 +0800
committerGitHub <noreply@github.com>2024-09-27 22:28:22 +0000
commit7509d692b37a7ec6230ea75bfe1e44a8de5eefce (patch)
tree97d84b903da7dd78ab625d3e3aa18451fb0c2bac
parent63da31b3b29af90062d8a72a905ffe4b5e499042 (diff)
[ie/loom] Fix m3u8 formats extraction (#10760)
Closes #10737 Authored by: kclauhk
-rw-r--r--yt_dlp/extractor/loom.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/yt_dlp/extractor/loom.py b/yt_dlp/extractor/loom.py
index 1191aa17e..b0878c33e 100644
--- a/yt_dlp/extractor/loom.py
+++ b/yt_dlp/extractor/loom.py
@@ -92,9 +92,9 @@ class LoomIE(InfoExtractor):
},
'params': {'videopassword': 'seniorinfants2'},
}, {
- # embed, transcoded-url endpoint sends empty JSON response
+ # embed, transcoded-url endpoint sends empty JSON response, split video and audio HLS formats
'url': 'https://www.loom.com/embed/ddcf1c1ad21f451ea7468b1e33917e4e',
- 'md5': '8488817242a0db1cb2ad0ea522553cf6',
+ 'md5': 'b321d261656848c184a94e3b93eae28d',
'info_dict': {
'id': 'ddcf1c1ad21f451ea7468b1e33917e4e',
'ext': 'mp4',
@@ -104,6 +104,7 @@ class LoomIE(InfoExtractor):
'timestamp': 1657216459,
'duration': 181,
},
+ 'params': {'format': 'bestvideo'}, # Test video-only fixup
'expected_warnings': ['Failed to parse JSON'],
}]
_WEBPAGE_TESTS = [{
@@ -293,7 +294,11 @@ class LoomIE(InfoExtractor):
format_url = format_url.replace('-split.m3u8', '.m3u8')
m3u8_formats = self._extract_m3u8_formats(
format_url, video_id, 'mp4', m3u8_id=f'hls-{format_id}', fatal=False, quality=quality)
+ # Sometimes only split video/audio formats are available, need to fixup video-only formats
+ is_not_premerged = 'none' in traverse_obj(m3u8_formats, (..., 'vcodec'))
for fmt in m3u8_formats:
+ if is_not_premerged and fmt.get('vcodec') != 'none':
+ fmt['acodec'] = 'none'
yield {
**fmt,
'url': update_url(fmt['url'], query=query),