[GH-ISSUE #47] self.client_version: "IndexError: list index out of range" #30

Closed
opened 2026-02-27 19:06:31 +03:00 by kerem · 4 comments
Owner

Originally created by @Leogendra on GitHub (Sep 8, 2025).
Original GitHub issue: https://github.com/Aran404/SpotAPI/issues/47

Full error:

Traceback (most recent call last):
  File "~\test\tests\test.py", line 8, in <module>
    playlist_info = PublicPlaylist(PLAYLIST_ID).get_playlist_info(limit=5000)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~\test\venv\Lib\site-packages\spotapi\types\annotations.py", line 47, in wrapper
    result: R = func(*args, **kwargs)
                ^^^^^^^^^^^^^^^^^^^^^
  File "~\test\venv\Lib\site-packages\spotapi\playlist.py", line 72, in get_playlist_info
    "sha256Hash": self.base.part_hash("fetchPlaylist"),
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~\test\venv\Lib\site-packages\spotapi\types\annotations.py", line 47, in wrapper
    result: R = func(*args, **kwargs)
                ^^^^^^^^^^^^^^^^^^^^^
  File "~\test\venv\Lib\site-packages\spotapi\client.py", line 163, in part_hash
    self.get_sha256_hash()
  File "~\test\venv\Lib\site-packages\spotapi\types\annotations.py", line 47, in wrapper
    result: R = func(*args, **kwargs)
                ^^^^^^^^^^^^^^^^^^^^^
  File "~\test\venv\Lib\site-packages\spotapi\client.py", line 186, in get_sha256_hash
    self.client_version = resp.response.split('clientVersion:"')[1].split(',')[0]
                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

Minimal code to reproduce the error:

from spotapi import PublicPlaylist

playlist_info = PublicPlaylist("6zCID88oNjNv9zx6puDHKj").get_playlist_info(limit=5000)

You need to be on the last version of Spotapi, which is #44 but it haven't been pushed to Pypi.

Originally created by @Leogendra on GitHub (Sep 8, 2025). Original GitHub issue: https://github.com/Aran404/SpotAPI/issues/47 Full error: ``` Traceback (most recent call last): File "~\test\tests\test.py", line 8, in <module> playlist_info = PublicPlaylist(PLAYLIST_ID).get_playlist_info(limit=5000) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "~\test\venv\Lib\site-packages\spotapi\types\annotations.py", line 47, in wrapper result: R = func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "~\test\venv\Lib\site-packages\spotapi\playlist.py", line 72, in get_playlist_info "sha256Hash": self.base.part_hash("fetchPlaylist"), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "~\test\venv\Lib\site-packages\spotapi\types\annotations.py", line 47, in wrapper result: R = func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "~\test\venv\Lib\site-packages\spotapi\client.py", line 163, in part_hash self.get_sha256_hash() File "~\test\venv\Lib\site-packages\spotapi\types\annotations.py", line 47, in wrapper result: R = func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "~\test\venv\Lib\site-packages\spotapi\client.py", line 186, in get_sha256_hash self.client_version = resp.response.split('clientVersion:"')[1].split(',')[0] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^ IndexError: list index out of range ``` Minimal code to reproduce the error: ``` from spotapi import PublicPlaylist playlist_info = PublicPlaylist("6zCID88oNjNv9zx6puDHKj").get_playlist_info(limit=5000) ``` You need to be on the last version of Spotapi, which is #44 but it haven't been pushed to Pypi.
kerem closed this issue 2026-02-27 19:06:31 +03:00
Author
Owner

@girwin1 commented on GitHub (Sep 8, 2025):

I don't have solution but coming up against the same issue. For a start, i think clientVersion has been changed to spotify-app-version which is why that section is failing. But once this is resolved the client is still failing to get the sha256 hash, and i dont know why this is

<!-- gh-comment-id:3268368799 --> @girwin1 commented on GitHub (Sep 8, 2025): I don't have solution but coming up against the same issue. For a start, i think clientVersion has been changed to spotify-app-version which is why that section is failing. But once this is resolved the client is still failing to get the sha256 hash, and i dont know why this is
Author
Owner

@Aran404 commented on GitHub (Sep 9, 2025):

This should resolve all issues, works on my end now. Fixed a bunch of things and made it a bit more dynamic, let me know!

<!-- gh-comment-id:3272046303 --> @Aran404 commented on GitHub (Sep 9, 2025): This should resolve all issues, works on my end now. Fixed a bunch of things and made it a bit more dynamic, let me know!
Author
Owner

@Aran404 commented on GitHub (Sep 9, 2025):

Also pushed everything to PyPi.

<!-- gh-comment-id:3272048224 --> @Aran404 commented on GitHub (Sep 9, 2025): Also pushed everything to PyPi.
Author
Owner

@Leogendra commented on GitHub (Sep 10, 2025):

Nice work, thanks!

<!-- gh-comment-id:3275698487 --> @Leogendra commented on GitHub (Sep 10, 2025): Nice work, thanks!
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SpotAPI#30
No description provided.