1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-08-15 17:08:29 +00:00

PeerTubeIE

This commit is contained in:
doe1080 2025-07-16 22:35:19 +09:00
parent 24ee70ebdd
commit 91311f5f6b
2 changed files with 95 additions and 38 deletions

View File

@ -1023,34 +1023,6 @@ class GenericIE(InfoExtractor):
'uploader_id': 'b18ca46d-20df-4ff5-b0b3-aa7a00085617', 'uploader_id': 'b18ca46d-20df-4ff5-b0b3-aa7a00085617',
}, },
'params': {'extractor_args': {'generic': {'impersonate': ['chrome']}}}, 'params': {'extractor_args': {'generic': {'impersonate': ['chrome']}}},
}, {
# ✅88
# PeerTube embed
'url': 'https://video.macver.org/w/6gvhZpUGQVd4SQ6oYDc9pC',
'info_dict': {
'id': '6gvhZpUGQVd4SQ6oYDc9pC',
'ext': 'mp4',
'title': 'Minecraft, but if you say a block, it gets deleted',
'categories': ['Gaming'],
'channel': 'Waffle Irons Gaming',
'channel_id': '4',
'channel_url': 'https://video.macver.org/video-channels/waffle_irons',
'description': 'md5:eda8daf64b0dadd00cc248f28eef213c',
'dislike_count': int,
'duration': 1643,
'license': 'Attribution - Non Commercial',
'like_count': int,
'tags': 'count:1',
'thumbnail': r're:https?://video\.macver\.org/lazy-static/thumbnails/.+\.jpg',
'timestamp': 1751142352,
'upload_date': '20250628',
'uploader': 'Bog',
'uploader_id': '3',
'uploader_url': 'https://video.macver.org/accounts/bog',
'view_count': int,
},
'expected_warnings': ['HTTP Error 400: Bad Request', 'Ignoring subtitle tracks found in the HLS manifest'],
'params': {'skip_download': True},
}, { }, {
# ✅124 # ✅124
# YoutubeIE # YoutubeIE

View File

@ -1331,7 +1331,7 @@ class PeerTubeIE(InfoExtractor):
'ext': 'mp4', 'ext': 'mp4',
'title': 'What is PeerTube?', 'title': 'What is PeerTube?',
'description': 'md5:3fefb8dde2b189186ce0719fda6f7b10', 'description': 'md5:3fefb8dde2b189186ce0719fda6f7b10',
'thumbnail': r're:https?://.*\.(?:jpg|png)', 'thumbnail': r're:https?://framatube\.org/lazy-static/thumbnails/.+\.jpg',
'timestamp': 1538391166, 'timestamp': 1538391166,
'upload_date': '20181001', 'upload_date': '20181001',
'uploader': 'Framasoft', 'uploader': 'Framasoft',
@ -1346,19 +1346,34 @@ class PeerTubeIE(InfoExtractor):
'view_count': int, 'view_count': int,
'like_count': int, 'like_count': int,
'dislike_count': int, 'dislike_count': int,
'tags': ['framasoft', 'peertube'], 'tags': 'count:2',
'categories': ['Science & Technology'], 'categories': ['Science & Technology'],
}, },
'expected_warnings': ['HTTP Error 400: Bad Request'],
'params': {'skip_download': 'm3u8'},
}, { }, {
'url': 'https://peertube2.cpy.re/w/122d093a-1ede-43bd-bd34-59d2931ffc5e', 'url': 'https://peertube2.cpy.re/w/122d093a-1ede-43bd-bd34-59d2931ffc5e',
'info_dict': { 'info_dict': {
'id': '122d093a-1ede-43bd-bd34-59d2931ffc5e', 'id': '122d093a-1ede-43bd-bd34-59d2931ffc5e',
'ext': 'mp4', 'ext': 'mp4',
'title': 'E2E tests', 'title': 'E2E tests',
'uploader_id': '37855', 'categories': ['Unknown'],
'channel': 'Main chocobozzz channel',
'channel_id': '5187',
'channel_url': 'https://peertube2.cpy.re/video-channels/chocobozzz_channel',
'description': 'md5:67daf92c833c41c95db874e18fcb2786',
'dislike_count': int,
'duration': 52,
'license': 'Unknown',
'like_count': int,
'tags': [],
'thumbnail': r're:https?://peertube2\.cpy\.re/lazy-static/thumbnails/.+\.jpg',
'timestamp': 1589276219, 'timestamp': 1589276219,
'upload_date': '20200512', 'upload_date': '20200512',
'uploader': 'chocobozzz', 'uploader': 'chocobozzz',
'uploader_id': '37855',
'uploader_url': 'https://peertube2.cpy.re/accounts/chocobozzz',
'view_count': int,
}, },
}, { }, {
'url': 'https://peertube2.cpy.re/w/3fbif9S3WmtTP8gGsC5HBd', 'url': 'https://peertube2.cpy.re/w/3fbif9S3WmtTP8gGsC5HBd',
@ -1366,10 +1381,23 @@ class PeerTubeIE(InfoExtractor):
'id': '3fbif9S3WmtTP8gGsC5HBd', 'id': '3fbif9S3WmtTP8gGsC5HBd',
'ext': 'mp4', 'ext': 'mp4',
'title': 'E2E tests', 'title': 'E2E tests',
'uploader_id': '37855', 'categories': ['Unknown'],
'channel': 'Main chocobozzz channel',
'channel_id': '5187',
'channel_url': 'https://peertube2.cpy.re/video-channels/chocobozzz_channel',
'description': 'md5:67daf92c833c41c95db874e18fcb2786',
'dislike_count': int,
'duration': 52,
'license': 'Unknown',
'like_count': int,
'tags': [],
'thumbnail': r're:https?://peertube2\.cpy\.re/lazy-static/thumbnails/.+\.jpg',
'timestamp': 1589276219, 'timestamp': 1589276219,
'upload_date': '20200512', 'upload_date': '20200512',
'uploader': 'chocobozzz', 'uploader': 'chocobozzz',
'uploader_id': '37855',
'uploader_url': 'https://peertube2.cpy.re/accounts/chocobozzz',
'view_count': int,
}, },
}, { }, {
'url': 'https://peertube2.cpy.re/api/v1/videos/3fbif9S3WmtTP8gGsC5HBd', 'url': 'https://peertube2.cpy.re/api/v1/videos/3fbif9S3WmtTP8gGsC5HBd',
@ -1377,13 +1405,26 @@ class PeerTubeIE(InfoExtractor):
'id': '3fbif9S3WmtTP8gGsC5HBd', 'id': '3fbif9S3WmtTP8gGsC5HBd',
'ext': 'mp4', 'ext': 'mp4',
'title': 'E2E tests', 'title': 'E2E tests',
'uploader_id': '37855', 'categories': ['Unknown'],
'channel': 'Main chocobozzz channel',
'channel_id': '5187',
'channel_url': 'https://peertube2.cpy.re/video-channels/chocobozzz_channel',
'description': 'md5:67daf92c833c41c95db874e18fcb2786',
'dislike_count': int,
'duration': 52,
'license': 'Unknown',
'like_count': int,
'tags': [],
'thumbnail': r're:https?://peertube2\.cpy\.re/lazy-static/thumbnails/.+\.jpg',
'timestamp': 1589276219, 'timestamp': 1589276219,
'upload_date': '20200512', 'upload_date': '20200512',
'uploader': 'chocobozzz', 'uploader': 'chocobozzz',
'uploader_id': '37855',
'uploader_url': 'https://peertube2.cpy.re/accounts/chocobozzz',
'view_count': int,
}, },
}, { }, {
# Issue #26002 # https://github.com/ytdl-org/youtube-dl/issues/26002
'url': 'peertube:spacepub.space:d8943b2d-8280-497b-85ec-bc282ec2afdc', 'url': 'peertube:spacepub.space:d8943b2d-8280-497b-85ec-bc282ec2afdc',
'info_dict': { 'info_dict': {
'id': 'd8943b2d-8280-497b-85ec-bc282ec2afdc', 'id': 'd8943b2d-8280-497b-85ec-bc282ec2afdc',
@ -1394,6 +1435,7 @@ class PeerTubeIE(InfoExtractor):
'upload_date': '20200420', 'upload_date': '20200420',
'uploader': 'Drew DeVault', 'uploader': 'Drew DeVault',
}, },
'skip': 'Invalid URL',
}, { }, {
'url': 'https://peertube.debian.social/videos/watch/0b04f13d-1e18-4f1d-814e-4979aa7c9c44', 'url': 'https://peertube.debian.social/videos/watch/0b04f13d-1e18-4f1d-814e-4979aa7c9c44',
'only_matching': True, 'only_matching': True,
@ -1411,6 +1453,33 @@ class PeerTubeIE(InfoExtractor):
'url': 'peertube:framatube.org:b37a5b9f-e6b5-415c-b700-04a5cd6ec205', 'url': 'peertube:framatube.org:b37a5b9f-e6b5-415c-b700-04a5cd6ec205',
'only_matching': True, 'only_matching': True,
}] }]
_WEBPAGE_TESTS = [{
'url': 'https://video.macver.org/w/6gvhZpUGQVd4SQ6oYDc9pC',
'info_dict': {
'id': '6gvhZpUGQVd4SQ6oYDc9pC',
'ext': 'mp4',
'title': 'Minecraft, but if you say a block, it gets deleted',
'categories': ['Gaming'],
'channel': 'Waffle Irons Gaming',
'channel_id': '4',
'channel_url': 'https://video.macver.org/video-channels/waffle_irons',
'description': 'md5:eda8daf64b0dadd00cc248f28eef213c',
'dislike_count': int,
'duration': 1643,
'license': 'Attribution - Non Commercial',
'like_count': int,
'tags': 'count:1',
'thumbnail': r're:https?://video\.macver\.org/lazy-static/thumbnails/.+\.jpg',
'timestamp': 1751142352,
'upload_date': '20250628',
'uploader': 'Bog',
'uploader_id': '3',
'uploader_url': 'https://video.macver.org/accounts/bog',
'view_count': int,
},
'expected_warnings': ['HTTP Error 400: Bad Request', 'Ignoring subtitle tracks found in the HLS manifest'],
'params': {'skip_download': 'm3u8'},
}]
@staticmethod @staticmethod
def _extract_peertube_url(webpage, source_url): def _extract_peertube_url(webpage, source_url):
@ -1578,33 +1647,49 @@ class PeerTubePlaylistIE(InfoExtractor):
'url': 'https://peertube.debian.social/w/p/hFdJoTuyhNJVa1cDWd1d12', 'url': 'https://peertube.debian.social/w/p/hFdJoTuyhNJVa1cDWd1d12',
'info_dict': { 'info_dict': {
'id': 'hFdJoTuyhNJVa1cDWd1d12', 'id': 'hFdJoTuyhNJVa1cDWd1d12',
'description': 'Diversas palestras do Richard Stallman no Brasil.',
'title': 'Richard Stallman no Brasil', 'title': 'Richard Stallman no Brasil',
'channel': 'debianbrazilteam',
'channel_id': 1522,
'description': 'md5:e2d3ef4626ed10f287b43b6289cb87a5',
'thumbnail': r're:https?://peertube\.debian\.social/lazy-static/thumbnails/.+\.jpg',
'timestamp': 1599676222, 'timestamp': 1599676222,
'upload_date': '20200909',
}, },
'playlist_mincount': 9, 'playlist_mincount': 9,
}, { }, {
'url': 'https://peertube2.cpy.re/a/chocobozzz/videos', 'url': 'https://peertube2.cpy.re/a/chocobozzz/videos',
'info_dict': { 'info_dict': {
'id': 'chocobozzz', 'id': 'chocobozzz',
'timestamp': 1553874564,
'title': 'chocobozzz', 'title': 'chocobozzz',
'channel': 'chocobozzz',
'channel_id': 37855,
'thumbnail': '',
'timestamp': 1553874564,
'upload_date': '20190329',
}, },
'playlist_mincount': 2, 'playlist_mincount': 2,
}, { }, {
'url': 'https://framatube.org/c/bf54d359-cfad-4935-9d45-9d6be93f63e8/videos', 'url': 'https://framatube.org/c/bf54d359-cfad-4935-9d45-9d6be93f63e8/videos',
'info_dict': { 'info_dict': {
'id': 'bf54d359-cfad-4935-9d45-9d6be93f63e8', 'id': 'bf54d359-cfad-4935-9d45-9d6be93f63e8',
'timestamp': 1519917377,
'title': 'Les vidéos de Framasoft', 'title': 'Les vidéos de Framasoft',
'channel': 'framasoft',
'channel_id': 3,
'thumbnail': '',
'timestamp': 1519917377,
'upload_date': '20180301',
}, },
'playlist_mincount': 345, 'playlist_mincount': 345,
}, { }, {
'url': 'https://peertube2.cpy.re/c/blender_open_movies@video.blender.org/videos', 'url': 'https://peertube2.cpy.re/c/blender_open_movies@video.blender.org/videos',
'info_dict': { 'info_dict': {
'id': 'blender_open_movies@video.blender.org', 'id': 'blender_open_movies@video.blender.org',
'timestamp': 1542287810,
'title': 'Official Blender Open Movies', 'title': 'Official Blender Open Movies',
'channel': 'blender',
'channel_id': 1926,
'thumbnail': '',
'timestamp': 1540472902,
'upload_date': '20181025',
}, },
'playlist_mincount': 11, 'playlist_mincount': 11,
}] }]