Add like information to get_artist, get_history, get_library_songs, get_playlist

This commit is contained in:
sigma67 2020-05-25 16:16:13 +02:00
commit 400342bc9c
No known key found for this signature in database
GPG key ID: 1545A01D4474BAF0
2 changed files with 7 additions and 2 deletions

View file

@ -133,7 +133,11 @@ def parse_playlist_items(results):
duration = data['fixedColumns'][0][ duration = data['fixedColumns'][0][
'musicResponsiveListItemFixedColumnRenderer']['text']['runs'][0]['text'] 'musicResponsiveListItemFixedColumnRenderer']['text']['runs'][0]['text']
song = {'videoId': videoId, 'title': title, 'artists': artists, 'album': album} like = None
if 'menu' in data:
like = data['menu']['menuRenderer']['topLevelButtons'][0]['likeButtonRenderer']['likeStatus']
song = {'videoId': videoId, 'title': title, 'artists': artists, 'album': album, 'likeStatus': like}
if duration: if duration:
song['duration'] = duration song['duration'] = duration
if setVideoId: if setVideoId:

View file

@ -706,7 +706,8 @@ class YTMusic:
"name": "Lost", "name": "Lost",
"id": "MPREb_PxmzvDuqOnC" "id": "MPREb_PxmzvDuqOnC"
}, },
"duration": "2:58" "duration": "2:58",
"likeStatus": "INDIFFERENT"
} }
] ]
} }