aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/common.py
diff options
context:
space:
mode:
authorbashonly <88596187+bashonly@users.noreply.github.com>2023-01-14 10:40:42 -0600
committerGitHub <noreply@github.com>2023-01-14 16:40:42 +0000
commitcb73b8460c3ce6d37ab651a4e44bb23b10056154 (patch)
tree5de56f4ec455c4becb96da6f9c4aeb6a51ef3fa3 /yt_dlp/extractor/common.py
parent7481998b169b2a52049fc33bff82034d6563ead4 (diff)
downloadhypervideo-pre-cb73b8460c3ce6d37ab651a4e44bb23b10056154.tar.lz
hypervideo-pre-cb73b8460c3ce6d37ab651a4e44bb23b10056154.tar.xz
hypervideo-pre-cb73b8460c3ce6d37ab651a4e44bb23b10056154.zip
[extractor/nbc] Fix `NBC` and `NBCStations` extractors (#6033)
Improve `InfoExtractor._parse_smil_formats` extension detection Closes #6019 Authored by: bashonly
Diffstat (limited to 'yt_dlp/extractor/common.py')
-rw-r--r--yt_dlp/extractor/common.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py
index ef9759974..e37595ffd 100644
--- a/yt_dlp/extractor/common.py
+++ b/yt_dlp/extractor/common.py
@@ -32,6 +32,7 @@ from ..utils import (
FormatSorter,
GeoRestrictedError,
GeoUtils,
+ HEADRequest,
LenientJSONDecoder,
RegexNotFoundError,
RetryManager,
@@ -80,6 +81,7 @@ from ..utils import (
update_Request,
update_url_query,
url_basename,
+ urlhandle_detect_ext,
url_or_none,
urljoin,
variadic,
@@ -2311,7 +2313,8 @@ class InfoExtractor:
height = int_or_none(medium.get('height'))
proto = medium.get('proto')
ext = medium.get('ext')
- src_ext = determine_ext(src)
+ src_ext = determine_ext(src, default_ext=None) or ext or urlhandle_detect_ext(
+ self._request_webpage(HEADRequest(src), video_id, note='Requesting extension info', fatal=False))
streamer = medium.get('streamer') or base
if proto == 'rtmp' or streamer.startswith('rtmp'):