Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[extractor/youtube:tab] Support short renderers in playlists #7425

Merged
merged 2 commits into from
Jun 29, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 24 additions & 1 deletion yt_dlp/extractor/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -4898,7 +4898,8 @@ def _extract_entries(self, parent_renderer, continuation_list):
'videoRenderer': lambda x: [self._video_entry(x)],
'playlistRenderer': lambda x: self._grid_entries({'items': [{'playlistRenderer': x}]}),
'channelRenderer': lambda x: self._grid_entries({'items': [{'channelRenderer': x}]}),
'hashtagTileRenderer': lambda x: [self._hashtag_tile_entry(x)]
'hashtagTileRenderer': lambda x: [self._hashtag_tile_entry(x)],
'richGridRenderer': lambda x: self._extract_entries(x, continuation_list)
pukkandan marked this conversation as resolved.
Show resolved Hide resolved
}
for key, renderer in isr_content.items():
if key not in known_renderers:
Expand Down Expand Up @@ -6390,6 +6391,28 @@ class YoutubeTabIE(YoutubeTabBaseInfoExtractor):
'channel_is_verified': True,
},
'playlist_mincount': 10,
}, {
# Playlist with only shorts, shown as reel renderers
# FIXME future: YouTube currently doesn't give continuation for this,
pukkandan marked this conversation as resolved.
Show resolved Hide resolved
# may do in future.
'url': 'https://www.youtube.com/playlist?list=UUxqPAgubo4coVn9Lx1FuKcg',
'info_dict': {
'id': 'UUxqPAgubo4coVn9Lx1FuKcg',
'channel_url': 'https://www.youtube.com/channel/UCxqPAgubo4coVn9Lx1FuKcg',
'view_count': int,
'uploader_id': '@BangyShorts',
'description': '',
'uploader_url': 'https://www.youtube.com/@BangyShorts',
'channel_id': 'UCxqPAgubo4coVn9Lx1FuKcg',
'channel': 'Bangy Shorts',
'uploader': 'Bangy Shorts',
'tags': [],
'availability': 'public',
'modified_date': '20230626',
'title': 'Uploads from Bangy Shorts',
},
'playlist_mincount': 100,
'expected_warnings': [r'[Uu]navailable videos (are|will be) hidden'],
}]

@classmethod
Expand Down