Add playlistId key to the album dicts in parse_album

This commit is contained in:
Benjamin Ryzman 2022-10-03 15:12:06 +02:00
commit 0d25af1947
2 changed files with 2 additions and 0 deletions

View file

@ -60,6 +60,7 @@ MTRIR = 'musicTwoRowItemRenderer'
TASTE_PROFILE_ITEMS = ["contents", "tastebuilderRenderer", "contents"]
TASTE_PROFILE_ARTIST = ["title", "runs"]
SECTION_LIST_CONTINUATION = ['continuationContents', 'sectionListContinuation']
MENU_PLAYLIST_ID = MENU_ITEMS + [0 + 'menuNavigationItemRenderer'] + NAVIGATION_WATCH_PLAYLIST_ID
def nav(root, items, none_if_absent=False):

View file

@ -45,6 +45,7 @@ def parse_albums(results):
data = result[MTRIR]
album = {}
album['browseId'] = nav(data, TITLE + NAVIGATION_BROWSE_ID)
album['playlistId'] = nav(data, MENU_PLAYLIST_ID)
album['title'] = nav(data, TITLE_TEXT)
album['thumbnails'] = nav(data, THUMBNAIL_RENDERER)