Support format_id for audio stream URLs

This commit is contained in:
Rafael Moraes
2026-03-09 17:11:21 -03:00
parent b1fb4625c7
commit 82df9448d0
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -640,11 +640,11 @@ class SpotifyApi:
return widevine_license
async def get_audio_stream_urls(self, file_id: str) -> dict:
async def get_audio_stream_urls(self, format_id: str, file_id: str) -> dict:
await self._refresh_authorization_if_needed()
response = await self.client.get(
AUDIO_STREAM_URLS_API_URL.format(file_id=file_id),
AUDIO_STREAM_URLS_API_URL.format(format_id=format_id, file_id=file_id)
)
audio_stream_urls = safe_json(response)
+1 -1
View File
@@ -15,7 +15,7 @@ WIDEVINE_LICENSE_API_URL = (
SEEK_TABLE_API_URL = "https://seektables.scdn.co/seektable/{file_id}.json"
TRACK_CREDITS_API_URL = "https://spclient.wg.spotify.com/track-credits-view/v0/experimental/{track_id}/credits"
AUDIO_STREAM_URLS_API_URL = (
"https://gue1-spclient.spotify.com/storage-resolve/v2/files/audio/interactive/11/"
"https://gue1-spclient.spotify.com/storage-resolve/v2/files/audio/interactive/{format_id}/"
"{file_id}?version=10000000&product=9&platform=39&alt=json"
)
EXTEND_TRACK_COLLECTION_WAIT_TIME = 0.5