diff --git a/yt_dlp/extractor/_extractors.py b/yt_dlp/extractor/_extractors.py index 9b73fcd75e..ca60a8df63 100644 --- a/yt_dlp/extractor/_extractors.py +++ b/yt_dlp/extractor/_extractors.py @@ -1522,6 +1522,7 @@ PinterestCollectionIE, PinterestIE, ) +from .piramidetv import PiramideTVIE from .pixivsketch import ( PixivSketchIE, PixivSketchUserIE, diff --git a/yt_dlp/extractor/piramidetv.py b/yt_dlp/extractor/piramidetv.py new file mode 100644 index 0000000000..15623a8a42 --- /dev/null +++ b/yt_dlp/extractor/piramidetv.py @@ -0,0 +1,45 @@ +from .common import InfoExtractor +from ..utils import unified_timestamp +from ..utils.traversal import traverse_obj + + +class PiramideTVIE(InfoExtractor): + _VALID_URL = [ + r'https?://piramide\.tv/video/(?P[^/]+)', + ] + _TESTS = [{ + 'url': 'https://piramide.tv/video/wcYn6li79NgN', + 'info_dict': { + 'id': 'wcYn6li79NgN', + 'ext': 'mp4', + 'channel': 'ARTA GAME', + 'channel_id': 'arta_game', + 'thumbnail_url': 'https://cdn.jwplayer.com/v2/media/cnEdGp5X/thumbnails/rHAaWfP7.jpg', + 'title': 'ACEPTO TENER UN BEBE CON MI NOVIA…? | Parte 1', + 'timestamp': 1703434976, + 'upload_date': '20231224', + }, + }] + + def _real_extract(self, url): + video_id = self._match_valid_url(url).group('video_id') + json_data = self._download_json( + f'https://hermes.piramide.tv/video/data/{video_id}', video_id)['video'] + + formats, subtitles = self._extract_m3u8_formats_and_subtitles( + f'https://cdn.piramide.tv/video/{video_id}/manifest.m3u8', video_id, + ) + + return { + 'id': video_id, + 'display_id': video_id, + 'formats': formats, + 'subtitles': subtitles, + **traverse_obj(json_data, { + 'title': 'title', + 'thumbnail_url': ('media', 'thumbnail'), + 'channel': ('channel', 'name'), + 'channel_id': ('channel', 'id'), + 'timestamp': ('date', {unified_timestamp}), + }), + }