[GH-ISSUE #170] 403 Forbidden #153

Open
opened 2026-02-27 04:57:50 +03:00 by kerem · 0 comments
Owner

Originally created by @xoniq on GitHub (Feb 16, 2026).
Original GitHub issue: https://github.com/Googolplexed0/zotify/issues/170

I'm not sure if this is a bug or another issue so I used the blank issue. I've tried all branches of this repo, I have added a 'app' in the Spotify API, and I do have Spotify Premium.

With switching every branch I deleted the config and credentials files to make sure it's clean all the time, and when logging in with Zotify I authenticated my 'app' in Spotify so that works and the callback URL too.

Now when I try to fetch a single song, I get this in the terminal:

zotify "<url_to_spotify_track>" --client-id <client_id>
                                                                                                                                                                                                                                                                                                                           
	[∙●∙] Logging in...                                                                                                                                                                                                                                                                                                	[∙●∙] Fetching bulk track information...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
###   WARNING:  API ERROR (TRY 0) - RETRYING   ###                                                                                                                                                                                                                                                                         
###   403:  Forbidden   ###                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                           
	[∙∙●] Fetching bulk track information...                                                                                                                                                                                                                                                                                  
###   WARNING:  API ERROR (TRY 1) - RETRYING   ###                                                                                                                                                                                                                                                                         
###   403:  Forbidden   ###                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                           
	[∙∙∙] Fetching bulk track information...                                                                                                                                                                                                                                                                                  
###   API_ERROR:  RETRY LIMIT EXCEDED   ###                                                                                                                                                                                                                                                                                
###   RESPONSE TEXT: {"error": {"status": 403, "message": "Forbidden" } }   ###                                                                                                                                                                                                                                            
###   URL: https://api.spotify.com/v1/tracks?market=from_token&ids=<spotify_track_id>   ###                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                                                           
	[∙●∙] Fetching bulk track information...                                                                                                                                                                                                                                                                                  


Traceback (most recent call last):
  File "/Users/<user>/.local/bin/zotify", line 6, in <module>
    sys.exit(main())
             ~~~~^^
  File "/Users/<user>/.local/pipx/venvs/zotify/lib/python3.14/site-packages/zotify/__main__.py", line 143, in main
    client(args, modes)
    ~~~~~~^^^^^^^^^^^^^
  File "/Users/<user>/.local/pipx/venvs/zotify/lib/python3.14/site-packages/zotify/app.py", line 186, in client
    perform_query(args)
    ~~~~~~~~~~~~~^^^^^^
  File "/Users/<user>/.local/pipx/venvs/zotify/lib/python3.14/site-packages/zotify/app.py", line 178, in perform_query
    raise e
  File "/Users/<user>/.local/pipx/venvs/zotify/lib/python3.14/site-packages/zotify/app.py", line 149, in perform_query
    Query(Zotify.DATETIME_LAUNCH).request(urls).execute()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/Users/<user>/.local/pipx/venvs/zotify/lib/python3.14/site-packages/zotify/api.py", line 1508, in execute
    self.parse_query_metadata(self.fetch_query_metadata())
                              ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/Users/<user>/.local/pipx/venvs/zotify/lib/python3.14/site-packages/zotify/api.py", line 1335, in fetch_query_metadata
    item_resps_by_type.append(self.fetch_uris_metadata(uris, cont_type))
                              ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/Users/<user>/.local/pipx/venvs/zotify/lib/python3.14/site-packages/zotify/api.py", line 1330, in fetch_uris_metadata
    return Zotify.invoke_url_bulk(url, ids, cont_type.lowers, ITEM_FETCH[cont_type])
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/<user>/.local/pipx/venvs/zotify/lib/python3.14/site-packages/zotify/config.py", line 887, in invoke_url_bulk
    items.extend(resp[stripper]) # stripper must be present, handled by the caller
                 ~~~~^^^^^^^^^^
KeyError: 'tracks'

Having Spotify Premium, using a custom app, having tried all branches, now I don't know how to proceed.

Originally created by @xoniq on GitHub (Feb 16, 2026). Original GitHub issue: https://github.com/Googolplexed0/zotify/issues/170 I'm not sure if this is a bug or another issue so I used the blank issue. I've tried all branches of this repo, I have added a 'app' in the Spotify API, and I do have Spotify Premium. With switching every branch I deleted the config and credentials files to make sure it's clean all the time, and when logging in with Zotify I authenticated my 'app' in Spotify so that works and the callback URL too. Now when I try to fetch a single song, I get this in the terminal: ``` zotify "<url_to_spotify_track>" --client-id <client_id> [∙●∙] Logging in... [∙●∙] Fetching bulk track information... ### WARNING: API ERROR (TRY 0) - RETRYING ### ### 403: Forbidden ### [∙∙●] Fetching bulk track information... ### WARNING: API ERROR (TRY 1) - RETRYING ### ### 403: Forbidden ### [∙∙∙] Fetching bulk track information... ### API_ERROR: RETRY LIMIT EXCEDED ### ### RESPONSE TEXT: {"error": {"status": 403, "message": "Forbidden" } } ### ### URL: https://api.spotify.com/v1/tracks?market=from_token&ids=<spotify_track_id> ### [∙●∙] Fetching bulk track information... Traceback (most recent call last): File "/Users/<user>/.local/bin/zotify", line 6, in <module> sys.exit(main()) ~~~~^^ File "/Users/<user>/.local/pipx/venvs/zotify/lib/python3.14/site-packages/zotify/__main__.py", line 143, in main client(args, modes) ~~~~~~^^^^^^^^^^^^^ File "/Users/<user>/.local/pipx/venvs/zotify/lib/python3.14/site-packages/zotify/app.py", line 186, in client perform_query(args) ~~~~~~~~~~~~~^^^^^^ File "/Users/<user>/.local/pipx/venvs/zotify/lib/python3.14/site-packages/zotify/app.py", line 178, in perform_query raise e File "/Users/<user>/.local/pipx/venvs/zotify/lib/python3.14/site-packages/zotify/app.py", line 149, in perform_query Query(Zotify.DATETIME_LAUNCH).request(urls).execute() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^ File "/Users/<user>/.local/pipx/venvs/zotify/lib/python3.14/site-packages/zotify/api.py", line 1508, in execute self.parse_query_metadata(self.fetch_query_metadata()) ~~~~~~~~~~~~~~~~~~~~~~~~~^^ File "/Users/<user>/.local/pipx/venvs/zotify/lib/python3.14/site-packages/zotify/api.py", line 1335, in fetch_query_metadata item_resps_by_type.append(self.fetch_uris_metadata(uris, cont_type)) ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^ File "/Users/<user>/.local/pipx/venvs/zotify/lib/python3.14/site-packages/zotify/api.py", line 1330, in fetch_uris_metadata return Zotify.invoke_url_bulk(url, ids, cont_type.lowers, ITEM_FETCH[cont_type]) ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/<user>/.local/pipx/venvs/zotify/lib/python3.14/site-packages/zotify/config.py", line 887, in invoke_url_bulk items.extend(resp[stripper]) # stripper must be present, handled by the caller ~~~~^^^^^^^^^^ KeyError: 'tracks' ``` Having Spotify Premium, using a custom app, having tried all branches, now I don't know how to proceed.
Sign in to join this conversation.
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/zotify#153
No description provided.