mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-22 16:44:32 +01:00
[peertube] Extract files also from streamingPlaylists
JSON objects with an empty "files" tag seem to be a valid PeerTube API response. In those cases the "files" arrays contained in the "streamingPlaylists" members can be used instead.
This commit is contained in:
parent
10709fc7c6
commit
2f9504e6e1
@ -450,6 +450,18 @@ class PeerTubeIE(InfoExtractor):
|
|||||||
'tags': ['framasoft', 'peertube'],
|
'tags': ['framasoft', 'peertube'],
|
||||||
'categories': ['Science & Technology'],
|
'categories': ['Science & Technology'],
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
# Issue #26002
|
||||||
|
'url': 'peertube:spacepub.space:d8943b2d-8280-497b-85ec-bc282ec2afdc',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'd8943b2d-8280-497b-85ec-bc282ec2afdc',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Dot matrix printer shell demo',
|
||||||
|
'uploader_id': '3',
|
||||||
|
'timestamp': 1587401293,
|
||||||
|
'upload_date': '20200420',
|
||||||
|
'uploader': 'Drew DeVault',
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
'url': 'https://peertube.tamanoir.foucry.net/videos/watch/0b04f13d-1e18-4f1d-814e-4979aa7c9c44',
|
'url': 'https://peertube.tamanoir.foucry.net/videos/watch/0b04f13d-1e18-4f1d-814e-4979aa7c9c44',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
@ -526,7 +538,15 @@ class PeerTubeIE(InfoExtractor):
|
|||||||
title = video['name']
|
title = video['name']
|
||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
for file_ in video['files']:
|
files = video['files']
|
||||||
|
for playlist in video['streamingPlaylists']:
|
||||||
|
if not isinstance(playlist, dict):
|
||||||
|
continue
|
||||||
|
playlist_files = playlist.get('files')
|
||||||
|
if not playlist_files or not isinstance(playlist_files, list):
|
||||||
|
continue
|
||||||
|
files.extend(playlist_files)
|
||||||
|
for file_ in files:
|
||||||
if not isinstance(file_, dict):
|
if not isinstance(file_, dict):
|
||||||
continue
|
continue
|
||||||
file_url = url_or_none(file_.get('fileUrl'))
|
file_url = url_or_none(file_.get('fileUrl'))
|
||||||
|
Loading…
Reference in New Issue
Block a user