mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-07 20:30:41 -05:00
[ie/peertube] Support livestreams (#10044)
Closes #2055 Authored by: trueauracoral, bashonly
This commit is contained in:
parent
5e3e19c93c
commit
12b248ce60
1 changed files with 7 additions and 1 deletions
|
@ -1470,11 +1470,15 @@ def _real_extract(self, url):
|
||||||
|
|
||||||
title = video['name']
|
title = video['name']
|
||||||
|
|
||||||
formats = []
|
formats, is_live = [], False
|
||||||
files = video.get('files') or []
|
files = video.get('files') or []
|
||||||
for playlist in (video.get('streamingPlaylists') or []):
|
for playlist in (video.get('streamingPlaylists') or []):
|
||||||
if not isinstance(playlist, dict):
|
if not isinstance(playlist, dict):
|
||||||
continue
|
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')
|
playlist_files = playlist.get('files')
|
||||||
if not (playlist_files and isinstance(playlist_files, list)):
|
if not (playlist_files and isinstance(playlist_files, list)):
|
||||||
continue
|
continue
|
||||||
|
@ -1498,6 +1502,7 @@ def _real_extract(self, url):
|
||||||
f['vcodec'] = 'none'
|
f['vcodec'] = 'none'
|
||||||
else:
|
else:
|
||||||
f['fps'] = int_or_none(file_.get('fps'))
|
f['fps'] = int_or_none(file_.get('fps'))
|
||||||
|
is_live = False
|
||||||
formats.append(f)
|
formats.append(f)
|
||||||
|
|
||||||
description = video.get('description')
|
description = video.get('description')
|
||||||
|
@ -1555,6 +1560,7 @@ def channel_data(field, type_):
|
||||||
'categories': categories,
|
'categories': categories,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'subtitles': subtitles,
|
'subtitles': subtitles,
|
||||||
|
'is_live': is_live,
|
||||||
'webpage_url': webpage_url,
|
'webpage_url': webpage_url,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue