Skip to content
This repository has been archived by the owner on Jul 4, 2020. It is now read-only.

No podcast information in Current Playback State's item #1496

Closed
busybox11 opened this issue Mar 5, 2020 · 3 comments
Closed

No podcast information in Current Playback State's item #1496

busybox11 opened this issue Mar 5, 2020 · 3 comments

Comments

@busybox11
Copy link

Issue reported on March 5th 2020 (but found around August 2019).

Endpoint(s):

  • GET https://api.spotify.com/v1/me/player

Scope(s):

  • user-read-playback-state

How to reproduce:

Call the player endpoint and look at the item in response

Expected behaviour:

Podcast information should be returned just as it does with music

Actual behaviour:

Empty item

@gem7318
Copy link

gem7318 commented Apr 18, 2020

Having the same issue as well as with the item object in Currently Playing Track endpoint. Everything else looks fine from a data-population standpoint - codes/output for replication below.

In:

endpoints = {'Current Playback': r'https://api.spotify.com/v1/me/player',
             'Currently Playing Track':
             r'https://api.spotify.com/v1/me/player/currently-playing'}

keys_to_check = ['currently_playing_type', 'is_playing', 'progress_ms', 'item']

for endpoint, href in endpoints.items():

    request = requests.get(href, headers=headers)
    result = request.json()

    print(f"<{endpoint}>")
    for k in keys_to_check:
        print(f"\t{k}:\n\t\t{result[k]}\n")

Out:

<Current Playback>
	currently_playing_type:
		episode
	is_playing:
		True
	progress_ms:
		278824
	item:
		None

<Currently Playing Track>
	currently_playing_type:
		episode
	is_playing:
		True
	progress_ms:
		278904
	item:
		None

@gem7318
Copy link

gem7318 commented May 15, 2020

@busybox11 I just circled back to kick the tires on this again and ran across something in the (docs) as it relates to the additional_types query parameters, (also referenced in @felix-hilden's post here) that when included returns a populated item object for podcasts as well.

The only change to the above code in order for it to work properly is adding the additional_types argument in the href (added below). With that change the above returns track objects from both endpoints for podcasts so this issue should be closed from my perspective.

endpoints = {'Current Playback':
                 r'https://api.spotify.com/v1/me/player?additional_types=track,episode',
             'Currently Playing Track':
                r'https://api.spotify.com/v1/me/player/currently-playing?additional_types=track,episode'}

@joshubrown
Copy link
Contributor

@gem7318 Thanks for taking the time to document your solution here! I'll close this issue, @busybox11, please don't hesitate to join us in the new Spotify for Developers forum if you still have any questions.

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

No branches or pull requests

3 participants