Closed busybox11 closed 4 years ago
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
@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'}
@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.
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 theitem
in responseExpected behaviour:
Podcast information should be returned just as it does with music
Actual behaviour:
Empty
item