Skip to content

Commit

Permalink
[ie/peertube] Support livestreams (#10044)
Browse files Browse the repository at this point in the history
Closes #2055
Authored by: trueauracoral, bashonly
  • Loading branch information
trueauracoral authored May 27, 2024
1 parent 5e3e19c commit 12b248c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion yt_dlp/extractor/peertube.py
Original file line number Diff line number Diff line change
Expand Up @@ -1470,11 +1470,15 @@ def _real_extract(self, url):

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
Expand All @@ -1498,6 +1502,7 @@ def _real_extract(self, url):
f['vcodec'] = 'none'
else:
f['fps'] = int_or_none(file_.get('fps'))
is_live = False
formats.append(f)

description = video.get('description')
Expand Down Expand Up @@ -1555,6 +1560,7 @@ def channel_data(field, type_):
'categories': categories,
'formats': formats,
'subtitles': subtitles,
'is_live': is_live,
'webpage_url': webpage_url,
}

Expand Down

0 comments on commit 12b248c

Please sign in to comment.