[BUG] Podcast episodes no longer load, missing external_playback_url in metadata
See original GitHub issueSince a few days it is no longer possible to download podcast episodes through librespot due to a missing metadata item (external_playback_url
):
https://github.com/Yetangitu/Spodcast/issues/13
The problem is most likely caused by some missing scope or other authorisation-related item in the authorisation token, the question is - which? A similar problem seems to exist in the rust-based version (https://github.com/librespot-org/librespot/issues/818) where the absence of the required URL in the stream is also mentioned.
I do notice that the metadata returned by Spotify to the web based player is contradictory in that it claims an episode to not be externally hosted while serving an externally hosted stream:
{
"episodes" : [ {
...
...
"external_playback_url" : "https://traffic.megaphone.fm/GLT8613565834.mp3?updated=1655823165",
...
...
"is_externally_hosted" : false,
This change seems to have taken place on or around the 16th of June since that is the last day things worked as intended.
I notice the token generated by the web player is quite a bit longer than the one generated by librespot suggesting it contains some extra authorisations missing from the latter. The question is, which?
Issue Analytics
- State:
- Created a year ago
- Comments:12 (6 by maintainers)
Top GitHub Comments
It used to work with the existing endpoints, now it no longer does - the endpoint still returns data but this no longer contains playable streams, only previews. Here’s what used to be returned for Spotify-hosted podcasts:
API call to
https://api-partner.spotify.com/pathfinder/v1/query?operationName=getEpisode&variables={"uri":"spotify:episode:{epidodeId}"}...
Notice the use of the
anon-podcast.scdn.co
domain for serving these streams.Here’s what used to be returned for externally-hosted podcasts:
Notice the last object in the array which contains an external url.
This is what is returned now for the same API call:
The domain used for podcast streams (anon-podcast.scdn.co) does not exist any more:
…so it does look like something has changed on Spotify’s side. The returned data now only contains ‘preview’ URLs (which all return
HTTP/1.1 404 Not Found
when polled using the token from the web player, I guess these need special treatment in some way - are they Widevine-encumbered streams?). The actual playable stream has moved and is now found in the output fromGET /v1/episodes/{episodeId}
, inexternal_playback_url
. Switching out the token returned by librespot for the one returned by the web player makes this url appear in the output, this seems to be the only difference:Using a web player generated token:
The
external_playback_url
is playable without any further problems but… it only appears when using a web player provided token. Using a librespot generated token produces the same output minus the external_playback_url, i.e. it does not provide a playable stream.If
external_url
is not present,audio
is used. https://github.com/kokarare1212/librespot-python/blob/8ac9e6cf0d300fd30141daeeef4ef82a765cc118/librespot/audio/__init__.py#L751-L759