[GH-ISSUE #562] No way to get currently playing podcast episode #338

Closed
opened 2026-02-27 23:22:04 +03:00 by kerem · 5 comments
Owner

Originally created by @the-lay on GitHub (Aug 28, 2020).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/562

Describe the bug
If you are playing a podcast episode and try to run current_playback, you will not get currently playing podcast episode.

According to the me/player docs, you also need to pass additional_types=episode to get podcast data.

current_playback calls me/player endpoint without additional_types and there is no way to pass it (only by manually building your own _internal_call).

Here's an example API response to me/player when playing podcast:

{
   "device":{
      "id":"REDACTED",
      "is_active":True,
      "is_private_session":False,
      "is_restricted":False,
      "name":"REDACTED",
      "type":"Computer",
      "volume_percent":100
   },
   "shuffle_state":False,
   "repeat_state":"off",
   "timestamp":1598641972668,
   "context":"None",
   "progress_ms":543215,
   "item":"None",
   "currently_playing_type":"episode",
   "actions":{
      "disallows":{
         "resuming":True
      }
   },
   "is_playing":True
}

Environment:
Spotipy 2.13.0

Originally created by @the-lay on GitHub (Aug 28, 2020). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/562 **Describe the bug** If you are playing a podcast episode and try to run `current_playback`, you will not get currently playing podcast episode. According to the [me/player docs](https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-get-information-about-the-users-current-playback), you also need to pass `additional_types=episode` to get podcast data. current_playback calls `me/player` endpoint without additional_types and there is no way to pass it (only by manually building your own `_internal_call`). Here's an example API response to `me/player` when playing podcast: ```python { "device":{ "id":"REDACTED", "is_active":True, "is_private_session":False, "is_restricted":False, "name":"REDACTED", "type":"Computer", "volume_percent":100 }, "shuffle_state":False, "repeat_state":"off", "timestamp":1598641972668, "context":"None", "progress_ms":543215, "item":"None", "currently_playing_type":"episode", "actions":{ "disallows":{ "resuming":True } }, "is_playing":True } ``` **Environment:** Spotipy 2.13.0
kerem 2026-02-27 23:22:04 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@the-lay commented on GitHub (Aug 28, 2020):

P.S. Manually calling _get("me/player", market=None, additional_types='episode') works fine, so the fix for this is to just add additional_types keyword to current_playback(market=None)

<!-- gh-comment-id:683115913 --> @the-lay commented on GitHub (Aug 28, 2020): P.S. Manually calling `_get("me/player", market=None, additional_types='episode')` works fine, so the fix for this is to just add `additional_types` keyword to `current_playback(market=None)`
Author
Owner

@naiadbaksh commented on GitHub (Jan 10, 2022):

Hi Ilja, I'm having trouble with this working in Python. I'm trying to add the addtional_types keyword, but I can't get the syntax right on the request call. I get a response, but this is the response. Notice the item is null.

`HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
"timestamp": 1641845238003,
"context": null,
"progress_ms": 2961089,
"item": null,
"currently_playing_type": "episode",
"actions": {
"disallows": {
"resuming": true
}
},
"is_playing": true
}`

Here is my function call.

`def execute_spotify_api_request_current(session_id, endpoint, post_=False, put_=False, ):
tokens = get_user_tokens(session_id)
headers = {'Content-Type': 'application/json',
'Authorization': "Bearer " + tokens.access_token}
# types = "track, episode"

if post_:
    post(BASE_URL + endpoint, headers=headers)
if put_:
    put(BASE_URL + endpoint, headers=headers)

response = get(BASE_URL + endpoint, {}, headers=headers)
try:
    return response.json()
except:
    return {'Error': 'Issue with request'}`
<!-- gh-comment-id:1009300236 --> @naiadbaksh commented on GitHub (Jan 10, 2022): Hi Ilja, I'm having trouble with this working in Python. I'm trying to add the addtional_types keyword, but I can't get the syntax right on the request call. I get a response, but this is the response. Notice the item is null. `HTTP 200 OK Allow: GET, HEAD, OPTIONS Content-Type: application/json Vary: Accept { "timestamp": 1641845238003, "context": null, "progress_ms": 2961089, "item": null, "currently_playing_type": "episode", "actions": { "disallows": { "resuming": true } }, "is_playing": true }` Here is my function call. `def execute_spotify_api_request_current(session_id, endpoint, post_=False, put_=False, ): tokens = get_user_tokens(session_id) headers = {'Content-Type': 'application/json', 'Authorization': "Bearer " + tokens.access_token} # types = "track, episode" if post_: post(BASE_URL + endpoint, headers=headers) if put_: put(BASE_URL + endpoint, headers=headers) response = get(BASE_URL + endpoint, {}, headers=headers) try: return response.json() except: return {'Error': 'Issue with request'}`
Author
Owner

@stephanebruckert commented on GitHub (Jan 10, 2022):

@naiadbaksh you don't seem to be using spotipy here?

<!-- gh-comment-id:1009386437 --> @stephanebruckert commented on GitHub (Jan 10, 2022): @naiadbaksh you don't seem to be using spotipy here?
Author
Owner

@naiadbaksh commented on GitHub (Jan 10, 2022):

I was! I found that I add the additional_types into the endpoint ie:

endpoint = "player/currently-playing?additional_types=track,episode"

and that allowed me to get the item

<!-- gh-comment-id:1009388292 --> @naiadbaksh commented on GitHub (Jan 10, 2022): I was! I found that I add the additional_types into the endpoint ie: `endpoint = "player/currently-playing?additional_types=track,episode"` and that allowed me to get the item
Author
Owner

@stephanebruckert commented on GitHub (Jan 10, 2022):

So, all fixed?

Should be, as additional_types has been added since the issue was raised https://spotipy.readthedocs.io/en/2.19.0/#spotipy.client.Spotify.currently_playing

<!-- gh-comment-id:1009393387 --> @stephanebruckert commented on GitHub (Jan 10, 2022): So, all fixed? Should be, as `additional_types` has been added since the issue was raised https://spotipy.readthedocs.io/en/2.19.0/#spotipy.client.Spotify.currently_playing
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#338
No description provided.