diff options
author | trueauracoral <87541524+trueauracoral@users.noreply.github.com> | 2024-05-27 17:24:01 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-27 22:24:01 +0000 |
commit | 12b248ce60be1aa1362edd839d915bba70dbee4b (patch) | |
tree | 092c3bf81473b34e9b2066ea39efce5c0efced2e /yt_dlp/extractor/peertube.py | |
parent | 5e3e19c93c52830da98d9d1ed84ea7a559efefbd (diff) |
[ie/peertube] Support livestreams (#10044)
Closes #2055
Authored by: trueauracoral, bashonly
Diffstat (limited to 'yt_dlp/extractor/peertube.py')
-rw-r--r-- | yt_dlp/extractor/peertube.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/yt_dlp/extractor/peertube.py b/yt_dlp/extractor/peertube.py index b7919c073..fb4d02562 100644 --- a/yt_dlp/extractor/peertube.py +++ b/yt_dlp/extractor/peertube.py @@ -1470,11 +1470,15 @@ class PeerTubeIE(InfoExtractor): title = video['name'] - formats = [] + formats, is_live = [], False files = video.get('files') or [] for playlist in (video.get('streamingPlaylists') or []): if not isinstance(playlist, dict): continue + if playlist_url := url_or_none(playlist.get('playlistUrl')): + is_live = True + formats.extend(self._extract_m3u8_formats( + playlist_url, video_id, fatal=False, live=True)) playlist_files = playlist.get('files') if not (playlist_files and isinstance(playlist_files, list)): continue @@ -1498,6 +1502,7 @@ class PeerTubeIE(InfoExtractor): f['vcodec'] = 'none' else: f['fps'] = int_or_none(file_.get('fps')) + is_live = False formats.append(f) description = video.get('description') @@ -1555,6 +1560,7 @@ class PeerTubeIE(InfoExtractor): 'categories': categories, 'formats': formats, 'subtitles': subtitles, + 'is_live': is_live, 'webpage_url': webpage_url, } |