aboutsummaryrefslogtreecommitdiff
path: root/yt_dlp/extractor/generic.py
diff options
context:
space:
mode:
authorbashonly <88596187+bashonly@users.noreply.github.com>2025-04-22 19:06:35 -0500
committerGitHub <noreply@github.com>2025-04-23 00:06:35 +0000
commit34a061a295d156934417c67ee98070b94943006b (patch)
tree056ff7ed88c9bbd7ba8a8b9f5971cb102c860142 /yt_dlp/extractor/generic.py
parent9032f981362ea0be90626fab51ec37934feded6d (diff)
[ie/generic] Fix MPD extraction for `file://` URLs (#12978)
Fix 5086d4aed6aeb3908c62f49e2d8f74cc0cb05110 Authored by: bashonly
Diffstat (limited to 'yt_dlp/extractor/generic.py')
-rw-r--r--yt_dlp/extractor/generic.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/yt_dlp/extractor/generic.py b/yt_dlp/extractor/generic.py
index b0c7be462..721d04e31 100644
--- a/yt_dlp/extractor/generic.py
+++ b/yt_dlp/extractor/generic.py
@@ -16,7 +16,6 @@ from ..utils import (
MEDIA_EXTENSIONS,
ExtractorError,
UnsupportedError,
- base_url,
determine_ext,
determine_protocol,
dict_get,
@@ -38,6 +37,7 @@ from ..utils import (
unescapeHTML,
unified_timestamp,
unsmuggle_url,
+ update_url,
update_url_query,
url_or_none,
urlhandle_detect_ext,
@@ -2538,12 +2538,13 @@ class GenericIE(InfoExtractor):
return self.playlist_result(
self._parse_xspf(
doc, video_id, xspf_url=url,
- xspf_base_url=full_response.url),
+ xspf_base_url=new_url),
video_id)
elif re.match(r'(?i)^(?:{[^}]+})?MPD$', doc.tag):
info_dict['formats'], info_dict['subtitles'] = self._parse_mpd_formats_and_subtitles(
doc,
- mpd_base_url=base_url(full_response.url),
+ # Do not use yt_dlp.utils.base_url here since it will raise on file:// URLs
+ mpd_base_url=update_url(new_url, query=None, fragment=None).rpartition('/')[0],
mpd_url=url)
info_dict['live_status'] = 'is_live' if doc.get('type') == 'dynamic' else None
self._extra_manifest_info(info_dict, url)