[GH-ISSUE #50] Error when executing get_playlist_infos(): BaseClientError: Could not get general hashes #32

Closed
opened 2026-02-27 19:06:32 +03:00 by kerem · 1 comment
Owner

Originally created by @Leogendra on GitHub (Oct 16, 2025).
Original GitHub issue: https://github.com/Aran404/SpotAPI/issues/50

After changing the secret url in #49, we're still unable to get playlist infos (and other methods I guess).

Minimal code to reproduce the error:

from spotapi import PublicPlaylist

playlist = PublicPlaylist("6zCID88oNjNv9zx6puDHKj")
results = playlist.get_playlist_info()

Full error:

Traceback (most recent call last):
  File "/home/test/test.py", line 42, in <module>
    results = playlist.get_playlist_info()
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/test/venv/lib64/python3.12/site-packages/spotapi/types/annotations.py", line 47, in wrapper
    result: R = func(*args, **kwargs)
                ^^^^^^^^^^^^^^^^^^^^^
  File "/home/test/venv/lib64/python3.12/site-packages/spotapi/playlist.py", line 72, in get_playlist_info
    "sha256Hash": self.base.part_hash("fetchPlaylist"),
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/test/venv/lib64/python3.12/site-packages/spotapi/types/annotations.py", line 47, in wrapper
    result: R = func(*args, **kwargs)
                ^^^^^^^^^^^^^^^^^^^^^
  File "/home/test/venv/lib64/python3.12/site-packages/spotapi/client.py", line 214, in part_hash
    self.get_sha256_hash()
  File "/home/test/venv/lib64/python3.12/site-packages/spotapi/types/annotations.py", line 47, in wrapper
    result: R = func(*args, **kwargs)
                ^^^^^^^^^^^^^^^^^^^^^
  File "/home/test/venv/lib64/python3.12/site-packages/spotapi/client.py", line 248, in get_sha256_hash
    raise BaseClientError(
spotapi.exceptions.errors.BaseClientError: Could not get general hashes

By catching the exception, I get the following output:

Detail: Status Code: 400, Response: {
    "totpVerExpired": "error",
    "totpValidUntil": "2025-10-16T09:00:00.000Z",
    "error": {
        "code": 400,
        "message": "Unauthorized request",
        "extra": {
            "_notes": "Usage of this endpoint is not permitted under the Spotify Developer Terms and Developer Policy, and applicable law"
        },
        "trace": "..."
    }
}
Originally created by @Leogendra on GitHub (Oct 16, 2025). Original GitHub issue: https://github.com/Aran404/SpotAPI/issues/50 After changing the secret url in #49, we're still unable to get playlist infos (and other methods I guess). Minimal code to reproduce the error: ``` from spotapi import PublicPlaylist playlist = PublicPlaylist("6zCID88oNjNv9zx6puDHKj") results = playlist.get_playlist_info() ``` Full error: ``` Traceback (most recent call last): File "/home/test/test.py", line 42, in <module> results = playlist.get_playlist_info() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/test/venv/lib64/python3.12/site-packages/spotapi/types/annotations.py", line 47, in wrapper result: R = func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/home/test/venv/lib64/python3.12/site-packages/spotapi/playlist.py", line 72, in get_playlist_info "sha256Hash": self.base.part_hash("fetchPlaylist"), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/test/venv/lib64/python3.12/site-packages/spotapi/types/annotations.py", line 47, in wrapper result: R = func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/home/test/venv/lib64/python3.12/site-packages/spotapi/client.py", line 214, in part_hash self.get_sha256_hash() File "/home/test/venv/lib64/python3.12/site-packages/spotapi/types/annotations.py", line 47, in wrapper result: R = func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/home/test/venv/lib64/python3.12/site-packages/spotapi/client.py", line 248, in get_sha256_hash raise BaseClientError( spotapi.exceptions.errors.BaseClientError: Could not get general hashes ``` By catching the exception, I get the following output: ``` Detail: Status Code: 400, Response: { "totpVerExpired": "error", "totpValidUntil": "2025-10-16T09:00:00.000Z", "error": { "code": 400, "message": "Unauthorized request", "extra": { "_notes": "Usage of this endpoint is not permitted under the Spotify Developer Terms and Developer Policy, and applicable law" }, "trace": "..." } } ```
kerem closed this issue 2026-02-27 19:06:32 +03:00
Author
Owner

@Aran404 commented on GitHub (Oct 20, 2025):

Ill take a look after mid terms

<!-- gh-comment-id:3423640227 --> @Aran404 commented on GitHub (Oct 20, 2025): Ill take a look after mid terms
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#32
No description provided.