aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbashonly <88596187+bashonly@users.noreply.github.com>2023-10-27 19:35:37 -0500
committerGitHub <noreply@github.com>2023-10-28 00:35:37 +0000
commit4ce2f29a50fcfb9920e6f2ffe42192945a2bad7e (patch)
treeac759dcc091e6b79b4fb530be925a5ba36d1a1ca
parent177f0d963e4b9db749805c482e6f288354c8be84 (diff)
[ie/generic] Improve direct video link ext detection (#8340)
Closes #8265 Authored by: bashonly
-rw-r--r--yt_dlp/extractor/generic.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/yt_dlp/extractor/generic.py b/yt_dlp/extractor/generic.py
index 5e1240c13..ac7cc673f 100644
--- a/yt_dlp/extractor/generic.py
+++ b/yt_dlp/extractor/generic.py
@@ -34,6 +34,7 @@ from ..utils import (
unified_timestamp,
unsmuggle_url,
update_url_query,
+ urlhandle_detect_ext,
url_or_none,
urljoin,
variadic,
@@ -2459,7 +2460,7 @@ class GenericIE(InfoExtractor):
self.report_detected('direct video link')
headers = smuggled_data.get('http_headers', {})
format_id = str(m.group('format_id'))
- ext = determine_ext(url)
+ ext = determine_ext(url, default_ext=None) or urlhandle_detect_ext(full_response)
subtitles = {}
if format_id.endswith('mpegurl') or ext == 'm3u8':
formats, subtitles = self._extract_m3u8_formats_and_subtitles(url, video_id, 'mp4', headers=headers)
@@ -2471,6 +2472,7 @@ class GenericIE(InfoExtractor):
formats = [{
'format_id': format_id,
'url': url,
+ 'ext': ext,
'vcodec': 'none' if m.group('type') == 'audio' else None
}]
info_dict['direct'] = True