1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-09-03 08:35:32 +00:00

[extractor/nbc] Fix NBC and NBCStations extractors (#6033)

Improve `InfoExtractor._parse_smil_formats` extension detection
Closes #6019
Authored by: bashonly
This commit is contained in:
bashonly
2023-01-14 10:40:42 -06:00
committed by GitHub
parent 7481998b16
commit cb73b8460c
2 changed files with 151 additions and 103 deletions

View File

@ -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'):