I'm not getting episode info back from the API.
Are others seeing this? I tried using ids from the docs as well as ones I'm pulling off of urls.
I tried hitting the API directly and through spotipy like so:
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
auth_manager = SpotifyClientCredentials()
sp = spotipy.Spotify(auth_manager=auth_manager)
episodes = sp.episodes(["512ojhOuo1ktJprKbVcKyQ"])
print("Got episodes:", episodes) # Got episodes: {'episodes': [None]}
Thanks for your help!
Ah, looks like this is a token issue.
When I generate a token from the Spotify dev console and inject that into a request, it works.
Not sure how to properly generate a token in code. The follow gives me a token that doesn't work for the episodes endpoint:
res = requests.post("https://accounts.spotify.com/api/token", data={ "grant_type": "client_credentials" }, headers={ 'Authorization': 'Basic ' + base64.b64encode((SPOTIFY_CLIENT_ID + ":" + SPOTIFY_CLIENT_SECRET).encode()).decode(), "Content-Type": "application/x-www-form-urlencoded" })Any of y'all know what might be my issue? Thanks!