Invalid Client ID when trying to Authorize API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to take the billboard top 100 songs from a given date and generate a spotify playlist. I have replaced my client ID and secret with random values for privacy. When I execute the code below, I am expecting a browser to pop up that asks me to agree to spotify conditions. I have edited the settings in the developer tab in spotify to the redirect URI below and have obtained the correct client ID and secret from my account.
Help greatly appreciated.
import requests
from bs4 import BeautifulSoup
import spotipy
from spotipy.oauth2 import SpotifyOAuth
CLIENT_ID = "abcde"
CLIENT_SECRET = "1234"
date = input("What year do you want to travel to? Type the date in this format YYYY-MM-DD")
URL = f"https://www.billboard.com/charts/hot-100/{date}/"
response = requests.get(URL)
webpage = response.text
print(webpage)
soup = BeautifulSoup(webpage, "html.parser")
title = soup.select("li ul li h3")
song_list = [title[song].getText().strip() for song in range(0,100)]
print(song_list)
sp = spotipy.Spotify(auth_manager=SpotifyOAuth(client_id="CLIENT_ID",
client_secret="CLIENT_SECRET",
redirect_uri="http://example.com",
scope="playlist-modify-private",
show_dialog = True,
cache_path = "token.txt")
)
user_id = sp.current_user()["id"]
Labels:
- Labels:
-
api
-
Invalid Client ID
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page