aboutsummaryrefslogtreecommitdiff
path: root/yt_dlp/extractor/generic.py
diff options
context:
space:
mode:
authorJulien Valentin <julienvalentin51@gmail.Com>2025-02-09 00:28:54 +0100
committerGitHub <noreply@github.com>2025-02-08 23:28:54 +0000
commit19edaa44fcd375f54e63d6227b092f5252d3e889 (patch)
tree6e58a3a9532138a489272e9bcd888e115f8b289d /yt_dlp/extractor/generic.py
parent10b7ff68e98f17655e31952f6e17120b2d7dda96 (diff)
[ie/generic] Extract `live_status` for DASH manifest URLs (#12256)
* Also removes the content-type check for dash+xml/mpd. This was added in cf1f13b817d88eb7d4b449f20cbad3215030e35f, but is a no-op since the regex pattern was never changed accordingly. And it looks like it was unwanted anyways per 28ad7df65ddb78c16ac008886d14ae2914aea6be Closes #12255 Authored by: mp3butcher
Diffstat (limited to 'yt_dlp/extractor/generic.py')
-rw-r--r--yt_dlp/extractor/generic.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/yt_dlp/extractor/generic.py b/yt_dlp/extractor/generic.py
index 320a47772..67c224e50 100644
--- a/yt_dlp/extractor/generic.py
+++ b/yt_dlp/extractor/generic.py
@@ -293,6 +293,19 @@ class GenericIE(InfoExtractor):
'timestamp': 1378272859.0,
},
},
+ # Live DASH MPD
+ {
+ 'url': 'https://livesim2.dashif.org/livesim2/ato_10/testpic_2s/Manifest.mpd',
+ 'info_dict': {
+ 'id': 'Manifest',
+ 'ext': 'mp4',
+ 'title': r're:Manifest \d{4}-\d{2}-\d{2} \d{2}:\d{2}$',
+ 'live_status': 'is_live',
+ },
+ 'params': {
+ 'skip_download': 'livestream',
+ },
+ },
# m3u8 served with Content-Type: audio/x-mpegURL; charset=utf-8
{
'url': 'http://once.unicornmedia.com/now/master/playlist/bb0b18ba-64f5-4b1b-a29f-0ac252f06b68/77a785f3-5188-4806-b788-0893a61634ed/93677179-2d99-4ef4-9e17-fe70d49abfbf/content.m3u8',
@@ -2436,10 +2449,9 @@ class GenericIE(InfoExtractor):
subtitles = {}
if format_id.endswith('mpegurl') or ext == 'm3u8':
formats, subtitles = self._extract_m3u8_formats_and_subtitles(url, video_id, 'mp4', headers=headers)
- elif format_id.endswith(('mpd', 'dash+xml')) or ext == 'mpd':
- formats, subtitles = self._extract_mpd_formats_and_subtitles(url, video_id, headers=headers)
elif format_id == 'f4m' or ext == 'f4m':
formats = self._extract_f4m_formats(url, video_id, headers=headers)
+ # Don't check for DASH/mpd here, do it later w/ first_bytes. Same number of requests either way
else:
formats = [{
'format_id': format_id,
@@ -2521,6 +2533,7 @@ class GenericIE(InfoExtractor):
doc,
mpd_base_url=full_response.url.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)
self.report_detected('DASH manifest')
return info_dict