Python脚本令牌刷新机制问题,用于Spotify API

huangapple go评论126阅读模式
英文:

Python Script Token Refresh Mechanism Problem for Spotify API

问题

  1. # Refresh access token **This is what I added after realizing program was getting stuck after about an hour of run-time**
  2. token_info = sp.auth_manager.get_cached_token()
  3. sp.auth_manager.refresh_access_token(token_info['refresh_token'])
  4. print("Refreshing Access Token.")
  5. new_token_info = sp.auth_manager.get_cached_token()
  6. print("Old access token:", token_info['access_token'])
  7. print("New access token:", new_token_info['access_token'])
  1. # Refresh access token **This is what I added after realizing program was getting stuck after about an hour of run-time**
  2. token_info = sp.auth_manager.get_cached_token()
  3. sp.auth_manager.refresh_access_token(token_info['refresh_token'])
  4. print("Refreshing Access Token.")
  5. new_token_info = sp.auth_manager.get_cached_token()
  6. print("Old access token:", token_info['access_token'])
  7. print("New access token:", new_token_info['access_token'])
  1. def refresh_access_token():
  2. sp.auth_manager.get_access_token(as_dict=False, check_cache=False)
  3. refresh_access_token()
  4. # Iterate through playlist IDs and extract track information
  5. for playlist_id in playlist_ids:
  6. # Use Spotipy API to get playlist data
  7. playlist = sp.playlist(playlist_id)
  8. # Use Spotipy API to get track data
  9. results = sp.playlist_tracks(playlist_id)
  10. count = 1
  11. # Extract track information and add to tracksData array
  12. for track in results['items']:
  13. track = track['track']
  14. print(f"Processing track: {track['artists'][0]['name']} - {track['name']} from playlist: {playlist['name']}")
  15. start_time = time.time()
  16. while True:
  17. try:
  18. tracksData.append({
  19. 'artistName': track['artists'][0]['name'],
  20. 'songName': track['name'],
  21. 'releaseDate': track['album']['release_date'],
  22. 'positionInPlaylist': count,
  23. 'artistFollowers': sp.artist(track['artists'][0]['id'])['followers']['total'],
  24. 'albumImageUrl': track['album']['images'][0]['url'],
  25. 'trackPopularity': track['popularity'],
  26. 'artistPopularity': sp.artist(track['artists'][0]['id'])['popularity'],
  27. 'isrc': track['external_ids']['isrc'],
  28. 'albumLabel': sp.album(track["album"]["id"])["label"],
  29. 'albumExternalUrl': track['album']['external_urls']['spotify'],
  30. 'playlistId': playlist_id,
  31. 'playlistName': playlist['name'], # Set playlistName to actual name of playlist
  32. 'playlistImage': playlist['images'][0]['url'], # Add playlist image to dictionary
  33. 'playlistFollowers': playlist['followers']['total'], # Add playlist followers to dictionary
  34. 'trackId': track['id'], # Add track ID to dictionary
  35. 'albumId': track['album']['id'] # Add album ID to dictionary
  36. })
  37. count += 1
  38. break
  39. except spotipy.exceptions.SpotifyException:
  40. refresh_access_token()
  41. except Exception as e:
  42. print(e)
  43. time.sleep(2) # Pause for 2 seconds before processing the next playlist
英文:

I'm writing a python script to iterate through new music editorial playlists with the spotify api to pull track, artist, album information into a csv file. My script worked great for a while, perfectly executing through all tracks on the playlists in my list of ids, but stopped while processing a track after about an hour of run-time. I thought this might have to do with my access token expiring, so I added some code towards the beginning of my script to get the cached access token info and refresh it each new run thinking this would re-initiate at least a new hour of run-time so I could dive deeper to see if/where I need to add an automatic refresh while the data pulling is iterating if my access token expires in the future. For whatever reason my script isn't retrieving a bad request or token expire error to the console it is simply just getting stuck while processing the first track on the first playlist as you can see in the screenshot below. For context, while it was working the console was printing every track in the same format from all playlist ids in my list and then it got stuck in the middle of a single playlistid as it is now, but now it is getting stuck at the very first track on the first playlist. I am almost certain this is some sort of issue with my access token, I guess my question is why is it getting stuck and not throwing an error, and how can I fix this so it automatically refreshes properly to continue running without exiting execution early. Thanks!

Python脚本令牌刷新机制问题,用于Spotify API

  1. import csv
  2. from datetime import datetime, timedelta
  3. import spotipy
  4. from spotipy.oauth2 import SpotifyOAuth
  5. import time
  6. # Set up credentials and authorization parameters
  7. client_id = 'myclientid'
  8. client_secret = 'myclientsecret'
  9. redirect_uri = 'https://google.com/'
  10. scope = 'playlist-modify-public playlist-modify-private'
  11. username = 'myusername'
  12. # Create Spotipy object using SpotifyOAuth
  13. sp = spotipy.Spotify(
  14. auth_manager=SpotifyOAuth(
  15. client_id=client_id,
  16. client_secret=client_secret,
  17. redirect_uri=redirect_uri,
  18. scope=scope,
  19. username=username
  20. )
  21. )
  22. # Refresh access token **This is what I added after realizing program was getting stuck after about an hour of run-time**
  23. token_info = sp.auth_manager.get_cached_token()
  24. sp.auth_manager.refresh_access_token(token_info['refresh_token'])
  25. print("Refreshing Access Token.")
  26. new_token_info = sp.auth_manager.get_cached_token()
  27. print("Old access token:", token_info['access_token'])
  28. print("New access token:", new_token_info['access_token'])
  29. # Define a list of playlist IDs
  30. playlist_ids = ['37i9dQZF1DX4JAvHpjipBk', '37i9dQZF1DX0XUsuxWHRQd', '37i9dQZF1DXdwmD5Q7Gxah', '37i9dQZF1DXcBWIGoYBM5M', '37i9dQZF1DX10zKzsJ2jva', '37i9dQZF1DWY7IeIP1cdjF', '37i9dQZF1DX76Wlfdnj7AP', '37i9dQZF1DX0FOF1IUWK1W', '37i9dQZF1DX1lVhptIYRda', '37i9dQZF1DXdSjVZQzv2tl', '37i9dQZF1DX4sWSpwq3LiO', '37i9dQZF1DWY4xHQp97fN6', '37i9dQZF1DWZjqjZMudx9T', '37i9dQZF1DX4SBhb3fqCJd', '37i9dQZF1DX4dyzvuaRJ0n', '37i9dQZF1DWTkIwO2HDifB', '37i9dQZF1DWWQRwui0ExPn', '37i9dQZF1DXaXB8fQg7xif', '37i9dQZF1DX5BAPG29mHS8', '37i9dQZF1DWZd79rJ6a7lp', '37i9dQZF1DXcZQSjptOQtk', '37i9dQZF1DXcF6B6QPhFDv', '37i9dQZF1DX9tPFwDMOaN1', '37i9dQZF1DWWY64wDtewQt', '37i9dQZF1DX0BcQWzuB7ZO', '37i9dQZF1DXcZDD7cfEKhW', '37i9dQZF1DWYBO1MoTDhZI', '37i9dQZF1DXbbu94YBG7Ye', '37i9dQZF1DXb0COFso7q0D', '37i9dQZF1DWY4lFlS4Pnso', '37i9dQZF1DWUa8ZRTfalHk', '37i9dQZF1DXaxEKcoCdWHD', '37i9dQZF1DWSpF87bP6JSF', '37i9dQZF1DX6GwdWRQMQpq']
  31. tracksData = []
  32. # Iterate through playlist IDs and extract track information
  33. for playlist_id in playlist_ids:
  34. # Use Spotipy API to get playlist data
  35. playlist = sp.playlist(playlist_id)
  36. # Use Spotipy API to get track data
  37. results = sp.playlist_tracks(playlist_id)
  38. count = 1
  39. # Extract track information and add to tracksData array
  40. for track in results['items']:
  41. track = track['track']
  42. print(f"Processing track: {track['artists'][0]['name']} - {track['name']} from playlist: {playlist['name']}")
  43. start_time = time.time()
  44. try:
  45. sp.artist(track['artists'][0]['id'])
  46. sp.track(track['id'])
  47. sp.album(track['album']['id'])
  48. except:
  49. pass
  50. elapsed_time = time.time() - start_time
  51. if elapsed_time > 3:
  52. print(f"Skipping track: {track['artists'][0]['name']} - {track['name']} from playlist: {playlist['name']} (took too long to process)")
  53. continue
  54. tracksData.append({
  55. 'artistName': track['artists'][0]['name'],
  56. 'songName': track['name'],
  57. 'releaseDate': track['album']['release_date'],
  58. 'positionInPlaylist': count,
  59. 'artistFollowers': sp.artist(track['artists'][0]['id'])['followers']['total'],
  60. 'albumImageUrl': track['album']['images'][0]['url'],
  61. 'trackPopularity': track['popularity'],
  62. 'artistPopularity': sp.artist(track['artists'][0]['id'])['popularity'],
  63. 'isrc': track['external_ids']['isrc'],
  64. 'albumLabel': sp.album(track["album"]["id"])["label"],
  65. 'albumExternalUrl': track['album']['external_urls']['spotify'],
  66. 'playlistId': playlist_id,
  67. 'playlistName': playlist['name'], # Set playlistName to actual name of playlist
  68. 'playlistImage': playlist['images'][0]['url'], # Add playlist image to dictionary
  69. 'playlistFollowers': playlist['followers']['total'], # Add playlist followers to dictionary
  70. 'trackId': track['id'], # Add track ID to dictionary
  71. 'albumId': track['album']['id'] # Add album ID to dictionary
  72. })
  73. count += 1
  74. time.sleep(2) # Pause for 2 seconds before processing the next playlist
  75. # Calculate the most recent Friday
  76. today = datetime.today()
  77. friday = today - timedelta((today.weekday() - 4) % 7)
  78. # Calculate the date 7 days prior to the most recent Friday
  79. lastWeekFriday = friday - timedelta(days=7)
  80. # Create a list of track dictionaries with release dates within the past week
  81. recentTracks = []
  82. for track in tracksData:
  83. # Convert release date string to datetime object
  84. releaseDate = datetime.strptime(track['releaseDate'], '%Y-%m-%d')
  85. # Check if release date is within the past week
  86. if lastWeekFriday <= releaseDate < friday:
  87. recentTracks.append(track)
  88. # Create and write track data to CSV file
  89. with open('tracksData.csv', mode='w', newline='') as csv_file:
  90. fieldnames = ['artistName', 'songName', 'releaseDate', 'positionInPlaylist', 'artistFollowers', 'albumImageUrl',
  91. 'trackPopularity', 'artistPopularity', 'isrc', 'albumLabel', 'albumExternalUrl', 'playlistId',
  92. 'playlistName', 'playlistImage', 'playlistFollowers', 'trackId', 'albumId']
  93. writer = csv.DictWriter(csv_file, fieldnames=fieldnames)
  94. writer.writeheader()
  95. for track in recentTracks:
  96. writer.writerow(track)

Edit: I just tried switching auth methods to client flow since I'm not using any user scopes really in my code to see if it would make a difference. The new auth method has been incorporated into the 2nd block of code. It has not changed anything, it is still stuck.
New attempt fixing using client auth method. Tried adding refresh before iterating thru playlists too and also try except argument during iterations, still stuck processing 1st track.

  1. client_id = 'client_id'
  2. client_secret = 'client_secret'
  3. auth_manager = SpotifyClientCredentials(client_id=client_id, client_secret=client_secret)
  4. sp = spotipy.Spotify(auth_manager=auth_manager)
  5. ...
  6. def refresh_access_token():
  7. sp.auth_manager.get_access_token(as_dict=False, check_cache=False)
  8. refresh_access_token()
  9. # Iterate through playlist IDs and extract track information
  10. for playlist_id in playlist_ids:
  11. # Use Spotipy API to get playlist data
  12. playlist = sp.playlist(playlist_id)
  13. # Use Spotipy API to get track data
  14. results = sp.playlist_tracks(playlist_id)
  15. count = 1
  16. # Extract track information and add to tracksData array
  17. for track in results['items']:
  18. track = track['track']
  19. print(f"Processing track: {track['artists'][0]['name']} - {track['name']} from playlist: {playlist['name']}")
  20. start_time = time.time()
  21. while True:
  22. try:
  23. tracksData.append({
  24. 'artistName': track['artists'][0]['name'],
  25. 'songName': track['name'],
  26. 'releaseDate': track['album']['release_date'],
  27. 'positionInPlaylist': count,
  28. 'artistFollowers': sp.artist(track['artists'][0]['id'])['followers']['total'],
  29. 'albumImageUrl': track['album']['images'][0]['url'],
  30. 'trackPopularity': track['popularity'],
  31. 'artistPopularity': sp.artist(track['artists'][0]['id'])['popularity'],
  32. 'isrc': track['external_ids']['isrc'],
  33. 'albumLabel': sp.album(track["album"]["id"])["label"],
  34. 'albumExternalUrl': track['album']['external_urls']['spotify'],
  35. 'playlistId': playlist_id,
  36. 'playlistName': playlist['name'], # Set playlistName to actual name of playlist
  37. 'playlistImage': playlist['images'][0]['url'], # Add playlist image to dictionary
  38. 'playlistFollowers': playlist['followers']['total'], # Add playlist followers to dictionary
  39. 'trackId': track['id'], # Add track ID to dictionary
  40. 'albumId': track['album']['id'] # Add album ID to dictionary
  41. })
  42. count += 1
  43. break
  44. except spotipy.exceptions.SpotifyException:
  45. refresh_access_token()
  46. except Exception as e:
  47. print(e)
  48. time.sleep(2) # Pause for 2 seconds before processing the next playlist
  49. </details>
  50. # 答案1
  51. **得分**: 1
  52. 以下是代码的翻译部分:
  53. "The `spotipy` not provide auto update access -token but you can update new access-token its functionality."
  54. "spotipy" 不提供自动更新访问令牌,但你可以更新新的访问令牌以实现其功能。
  55. "The `is_token_expired()` can check expired access token or not."
  56. `is_token_expired()` 可以检查访问令牌是否已过期。
  57. "The `refresh_access_token()` update an `access token` by input parameter of `refresh token`."
  58. `refresh_access_token()` 通过输入参数 `refresh token` 来更新 `access token`
  59. "You don't manage one-hour time monitoring and handling."
  60. 你不需要管理一小时的时间监控和处理。
  61. "This code will give a hint, on how to address your problem."
  62. 这段代码将为你提供解决问题的提示。
  63. "Result"
  64. 结果
  65. "I tested this demo code, to save JSON file for each playlist."
  66. 我测试了这个演示代码,用于保存每个播放列表的 JSON 文件。
  67. "The problem was Spotify API calling limit not a token issue."
  68. 问题出在 Spotify API 的调用限制上,而不是令牌问题。
  69. "I don't know exactly what is limit of the total number of call."
  70. 我不确定总调用次数的限制是多少。
  71. "Here is [information](https://developer.spotify.com/documentation/web-api/guides/rate-limits/)"
  72. 你可以在[这里](https://developer.spotify.com/documentation/web-api/guides/rate-limits/)找到相关信息。
  73. "Result"
  74. 结果
  75. "Total 2344 tracks(songs) and 34 playlists without a problem."
  76. 总共有 2344 首歌曲和 34 个播放列表,没有问题。
  77. "This is the last saved json file (part of it)"
  78. 这是最后保存的 JSON 文件(其中的一部分)。
  79. <details>
  80. <summary>英文:</summary>
  81. The `spotipy` not provide auto update access -token but you can update new access-token its functionality.
  82. The `is_token_expired()` can check expired access token or not.
  83. The `refresh_access_token()` update an `access token` by input parameter of `refresh token`.
  84. You don&#39;t manage one-hour time monitoring and handling.
  85. This code will give a hint, on how to address your problem.

from datetime import datetime
import spotipy
from spotipy.oauth2 import SpotifyOAuth
import json

Set up credentials and authorization parameters

client_id = '<your client id>'
client_secret = '<your client secret>'
redirect_uri = '<your redirect URL'
scope = 'playlist-modify-public playlist-modify-private'
username = '<your user id>'

Create Spotipy object using SpotifyOAuth

sp = spotipy.Spotify(
auth_manager=SpotifyOAuth(
client_id=client_id,
client_secret=client_secret,
redirect_uri=redirect_uri,
scope=scope,
username=username
)
)

get token information

token_info = sp.auth_manager.get_cached_token()
refresh_token = token_info['refresh_token']

print('first access token')
print(json.dumps(token_info, indent=2))
print(datetime.fromtimestamp(int(token_info['expires_at'])))
print(sp.auth_manager.is_token_expired(token_info))

print('-------------------------------------------------')

get new access token by refresh token

sp.auth_manager.refresh_access_token(refresh_token)
token_info = sp.auth_manager.get_cached_token()

print('Second access token')
print(json.dumps(token_info, indent=2))
print(datetime.fromtimestamp(int(token_info['expires_at'])))
print(sp.auth_manager.is_token_expired(token_info))

  1. Result
  2. [![enter image description here][1]][1]
  3. I tested this demo code, to save JSON file for each playlist.
  4. The problem was Spotify API calling limit not a token issue.
  5. I added API call calculation. Spotify allows for approximately 180 requests per minute but I got 234.5 calls /minuets it was no problem, I think it may my call within number or total call limit.
  6. I don&#39;t know exactly what is limit of total number of call.
  7. Here is [information](https://developer.spotify.com/documentation/web-api/guides/rate-limits/)

import spotipy
from spotipy.oauth2 import SpotifyOAuth
import time
from datetime import datetime
import json
import asyncio
import os

Set up credentials and authorization parameters

client_id = '<your client id>'
client_secret = '<your client secret>'
redirect_uri = '<your redirect uri>'
scope = 'playlist-modify-public playlist-modify-private'
username = '<your user id>'
data_directory = 'tracks'

Create Spotipy object using SpotifyOAuth

sp = spotipy.Spotify(
auth_manager=SpotifyOAuth(
client_id=client_id,
client_secret=client_secret,
redirect_uri=redirect_uri,
scope=scope,
username=username
)
)

token_info = sp.auth_manager.get_access_token()
refresh_token = token_info['refresh_token']

playlist_ids = ['37i9dQZF1DX4JAvHpjipBk', '37i9dQZF1DX0XUsuxWHRQd', '37i9dQZF1DXdwmD5Q7Gxah', '37i9dQZF1DXcBWIGoYBM5M', '37i9dQZF1DX10zKzsJ2jva', '37i9dQZF1DWY7IeIP1cdjF', '37i9dQZF1DX76Wlfdnj7AP', '37i9dQZF1DX0FOF1IUWK1W', '37i9dQZF1DX1lVhptIYRda', '37i9dQZF1DXdSjVZQzv2tl', '37i9dQZF1DX4sWSpwq3LiO', '37i9dQZF1DWY4xHQp97fN6', '37i9dQZF1DWZjqjZMudx9T', '37i9dQZF1DX4SBhb3fqCJd', '37i9dQZF1DX4dyzvuaRJ0n', '37i9dQZF1DWTkIwO2HDifB', '37i9dQZF1DWWQRwui0ExPn', '37i9dQZF1DXaXB8fQg7xif', '37i9dQZF1DX5BAPG29mHS8', '37i9dQZF1DWZd79rJ6a7lp', '37i9dQZF1DXcZQSjptOQtk', '37i9dQZF1DXcF6B6QPhFDv', '37i9dQZF1DX9tPFwDMOaN1', '37i9dQZF1DWWY64wDtewQt', '37i9dQZF1DX0BcQWzuB7ZO', '37i9dQZF1DXcZDD7cfEKhW', '37i9dQZF1DWYBO1MoTDhZI', '37i9dQZF1DXbbu94YBG7Ye', '37i9dQZF1DXb0COFso7q0D', '37i9dQZF1DWY4lFlS4Pnso', '37i9dQZF1DWUa8ZRTfalHk', '37i9dQZF1DXaxEKcoCdWHD', '37i9dQZF1DWSpF87bP6JSF', '37i9dQZF1DX6GwdWRQMQpq']

now = datetime.now()
if not os.path.exists('./{}'.format(data_directory)):
os.makedirs('./{}'.format(data_directory))

count = 1
try:
for playlist_id in playlist_ids:
# Use Spotipy API to get playlist data
playlist = sp.playlist(playlist_id)

  1. # Use Spotipy API to get track data
  2. results = sp.playlist_tracks(playlist_id)
  3. tracksData = []
  4. print(f&quot;Started Playlist: {playlist[&#39;id&#39;]}&quot;)
  5. # Extract track information and add to tracksData array
  6. for track in results[&#39;items&#39;]:
  7. track = track[&#39;track&#39;]
  8. print(f&quot;Processing track: {track[&#39;artists&#39;][0][&#39;name&#39;]} - {track[&#39;name&#39;]} from playlist - count:{count}: {playlist[&#39;name&#39;]}&quot;)
  9. start_time = time.time()
  10. tracksData.append({
  11. &#39;artistName&#39;: track[&#39;artists&#39;][0][&#39;name&#39;],
  12. &#39;songName&#39;: track[&#39;name&#39;],
  13. &#39;releaseDate&#39;: track[&#39;album&#39;][&#39;release_date&#39;],
  14. &#39;positionInPlaylist&#39;: count,
  15. &#39;artistFollowers&#39;: sp.artist(track[&#39;artists&#39;][0][&#39;id&#39;])[&#39;followers&#39;][&#39;total&#39;],
  16. &#39;albumImageUrl&#39;: track[&#39;album&#39;][&#39;images&#39;][0][&#39;url&#39;],
  17. &#39;trackPopularity&#39;: track[&#39;popularity&#39;],
  18. &#39;artistPopularity&#39;: sp.artist(track[&#39;artists&#39;][0][&#39;id&#39;])[&#39;popularity&#39;],
  19. &#39;isrc&#39;: track[&#39;external_ids&#39;][&#39;isrc&#39;],
  20. &#39;albumLabel&#39;: sp.album(track[&quot;album&quot;][&quot;id&quot;])[&quot;label&quot;],
  21. &#39;albumExternalUrl&#39;: track[&#39;album&#39;][&#39;external_urls&#39;][&#39;spotify&#39;],
  22. &#39;playlistId&#39;: playlist_id,
  23. &#39;playlistName&#39;: playlist[&#39;name&#39;], # Set playlistName to actual name of playlist
  24. &#39;playlistImage&#39;: playlist[&#39;images&#39;][0][&#39;url&#39;], # Add playlist image to dictionary
  25. &#39;playlistFollowers&#39;: playlist[&#39;followers&#39;][&#39;total&#39;], # Add playlist followers to dictionary
  26. &#39;trackId&#39;: track[&#39;id&#39;], # Add track ID to dictionary
  27. &#39;albumId&#39;: track[&#39;album&#39;][&#39;id&#39;] # Add album ID to dictionary
  28. })
  29. count += 1
  30. asyncio.sleep(2)
  31. if(sp.auth_manager.is_token_expired(token_info)):
  32. sp.auth_manager.refresh_access_token(refresh_token)
  33. token_info = sp.auth_manager.get_cached_token()
  34. refresh_token = token_info[&#39;refresh_token&#39;]
  35. print(f&quot;Finished Playlist: {playlist[&#39;id&#39;]}&quot;)
  36. json_object = json.dumps(tracksData, indent=4)
  37. print(json.dumps(tracksData, indent=2))
  38. file_name = &#39;./{}/{}.json&#39;.format(data_directory, playlist[&#39;id&#39;])
  39. with open(file_name, &quot;w&quot;) as outfile:
  40. outfile.write(json_object)

except Exception as error:
print("Exception occurred for value '"+ count + "': "+ repr(error))

later = datetime.now()
difference = (later - now).total_seconds()
minutes = difference // 60
print(f"The number of API calls: {count/minutes}")

  1. Result
  2. Total 2344 tracks(songs) and 34 playlists without a problem.

Processing track: Spiffy The Goat - No Clappin' Shemix (Throw It) from playlist - count:2342: Feelin' Myself
Processing track: Monaleo - Body Bag from playlist - count:2343: Feelin' Myself
Processing track: Rican Da Menace - I Admit It from playlist - count:2344: Feelin' Myself

  1. [![enter image description here][2]][2]
  2. [![enter image description here][3]][3]
  3. This is the last saved json file (part of it)
  4. `37i9dQZF1DXdwmD5Q7Gxah.json`

[
{
"artistName": "d4vd",
"songName": "WORTHLESS",
"releaseDate": "2023-03-09",
"positionInPlaylist": 151,
"artistFollowers": 800225,
"albumImageUrl": "https://i.scdn.co/image/ab67616d0000b273c158e7f083a8e87f7a5662a8",
"trackPopularity": 64,
"artistPopularity": 84,
"isrc": "USUM72302840",
"albumLabel": "Darkroom/Interscope Records",
"albumExternalUrl": "https://open.spotify.com/album/3hNpYeCH7WOUNhXxV7AosH",
"playlistId": "37i9dQZF1DXdwmD5Q7Gxah",
"playlistName": "Lorem",
"playlistImage": "https://i.scdn.co/image/ab67706f00000003346b60cf6d7b749de180c3ae",
"playlistFollowers": 1019959,
"trackId": "13b4mk5KeJxL0GllHLvtXQ",
"albumId": "3hNpYeCH7WOUNhXxV7AosH"
}
...

  1. {
  2. &quot;artistName&quot;: &quot;georgee&quot;,
  3. &quot;songName&quot;: &quot;sad&quot;,
  4. &quot;releaseDate&quot;: &quot;2022-09-28&quot;,
  5. &quot;positionInPlaylist&quot;: 250,
  6. &quot;artistFollowers&quot;: 5386,
  7. &quot;albumImageUrl&quot;: &quot;https://i.scdn.co/image/ab67616d0000b273a1fd9c8268069b6fb5c3c80e&quot;,
  8. &quot;trackPopularity&quot;: 47,
  9. &quot;artistPopularity&quot;: 38,
  10. &quot;isrc&quot;: &quot;QZRYT2100043&quot;,
  11. &quot;albumLabel&quot;: &quot;Good Boy Records&quot;,
  12. &quot;albumExternalUrl&quot;: &quot;https://open.spotify.com/album/6XcchJ2jRgI28zFKMUulO9&quot;,
  13. &quot;playlistId&quot;: &quot;37i9dQZF1DXdwmD5Q7Gxah&quot;,
  14. &quot;playlistName&quot;: &quot;Lorem&quot;,
  15. &quot;playlistImage&quot;: &quot;https://i.scdn.co/image/ab67706f00000003346b60cf6d7b749de180c3ae&quot;,
  16. &quot;playlistFollowers&quot;: 1019959,
  17. &quot;trackId&quot;: &quot;5kIfQKgQeFcLaQ3BYvpbDI&quot;,
  18. &quot;albumId&quot;: &quot;6XcchJ2jRgI28zFKMUulO9&quot;
  19. }

]

  1. [![enter image description here][4]][4]
  2. [1]: https://i.stack.imgur.com/VK2Vh.png
  3. [2]: https://i.stack.imgur.com/dYpBp.png
  4. [3]: https://i.stack.imgur.com/j7XMC.png
  5. [4]: https://i.stack.imgur.com/rQ7jF.png
  6. </details>

huangapple
  • 本文由 发表于 2023年3月12日 09:22:51
  • 转载请务必保留本文链接:https://go.coder-hub.com/75710572.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定