Ошибка при попытке аутентификации Spotify: Ошибка неверного запроса - PullRequest
0 голосов
/ 16 апреля 2020

Я пытался запустить следующий код на моем ноутбуке jupyter:

import spotipy 
sp = spotipy.Spotify() 
from spotipy.oauth2 import SpotifyClientCredentials 
import spotipy.util as util

# setting up authorization
cid ="my client id" 
secret = "my client secret"
# saving the info you're going to need
username = 'your_account_number'
scope = 'user-library-read' #check the documentation
authorization_url = 'https://accounts.spotify.com/authorize'
token_url = 'https://accounts.spotify.com/api/token'
redirect_uri ='https://localhost.com/callback/'

token = util.prompt_for_user_token(username,scope,client_id='client_id_number',client_secret='client_secret',redirect_uri='https://localhost.com/callback/')
client_credentials_manager = SpotifyClientCredentials(client_id=cid, client_secret=secret)
sp = spotipy.Spotify(client_credentials_manager=client_credentials_manager)

, который перенаправил бы меня на сайт. Однако на сайте есть только текст «INVALID_CLIENT: Неверный клиент» и больше ничего. Когда я вставляю этот URL в запрос, я получаю сообщение об ошибке неверного запроса. Я был бы признателен за любую помощь или руководство, которое вы можете предоставить. Спасибо!

...