spotify / web-api

This issue tracker is no longer used. Join us in the Spotify for Developers forum for support with the Spotify Web API ➡️ https://community.spotify.com/t5/Spotify-for-Developers/bd-p/Spotify_Developer
983 stars 79 forks source link

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

Closed busybox11 closed 4 years ago

busybox11 commented 4 years ago

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

Endpoint(s):

Scope(s):

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 commented 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
gem7318 commented 4 years ago

@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 commented 4 years ago

@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.