[YouTube] Support LOCKUP_CONTENT_TYPE_VIDEO in subscriptions feed extraction

From yt-dlp/yt-dlp#13665), thx bashonly
This commit is contained in:
dirkf
2025-09-28 07:28:11 +01:00
parent 4222c6d78b
commit 9223fcc48a

View File

@@ -3535,18 +3535,29 @@ class YoutubeTabIE(YoutubeBaseInfoExtractor):
if not content_id: if not content_id:
return return
content_type = view_model.get('contentType') content_type = view_model.get('contentType')
if content_type not in ('LOCKUP_CONTENT_TYPE_PLAYLIST', 'LOCKUP_CONTENT_TYPE_PODCAST'): if content_type == 'LOCKUP_CONTENT_TYPE_VIDEO':
ie = YoutubeIE
url = update_url_query(
'https://www.youtube.com/watch', {'v': content_id}),
thumb_keys = (None,)
elif content_type in ('LOCKUP_CONTENT_TYPE_PLAYLIST', 'LOCKUP_CONTENT_TYPE_PODCAST'):
ie = YoutubeTabIE
url = update_url_query(
'https://www.youtube.com/playlist', {'list': content_id}),
thumb_keys = ('collectionThumbnailViewModel', 'primaryThumbnail')
else:
self.report_warning( self.report_warning(
'Unsupported lockup view model content type "{0}"{1}'.format(content_type, bug_reports_message()), only_once=True) 'Unsupported lockup view model content type "{0}"{1}'.format(content_type, bug_reports_message()),
only_once=True)
return return
thumb_keys = ('contentImage',) + thumb_keys + ('thumbnailViewModel', 'image')
return merge_dicts(self.url_result( return merge_dicts(self.url_result(
update_url_query('https://www.youtube.com/playlist', {'list': content_id}), url, ie=ie.ie_key(), video_id=content_id), {
ie=YoutubeTabIE.ie_key(), video_id=content_id), {
'title': traverse_obj(view_model, ( 'title': traverse_obj(view_model, (
'metadata', 'lockupMetadataViewModel', 'title', 'content', T(compat_str))), 'metadata', 'lockupMetadataViewModel', 'title',
'thumbnails': self._extract_thumbnails(view_model, ( 'content', T(compat_str))),
'contentImage', 'collectionThumbnailViewModel', 'primaryThumbnail', 'thumbnails': self._extract_thumbnails(
'thumbnailViewModel', 'image'), final_key='sources'), view_model, thumb_keys, final_key='sources'),
}) })
def _extract_shorts_lockup_view_model(self, view_model): def _extract_shorts_lockup_view_model(self, view_model):