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",
|
"duration": "2:58",
|
||||||
"likeStatus": "INDIFFERENT",
|
"likeStatus": "INDIFFERENT",
|
||||||
"thumbnails": [...]
|
"thumbnails": [...],
|
||||||
|
"isAvailable": True
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,13 +57,19 @@ def parse_playlist_items(results, menu_entries: List[List] = None):
|
||||||
if 'thumbnail' in data:
|
if 'thumbnail' in data:
|
||||||
thumbnails = nav(data, THUMBNAILS)
|
thumbnails = nav(data, THUMBNAILS)
|
||||||
|
|
||||||
|
isAvailable = True
|
||||||
|
if 'musicItemRendererDisplayPolicy' in data:
|
||||||
|
isAvailable = data[
|
||||||
|
'musicItemRendererDisplayPolicy'] != 'MUSIC_ITEM_RENDERER_DISPLAY_POLICY_GREY_OUT'
|
||||||
|
|
||||||
song = {
|
song = {
|
||||||
'videoId': videoId,
|
'videoId': videoId,
|
||||||
'title': title,
|
'title': title,
|
||||||
'artists': artists,
|
'artists': artists,
|
||||||
'album': album,
|
'album': album,
|
||||||
'likeStatus': like,
|
'likeStatus': like,
|
||||||
'thumbnails': thumbnails
|
'thumbnails': thumbnails,
|
||||||
|
'isAvailable': isAvailable
|
||||||
}
|
}
|
||||||
if duration:
|
if duration:
|
||||||
song['duration'] = duration
|
song['duration'] = duration
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue