breaking: improve artists key consistency (affects get_album, get_library_upload_*songs,album,artist)
This commit is contained in:
parent
ba57e1a8a0
commit
86790c07e2
3 changed files with 11 additions and 8 deletions
|
|
@ -455,7 +455,7 @@ class BrowsingMixin:
|
||||||
},
|
},
|
||||||
"description": "Seven is ...",
|
"description": "Seven is ...",
|
||||||
"thumbnails": [...],
|
"thumbnails": [...],
|
||||||
"artist": [
|
"artists": [
|
||||||
{
|
{
|
||||||
"name": "Martin Garrix",
|
"name": "Martin Garrix",
|
||||||
"id": "UCqJnSdHjKtfsrHi9aI-9d3g"
|
"id": "UCqJnSdHjKtfsrHi9aI-9d3g"
|
||||||
|
|
@ -492,10 +492,10 @@ class BrowsingMixin:
|
||||||
album['description'] = find_object_by_key(data, 'musicAlbumReleaseDetail', 'payload',
|
album['description'] = find_object_by_key(data, 'musicAlbumReleaseDetail', 'payload',
|
||||||
True)['description']
|
True)['description']
|
||||||
album['thumbnails'] = album_data['thumbnailDetails']['thumbnails']
|
album['thumbnails'] = album_data['thumbnailDetails']['thumbnails']
|
||||||
album['artist'] = []
|
album['artists'] = []
|
||||||
artists_data = find_objects_by_key(data, 'musicArtist', 'payload')
|
artists_data = find_objects_by_key(data, 'musicArtist', 'payload')
|
||||||
for artist in artists_data:
|
for artist in artists_data:
|
||||||
album['artist'].append({
|
album['artists'].append({
|
||||||
'name': artist['musicArtist']['name'],
|
'name': artist['musicArtist']['name'],
|
||||||
'id': artist['musicArtist']['externalChannelId']
|
'id': artist['musicArtist']['externalChannelId']
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,10 @@ class UploadsMixin:
|
||||||
{
|
{
|
||||||
"entityId": "t_po_CICr2crg7OWpchDpjPjrBA",
|
"entityId": "t_po_CICr2crg7OWpchDpjPjrBA",
|
||||||
"videoId": "Uise6RPKoek",
|
"videoId": "Uise6RPKoek",
|
||||||
"artist": "Coldplay",
|
"artists": [{
|
||||||
|
'name': 'Coldplay',
|
||||||
|
'id': 'FEmusic_library_privately_owned_artist_detaila_po_CICr2crg7OWpchIIY29sZHBsYXk',
|
||||||
|
}],
|
||||||
"title": "A Sky Full Of Stars",
|
"title": "A Sky Full Of Stars",
|
||||||
"album": "Ghost Stories",
|
"album": "Ghost Stories",
|
||||||
"likeStatus": "LIKE",
|
"likeStatus": "LIKE",
|
||||||
|
|
@ -110,7 +113,7 @@ class UploadsMixin:
|
||||||
"entityId": "t_po_CICr2crg7OWpchDKwoakAQ",
|
"entityId": "t_po_CICr2crg7OWpchDKwoakAQ",
|
||||||
"videoId": "Dtffhy8WJgw",
|
"videoId": "Dtffhy8WJgw",
|
||||||
"title": "Hold Me (Original Mix)",
|
"title": "Hold Me (Original Mix)",
|
||||||
"artist": [
|
"artists": [
|
||||||
{
|
{
|
||||||
"name": "Jakko",
|
"name": "Jakko",
|
||||||
"id": "FEmusic_library_privately_owned_artist_detaila_po_CICr2crg7OWpchIFamFra28"
|
"id": "FEmusic_library_privately_owned_artist_detaila_po_CICr2crg7OWpchIFamFra28"
|
||||||
|
|
@ -164,7 +167,7 @@ class UploadsMixin:
|
||||||
"videoId": "FVo-UZoPygI",
|
"videoId": "FVo-UZoPygI",
|
||||||
"title": "Feel So Close",
|
"title": "Feel So Close",
|
||||||
"duration": "4:15",
|
"duration": "4:15",
|
||||||
"artist": None,
|
"artists": None,
|
||||||
"album": {
|
"album": {
|
||||||
"name": "18 Months",
|
"name": "18 Months",
|
||||||
"id": "FEmusic_library_privately_owned_release_detailb_po_55chars"
|
"id": "FEmusic_library_privately_owned_release_detailb_po_55chars"
|
||||||
|
|
|
||||||
|
|
@ -24,12 +24,12 @@ def parse_uploaded_items(results):
|
||||||
'videoId': videoId,
|
'videoId': videoId,
|
||||||
'title': title,
|
'title': title,
|
||||||
'duration': duration,
|
'duration': duration,
|
||||||
'artist': None,
|
'artists': None,
|
||||||
'album': None,
|
'album': None,
|
||||||
'likeStatus': like,
|
'likeStatus': like,
|
||||||
'thumbnails': thumbnails
|
'thumbnails': thumbnails
|
||||||
}
|
}
|
||||||
song['artist'] = parse_song_artists(data, 1)
|
song['artists'] = parse_song_artists(data, 1)
|
||||||
song['album'] = parse_song_album(data, 2)
|
song['album'] = parse_song_album(data, 2)
|
||||||
|
|
||||||
songs.append(song)
|
songs.append(song)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue