mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-07 20:30:41 -05:00
[youtube] Extract playlist description
This commit is contained in:
parent
bf330f5f29
commit
64c0d954e5
1 changed files with 9 additions and 2 deletions
|
@ -3426,12 +3426,19 @@ def _extract_from_tabs(self, item_id, webpage, data, tabs, identity_token):
|
|||
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:
|
||||
|
|
Loading…
Reference in a new issue