Added isAvailable flag for songs in playlists
This commit is contained in:
parent
c951c409f3
commit
12c465e18e
2 changed files with 9 additions and 2 deletions
|
|
@ -47,7 +47,8 @@ class PlaylistsMixin:
|
|||
},
|
||||
"duration": "2:58",
|
||||
"likeStatus": "INDIFFERENT",
|
||||
"thumbnails": [...]
|
||||
"thumbnails": [...],
|
||||
"isAvailable": True
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,13 +57,19 @@ def parse_playlist_items(results, menu_entries: List[List] = None):
|
|||
if 'thumbnail' in data:
|
||||
thumbnails = nav(data, THUMBNAILS)
|
||||
|
||||
isAvailable = True
|
||||
if 'musicItemRendererDisplayPolicy' in data:
|
||||
isAvailable = data[
|
||||
'musicItemRendererDisplayPolicy'] != 'MUSIC_ITEM_RENDERER_DISPLAY_POLICY_GREY_OUT'
|
||||
|
||||
song = {
|
||||
'videoId': videoId,
|
||||
'title': title,
|
||||
'artists': artists,
|
||||
'album': album,
|
||||
'likeStatus': like,
|
||||
'thumbnails': thumbnails
|
||||
'thumbnails': thumbnails,
|
||||
'isAvailable': isAvailable
|
||||
}
|
||||
if duration:
|
||||
song['duration'] = duration
|
||||
|
|
|
|||
Loading…
Reference in a new issue