From 8b76538b27c0a5699d7ecc789f0a72d3debe85a5 Mon Sep 17 00:00:00 2001 From: JChris246 Date: Sun, 16 Mar 2025 00:21:59 -0400 Subject: [PATCH 1/5] fix: grab all matched urls --- yt_dlp/extractor/youtube/_video.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/yt_dlp/extractor/youtube/_video.py b/yt_dlp/extractor/youtube/_video.py index 5c1485a43d..754d831e74 100644 --- a/yt_dlp/extractor/youtube/_video.py +++ b/yt_dlp/extractor/youtube/_video.py @@ -2282,11 +2282,12 @@ def _extract_from_webpage(cls, url, webpage): # Invidious Instances # https://github.com/yt-dlp/yt-dlp/issues/195 # https://github.com/iv-org/invidious/pull/1730 - mobj = re.search( + matches = re.findall( r' Date: Sun, 16 Mar 2025 17:56:53 -0400 Subject: [PATCH 2/5] refactor: add webpage test for rss url --- yt_dlp/extractor/youtube/_video.py | 35 +++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/yt_dlp/extractor/youtube/_video.py b/yt_dlp/extractor/youtube/_video.py index 754d831e74..ec15181518 100644 --- a/yt_dlp/extractor/youtube/_video.py +++ b/yt_dlp/extractor/youtube/_video.py @@ -1757,7 +1757,40 @@ class YoutubeIE(YoutubeBaseInfoExtractor): 'params': { 'skip_download': True, }, - }, + }, { # Youtube RSS feed + 'url': 'https://www.youtube.com/feeds/videos.xml?channel_id=UC7_gcs09iThXybpVgjHZ_7g', + 'md5': '7d66034582204a3ac425c71eb6b7b6e0', + 'info_dict': { + 'id': 'cfkU4CD91hk', + 'ext': 'mp4', + 'title': 'How Astrophysics Can (LITERALLY) Save the World', + 'upload_date': '20250313', + 'description': 'md5:7d66034582204a3ac425c71eb6b7b6e0', + 'age_limit': 0, + 'tags': list, + 'channel_id': 'UC7_gcs09iThXybpVgjHZ_7g', + 'playable_in_embed': True, + 'thumbnail': 'https://i.ytimg.com/vi/cfkU4CD91hk/maxresdefault.jpg', + 'like_count': int, + 'comment_count': int, + 'channel': 'PBS Space Time', + 'live_status': 'not_live', + 'channel_url': 'https://www.youtube.com/channel/UC7_gcs09iThXybpVgjHZ_7g', + 'availability': 'public', + 'duration': 1194, + 'view_count': int, + 'categories': ['Education'], + 'channel_follower_count': int, + 'uploader': 'PBS Space Time', + 'uploader_url': 'https://www.youtube.com/@pbsspacetime', + 'uploader_id': '@pbsspacetime', + 'timestamp': 1741896682, + 'channel_is_verified': True, + }, + 'params': { + 'skip_download': True, + }, + } ] @classmethod From 70ef50c2430915c46e119fb19eca65e1971b0f6e Mon Sep 17 00:00:00 2001 From: JChris246 Date: Sun, 16 Mar 2025 18:54:12 -0400 Subject: [PATCH 3/5] fix: add trailing comma --- yt_dlp/extractor/youtube/_video.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yt_dlp/extractor/youtube/_video.py b/yt_dlp/extractor/youtube/_video.py index ec15181518..f8987c40a6 100644 --- a/yt_dlp/extractor/youtube/_video.py +++ b/yt_dlp/extractor/youtube/_video.py @@ -1790,7 +1790,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor): 'params': { 'skip_download': True, }, - } + }, ] @classmethod From 60fb8cdea51b8d53fb2940653f41d43785123014 Mon Sep 17 00:00:00 2001 From: JChris246 Date: Sun, 16 Mar 2025 18:56:25 -0400 Subject: [PATCH 4/5] fix: correct lint error --- yt_dlp/extractor/youtube/_video.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yt_dlp/extractor/youtube/_video.py b/yt_dlp/extractor/youtube/_video.py index f8987c40a6..89c7054ab1 100644 --- a/yt_dlp/extractor/youtube/_video.py +++ b/yt_dlp/extractor/youtube/_video.py @@ -1757,7 +1757,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor): 'params': { 'skip_download': True, }, - }, { # Youtube RSS feed + }, { # Youtube RSS feed 'url': 'https://www.youtube.com/feeds/videos.xml?channel_id=UC7_gcs09iThXybpVgjHZ_7g', 'md5': '7d66034582204a3ac425c71eb6b7b6e0', 'info_dict': { From 2974c24a78f2d020d952341813f71f648b07b09b Mon Sep 17 00:00:00 2001 From: JChris246 Date: Sun, 16 Mar 2025 20:55:13 -0400 Subject: [PATCH 5/5] refactor: update test case with playlist result --- yt_dlp/extractor/youtube/_video.py | 56 +++++++++++++++++------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/yt_dlp/extractor/youtube/_video.py b/yt_dlp/extractor/youtube/_video.py index 89c7054ab1..6d30c69628 100644 --- a/yt_dlp/extractor/youtube/_video.py +++ b/yt_dlp/extractor/youtube/_video.py @@ -1761,32 +1761,40 @@ class YoutubeIE(YoutubeBaseInfoExtractor): 'url': 'https://www.youtube.com/feeds/videos.xml?channel_id=UC7_gcs09iThXybpVgjHZ_7g', 'md5': '7d66034582204a3ac425c71eb6b7b6e0', 'info_dict': { - 'id': 'cfkU4CD91hk', - 'ext': 'mp4', - 'title': 'How Astrophysics Can (LITERALLY) Save the World', - 'upload_date': '20250313', - 'description': 'md5:7d66034582204a3ac425c71eb6b7b6e0', + 'id': 'videos', + 'title': 'PBS Space Time', 'age_limit': 0, - 'tags': list, - 'channel_id': 'UC7_gcs09iThXybpVgjHZ_7g', - 'playable_in_embed': True, - 'thumbnail': 'https://i.ytimg.com/vi/cfkU4CD91hk/maxresdefault.jpg', - 'like_count': int, - 'comment_count': int, - 'channel': 'PBS Space Time', - 'live_status': 'not_live', - 'channel_url': 'https://www.youtube.com/channel/UC7_gcs09iThXybpVgjHZ_7g', - 'availability': 'public', - 'duration': 1194, - 'view_count': int, - 'categories': ['Education'], - 'channel_follower_count': int, - 'uploader': 'PBS Space Time', - 'uploader_url': 'https://www.youtube.com/@pbsspacetime', - 'uploader_id': '@pbsspacetime', - 'timestamp': 1741896682, - 'channel_is_verified': True, }, + 'playlist_count': 15, + 'playlist': [{ + 'info_dict': { + 'id': str, + 'title': str, + 'ext': 'mp4', + 'upload_date': str, + 'description': str, + 'age_limit': 0, + 'tags': list, + 'channel_id': 'UC7_gcs09iThXybpVgjHZ_7g', + 'playable_in_embed': True, + 'thumbnail': r're:https://.+\.jpg', + 'like_count': int, + 'comment_count': int, + 'channel': 'PBS Space Time', + 'live_status': 'not_live', + 'channel_url': 'https://www.youtube.com/channel/UC7_gcs09iThXybpVgjHZ_7g', + 'availability': 'public', + 'duration': int, + 'view_count': int, + 'categories': list, + 'channel_follower_count': int, + 'uploader': 'PBS Space Time', + 'uploader_url': 'https://www.youtube.com/@pbsspacetime', + 'uploader_id': '@pbsspacetime', + 'timestamp': int, + 'channel_is_verified': True, + } + }], 'params': { 'skip_download': True, },