From 64c0d954e573a608e497c8318b35a81c25583003 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Fri, 29 Jan 2021 00:31:50 +0530 Subject: [PATCH] [youtube] Extract playlist description --- youtube_dlc/extractor/youtube.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/youtube_dlc/extractor/youtube.py b/youtube_dlc/extractor/youtube.py index e5e36075e..f9e60f03e 100644 --- a/youtube_dlc/extractor/youtube.py +++ b/youtube_dlc/extractor/youtube.py @@ -3426,12 +3426,19 @@ class YoutubeTabIE(YoutubeBaseInfoExtractor): title += ' - %s' % tab_title description = renderer.get('description') playlist_id = renderer.get('externalId') + + # this has thumbnails, but there is currently no thumbnail field for playlists + # sidebar.playlistSidebarRenderer has even more data, but its stucture is more complec renderer = try_get( - data, lambda x: x['metadata']['playlistMetadataRenderer'], dict) + data, lambda x: x['microformat']['microformatDataRenderer'], dict) + if not renderer: + renderer = try_get( + data, lambda x: x['metadata']['playlistMetadataRenderer'], dict) if renderer: title = renderer.get('title') - description = None + description = renderer.get('description') playlist_id = item_id + if playlist_id is None: playlist_id = item_id if title is None: