The function get_sha256_hash in spotapi/client.py is currently broken. All attempts to retrieve query hashes (artists, playlists, tracks) fail with HTTP 404. get_sha256_hash always fails, making artist/playlist/song queries unusable.
Root cause:
Spotify changed the structure of their CDN URLs by inverting the order of str_mapping and hash_mapping used to build the web-player asset paths.
Current code (broken):
urls = map(
lambda s: f"https://open.spotifycdn.com/cdn/build/web-player/{s}",
combine_chunks(str_mapping, hash_mapping),
)
Fixed code:
urls = map(
lambda s: f"https://open.spotifycdn.com/cdn/build/web-player/{s}",
combine_chunks(hash_mapping, str_mapping),
)
The function
get_sha256_hashinspotapi/client.pyis currently broken. All attempts to retrieve query hashes (artists, playlists, tracks) fail with HTTP 404.get_sha256_hashalways fails, making artist/playlist/song queries unusable.Root cause:
Spotify changed the structure of their CDN URLs by inverting the order of
str_mappingandhash_mappingused to build the web-player asset paths.Current code (broken):
Fixed code: