Add isExplicit to all playlist endpoints (#99)
This commit is contained in:
parent
8a87dfc65f
commit
f29fc72706
3 changed files with 8 additions and 1 deletions
|
|
@ -49,6 +49,7 @@ class PlaylistsMixin:
|
||||||
"likeStatus": "INDIFFERENT",
|
"likeStatus": "INDIFFERENT",
|
||||||
"thumbnails": [...],
|
"thumbnails": [...],
|
||||||
"isAvailable": True,
|
"isAvailable": True,
|
||||||
|
"isExplicit": False,
|
||||||
"feedbackTokens": {
|
"feedbackTokens": {
|
||||||
"add": "AB9zfpJxtvrU...",
|
"add": "AB9zfpJxtvrU...",
|
||||||
"remove": "AB9zfpKTyZ..."
|
"remove": "AB9zfpKTyZ..."
|
||||||
|
|
|
||||||
|
|
@ -27,3 +27,6 @@ THUMBNAILS = ['thumbnail', 'musicThumbnailRenderer'] + THUMBNAIL
|
||||||
THUMBNAIL_RENDERER = ['thumbnailRenderer', 'musicThumbnailRenderer'] + THUMBNAIL
|
THUMBNAIL_RENDERER = ['thumbnailRenderer', 'musicThumbnailRenderer'] + THUMBNAIL
|
||||||
THUMBNAIL_CROPPED = ['thumbnail', 'croppedSquareThumbnailRenderer'] + THUMBNAIL
|
THUMBNAIL_CROPPED = ['thumbnail', 'croppedSquareThumbnailRenderer'] + THUMBNAIL
|
||||||
FEEDBACK_TOKEN = ['feedbackEndpoint', 'feedbackToken']
|
FEEDBACK_TOKEN = ['feedbackEndpoint', 'feedbackToken']
|
||||||
|
BADGE_LABEL = [
|
||||||
|
'badges', 0, 'musicInlineBadgeRenderer', 'accessibilityData', 'accessibilityData', 'label'
|
||||||
|
]
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,8 @@ def parse_playlist_items(results, menu_entries: List[List] = None):
|
||||||
isAvailable = data[
|
isAvailable = data[
|
||||||
'musicItemRendererDisplayPolicy'] != 'MUSIC_ITEM_RENDERER_DISPLAY_POLICY_GREY_OUT'
|
'musicItemRendererDisplayPolicy'] != 'MUSIC_ITEM_RENDERER_DISPLAY_POLICY_GREY_OUT'
|
||||||
|
|
||||||
|
isExplicit = nav(data, BADGE_LABEL, True) == 'Explicit'
|
||||||
|
|
||||||
song = {
|
song = {
|
||||||
'videoId': videoId,
|
'videoId': videoId,
|
||||||
'title': title,
|
'title': title,
|
||||||
|
|
@ -69,7 +71,8 @@ def parse_playlist_items(results, menu_entries: List[List] = None):
|
||||||
'album': album,
|
'album': album,
|
||||||
'likeStatus': like,
|
'likeStatus': like,
|
||||||
'thumbnails': thumbnails,
|
'thumbnails': thumbnails,
|
||||||
'isAvailable': isAvailable
|
'isAvailable': isAvailable,
|
||||||
|
'isExplicit': isExplicit
|
||||||
}
|
}
|
||||||
if duration:
|
if duration:
|
||||||
song['duration'] = duration
|
song['duration'] = duration
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue