From 5f94f054907c12e68129cd9ac2508ed8aba1b223 Mon Sep 17 00:00:00 2001 From: Sean Ellingham Date: Tue, 14 Oct 2025 12:53:54 +0100 Subject: [PATCH] [ie/vidyard] Extract chapters (#14478) Closes #14477 Authored by: exterrestris --- yt_dlp/extractor/cellebrite.py | 12 ---- yt_dlp/extractor/vidyard.py | 107 ++++++++++++++++++--------------- 2 files changed, 60 insertions(+), 59 deletions(-) diff --git a/yt_dlp/extractor/cellebrite.py b/yt_dlp/extractor/cellebrite.py index 54367c4d52..75405e966b 100644 --- a/yt_dlp/extractor/cellebrite.py +++ b/yt_dlp/extractor/cellebrite.py @@ -5,18 +5,6 @@ class CellebriteIE(VidyardBaseIE): _VALID_URL = r'https?://cellebrite\.com/(?:\w+)?/(?P[\w-]+)' _TESTS = [{ - 'url': 'https://cellebrite.com/en/collect-data-from-android-devices-with-cellebrite-ufed/', - 'info_dict': { - 'id': 'ZqmUss3dQfEMGpauambPuH', - 'display_id': '16025876', - 'ext': 'mp4', - 'title': 'Ask the Expert: Chat Capture - Collect Data from Android Devices in Cellebrite UFED', - 'description': 'md5:dee48fe12bbae5c01fe6a053f7676da4', - 'thumbnail': 'https://cellebrite.com/wp-content/uploads/2021/05/Chat-Capture-1024x559.png', - 'duration': 455.979, - '_old_archive_ids': ['cellebrite 16025876'], - }, - }, { 'url': 'https://cellebrite.com/en/how-to-lawfully-collect-the-maximum-amount-of-data-from-android-devices/', 'info_dict': { 'id': 'QV1U8a2yzcxigw7VFnqKyg', diff --git a/yt_dlp/extractor/vidyard.py b/yt_dlp/extractor/vidyard.py index 89a89b13f1..42da0e3d1c 100644 --- a/yt_dlp/extractor/vidyard.py +++ b/yt_dlp/extractor/vidyard.py @@ -58,6 +58,20 @@ def _get_direct_subtitles(self, caption_json): return subs + def _get_additional_metadata(self, video_id): + additional_metadata = self._download_json( + f'https://play.vidyard.com/video/{video_id}', video_id, + note='Downloading additional metadata', fatal=False) + return traverse_obj(additional_metadata, { + 'title': ('name', {str}), + 'duration': ('seconds', {int_or_none}), + 'thumbnails': ('thumbnailUrl', {'url': {url_or_none}}, all), + 'chapters': ('videoSections', lambda _, v: float_or_none(v['milliseconds']) is not None, { + 'title': ('title', {str}), + 'start_time': ('milliseconds', {float_or_none(scale=1000)}), + }), + }) + def _fetch_video_json(self, video_id): return self._download_json( f'https://play.vidyard.com/player/{video_id}.json', video_id)['payload'] @@ -67,6 +81,7 @@ def _process_video_json(self, json_data, video_id): self._merge_subtitles(self._get_direct_subtitles(json_data.get('captions')), target=subtitles) return { + **self._get_additional_metadata(json_data['facadeUuid']), **traverse_obj(json_data, { 'id': ('facadeUuid', {str}), 'display_id': ('videoId', {int}, {str_or_none}), @@ -113,6 +128,29 @@ class VidyardIE(VidyardBaseIE): 'thumbnail': 'https://cdn.vidyard.com/thumbnails/spacer.gif', 'duration': 41.186, }, + }, { + 'url': 'https://share.vidyard.com/watch/wL237MtNgZUHo6e8WPiJbF', + 'info_dict': { + 'id': 'wL237MtNgZUHo6e8WPiJbF', + 'display_id': '25926870', + 'ext': 'mp4', + 'title': 'Adding & Editing Video Chapters', + 'thumbnail': 'https://cdn.vidyard.com/thumbnails/25926870/bvSEZS3dGY7DByQ_bzB57avIZ_hsvhr4_small.jpg', + 'duration': 135.46, + 'chapters': [{ + 'title': 'Adding new chapters', + 'start_time': 0, + }, { + 'title': 'Previewing your video', + 'start_time': 74, + }, { + 'title': 'Editing your chapters', + 'start_time': 91, + }, { + 'title': 'Share a link to a specific chapter', + 'start_time': 105, + }], + }, }, { 'url': 'https://embed.vidyard.com/share/oTDMPlUv--51Th455G5u7Q', 'info_dict': { @@ -132,8 +170,8 @@ class VidyardIE(VidyardBaseIE): 'id': 'SyStyHtYujcBHe5PkZc5DL', 'display_id': '41974005', 'ext': 'mp4', - 'title': 'Prepare the Frame and Track for Palm Beach Polysatin Shutters With BiFold Track', - 'description': r're:In this video, you will learn how to prepare the frame.+', + 'title': 'Install Palm Beach Shutters with a Bi-Fold Track System (Video 1 of 6)', + 'description': r're:In this video, you will learn the first step.+', 'thumbnail': 'https://cdn.vidyard.com/thumbnails/41974005/IJw7oCaJcF1h7WWu3OVZ8A_small.png', 'duration': 258.666, }, @@ -147,42 +185,42 @@ class VidyardIE(VidyardBaseIE): 'id': 'SyStyHtYujcBHe5PkZc5DL', 'display_id': '41974005', 'ext': 'mp4', - 'title': 'Prepare the Frame and Track for Palm Beach Polysatin Shutters With BiFold Track', + 'title': 'Install Palm Beach Shutters with a Bi-Fold Track System (Video 1 of 6)', 'thumbnail': 'https://cdn.vidyard.com/thumbnails/41974005/IJw7oCaJcF1h7WWu3OVZ8A_small.png', 'duration': 258.666, }, { 'id': '1Fw4B84jZTXLXWqkE71RiM', 'display_id': '5861113', 'ext': 'mp4', - 'title': 'Palm Beach - Bi-Fold Track System "Frame Installation"', + 'title': 'Install Palm Beach Shutters with a Bi-Fold Track System (Video 2 of 6)', 'thumbnail': 'https://cdn.vidyard.com/thumbnails/5861113/29CJ54s5g1_aP38zkKLHew_small.jpg', 'duration': 167.858, }, { 'id': 'DqP3wBvLXSpxrcqpT5kEeo', 'display_id': '41976334', 'ext': 'mp4', - 'title': 'Install the Track for Palm Beach Polysatin Shutters With BiFold Track', + 'title': 'Install Palm Beach Shutters with a Bi-Fold Track System (Video 3 of 6)', 'thumbnail': 'https://cdn.vidyard.com/thumbnails/5861090/RwG2VaTylUa6KhSTED1r1Q_small.png', 'duration': 94.229, }, { 'id': 'opfybfxpzQArxqtQYB6oBU', 'display_id': '41976364', 'ext': 'mp4', - 'title': 'Install the Panel for Palm Beach Polysatin Shutters With BiFold Track', + 'title': 'Install Palm Beach Shutters with a Bi-Fold Track System (Video 4 of 6)', 'thumbnail': 'https://cdn.vidyard.com/thumbnails/5860926/JIOaJR08dM4QgXi_iQ2zGA_small.png', 'duration': 191.467, }, { 'id': 'rWrXvkbTNNaNqD6189HJya', 'display_id': '41976382', 'ext': 'mp4', - 'title': 'Adjust the Panels for Palm Beach Polysatin Shutters With BiFold Track', + 'title': 'Install Palm Beach Shutters with a Bi-Fold Track System (Video 5 of 6)', 'thumbnail': 'https://cdn.vidyard.com/thumbnails/5860687/CwHxBv4UudAhOh43FVB4tw_small.png', 'duration': 138.155, }, { 'id': 'eYPTB521MZ9TPEArSethQ5', 'display_id': '41976409', 'ext': 'mp4', - 'title': 'Assemble and Install the Valance for Palm Beach Polysatin Shutters With BiFold Track', + 'title': 'Install Palm Beach Shutters with a Bi-Fold Track System (Video 6 of 6)', 'thumbnail': 'https://cdn.vidyard.com/thumbnails/5861425/0y68qlMU4O5VKU7bJ8i_AA_small.png', 'duration': 148.224, }], @@ -191,6 +229,7 @@ class VidyardIE(VidyardBaseIE): }, { # Non hubs.vidyard.com playlist 'url': 'https://salesforce.vidyard.com/watch/d4vqPjs7Q5EzVEis5QT3jd', + 'skip': 'URL now 404s. Alternative non hubs.vidyard.com playlist not yet available', 'info_dict': { 'id': 'd4vqPjs7Q5EzVEis5QT3jd', 'title': 'How To: Service Cloud: Import External Content in Lightning Knowledge', @@ -300,6 +339,7 @@ class VidyardIE(VidyardBaseIE): }, { #