Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Podcast Playlist retrieval not working #912

Open
deadl0ck opened this issue Dec 4, 2022 · 1 comment
Open

Podcast Playlist retrieval not working #912

deadl0ck opened this issue Dec 4, 2022 · 1 comment
Labels

Comments

@deadl0ck
Copy link

deadl0ck commented Dec 4, 2022

Describe the bug
Trying to call the "show_episodes" api in spotipy and getting back "returned 404 due to non existing id"

Your code
SHOW_ID = "00sL9tgDezr0PRSzd3C7H6"
spotify = spotipy.Spotify(client_credentials_manager=SpotifyClientCredentials())
results = spotify.show_episodes(f'{SHOW_ID}')

Expected behavior
Should return shows as JSON

Output
/Users/mstephenson/opt/miniconda3/envs/RAMagGenPy/bin/python /Users/mstephenson/git/RGDSMag/venv/spotify.py
HTTP Error for GET to https://api.spotify.com/v1/shows/00sL9tgDezr0PRSzd3C7H6/episodes/ with Params: {'limit': 50, 'offset': 0, 'market': None} returned 404 due to non existing id
Traceback (most recent call last):
File "/Users/mstephenson/opt/miniconda3/envs/RAMagGenPy/lib/python3.9/site-packages/spotipy/client.py", line 245, in _internal_call
response.raise_for_status()
File "/Users/mstephenson/opt/miniconda3/envs/RAMagGenPy/lib/python3.9/site-packages/requests/models.py", line 953, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.spotify.com/v1/shows/00sL9tgDezr0PRSzd3C7H6/episodes/?limit=50&offset=0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/mstephenson/git/RGDSMag/venv/spotify.py", line 9, in
results = spotify.show_episodes(f'{SHOW_ID}')
File "/Users/mstephenson/opt/miniconda3/envs/RAMagGenPy/lib/python3.9/site-packages/spotipy/client.py", line 512, in show_episodes
return self._get(
File "/Users/mstephenson/opt/miniconda3/envs/RAMagGenPy/lib/python3.9/site-packages/spotipy/client.py", line 297, in _get
return self._internal_call("GET", url, payload, kwargs)
File "/Users/mstephenson/opt/miniconda3/envs/RAMagGenPy/lib/python3.9/site-packages/spotipy/client.py", line 267, in _internal_call
raise SpotifyException(
spotipy.exceptions.SpotifyException: http status: 404, code:-1 - https://api.spotify.com/v1/shows/00sL9tgDezr0PRSzd3C7H6/episodes/?limit=50&offset=0:
non existing id, reason: None

Environment:

  • OS: Mac
  • Python version 3.9
  • spotipy version spotipy-2.21.0-py3-none-any.whl
  • your IDE (if using any) PyCharm

Additional context
I believe the scope is not being used.
I can get the show ID using curl and the example here: https://developer.spotify.com/console/get-show-episodes/?id=00sL9tgDezr0PRSzd3C7H6&market=&limit=50&offset=0

I can recreate the error in Curl if I use the Bearer ID from the spotipy client, so I believe there is an error with the Berer ID in that it needs to be in the correct scope (user-read-playback-position) - see https://developer.spotify.com/documentation/general/guides/authorization/scopes/

@deadl0ck deadl0ck added the bug label Dec 4, 2022
@dieser-niko
Copy link
Member

#925 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants