[GH-ISSUE #48] [Bug Report] Token Auth MercuryException 403 #41

Closed
opened 2026-02-27 04:57:14 +03:00 by kerem · 32 comments
Owner

Originally created by @terrastrial on GitHub (Aug 12, 2025).
Original GitHub issue: https://github.com/Googolplexed0/zotify/issues/48

Bug Description
Inability to get past "logging in" stage to select downloadable songs. Entering zotify -s will allow for a search to be entered but when entered the same error is output. Was mass downloading from a playlist when I returned to find it timed out (I did not copy that code unfortunately), ctrl+c, and the next time i tried the same zotify -p that I had been using it gave the error, also restarted the terminal.

Bug Triggering Command
zotify -p

Error Traceback / Logs

   ###   config_DEBUG.json saved to /home/terra/.config/zotify   ###            
                                                                                
	[∙∙∙] Logging in...                                                            
Traceback (most recent call last):
  File "/home/terra/.local/bin/zotify", line 7, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/terra/.local/share/pipx/venvs/zotify/lib/python3.12/site-packages/zotify/__main__.py", line 119, in main
    args.func(args)
  File "/home/terra/.local/share/pipx/venvs/zotify/lib/python3.12/site-packages/zotify/app.py", line 257, in client
    download_from_user_playlist()
  File "/home/terra/.local/share/pipx/venvs/zotify/lib/python3.12/site-packages/zotify/playlist.py", line 110, in download_from_user_playlist
    users_playlists = Zotify.invoke_url_nextable(USER_PLAYLISTS_URL, ITEMS)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terra/.local/share/pipx/venvs/zotify/lib/python3.12/site-packages/zotify/config.py", line 669, in invoke_url_nextable
    resp = cls.invoke_url_with_params(url, limit=limit, offset=offset)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terra/.local/share/pipx/venvs/zotify/lib/python3.12/site-packages/zotify/config.py", line 664, in invoke_url_with_params
    _, responsejson = cls.invoke_url(url, params)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terra/.local/share/pipx/venvs/zotify/lib/python3.12/site-packages/zotify/config.py", line 627, in invoke_url
    headers = cls.get_auth_header()
              ^^^^^^^^^^^^^^^^^^^^^
  File "/home/terra/.local/share/pipx/venvs/zotify/lib/python3.12/site-packages/zotify/config.py", line 618, in get_auth_header
    'Authorization': f'Bearer {cls.__get_auth_token()}',
                               ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terra/.local/share/pipx/venvs/zotify/lib/python3.12/site-packages/zotify/config.py", line 611, in __get_auth_token
    return cls.SESSION.tokens().get_token(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terra/.local/share/pipx/venvs/zotify/lib/python3.12/site-packages/zotify/__init__.py", line 213, in get_token
    return super().get_token(*scopes)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terra/.local/share/pipx/venvs/zotify/lib/python3.12/site-packages/librespot/core.py", line 2301, in get_token
    response = self._session.mercury().send_sync_json(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terra/.local/share/pipx/venvs/zotify/lib/python3.12/site-packages/librespot/mercury.py", line 186, in send_sync_json
    raise MercuryClient.MercuryException(response)
librespot.mercury.MercuryClient.MercuryException: status: 403

Config File
{ "DEBUG": "True", "ROOT_PATH": "~/Music/Zotify Music", "SAVE_CREDENTIALS": "True", "CREDENTIALS_LOCATION": "", "OUTPUT": "", "OUTPUT_PLAYLIST": "{playlist}/{artist}_{song_name}", "OUTPUT_PLAYLIST_EXT": "{playlist}/{playlist_num}_{artist}_{song_name}", "OUTPUT_LIKED_SONGS": "Liked Songs/{artist}_{song_name}", "OUTPUT_SINGLE": "{artist}/{album}/{artist}_{song_name}", "OUTPUT_ALBUM": "{artist}/{album}/{album_num}_{artist}_{song_name}", "ROOT_PODCAST_PATH": "~/Music/Zotify Podcasts", "SPLIT_ALBUM_DISCS": "False", "MAX_FILENAME_LENGTH": "0", "BULK_WAIT_TIME": "2", "DOWNLOAD_REAL_TIME": "True", "TEMP_DOWNLOAD_DIR": "", "DOWNLOAD_PARENT_ALBUM": "False", "NO_COMPILATION_ALBUMS": "False", "REGEX_ENABLED": "False", "REGEX_TRACK_SKIP": "", "REGEX_EPISODE_SKIP": "", "REGEX_ALBUM_SKIP": "", "DOWNLOAD_FORMAT": "mp3", "DOWNLOAD_QUALITY": "auto", "TRANSCODE_BITRATE": "auto", "SONG_ARCHIVE_LOCATION": "", "DISABLE_SONG_ARCHIVE": "False", "DISABLE_DIRECTORY_ARCHIVES": "False", "SKIP_EXISTING": "True", "SKIP_PREVIOUSLY_DOWNLOADED": "False", "EXPORT_M3U8": "False", "M3U8_LOCATION": "", "M3U8_REL_PATHS": "True", "LIKED_SONGS_ARCHIVE_M3U8": "True", "DOWNLOAD_LYRICS": "True", "LYRICS_LOCATION": "", "ALWAYS_CHECK_LYRICS": "False", "LYRICS_MD_HEADER": "False", "LANGUAGE": "en", "STRICT_LIBRARY_VERIFY": "True", "MD_DISC_TRACK_TOTALS": "True", "MD_SAVE_GENRES": "True", "MD_ALLGENRES": "False", "MD_GENREDELIMITER": ", ", "MD_ARTISTDELIMITER": ", ", "MD_SAVE_LYRICS": "True", "ALBUM_ART_JPG_FILE": "False", "RETRY_ATTEMPTS": "1", "CHUNK_SIZE": "20000", "OAUTH_ADDRESS": "0.0.0.0", "REDIRECT_ADDRESS": "127.0.0.1", "PRINT_SPLASH": "False", "PRINT_PROGRESS_INFO": "True", "PRINT_SKIPS": "True", "PRINT_DOWNLOADS": "True", "PRINT_DOWNLOAD_PROGRESS": "True", "PRINT_URL_PROGRESS": "True", "PRINT_ALBUM_PROGRESS": "True", "PRINT_ARTIST_PROGRESS": "True", "PRINT_PLAYLIST_PROGRESS": "True", "PRINT_WARNINGS": "True", "PRINT_ERRORS": "True", "PRINT_API_ERRORS": "True", "FFMPEG_LOG_LEVEL": "error" }

Zotify Version
Zotify v0.9.13

Additional Context
System:
Kernel: 6.8.0-71-generic arch: x86_64 bits: 64 compiler: gcc v: 13.3.0 clocksource: tsc
Desktop: Cinnamon v: 6.4.8 tk: GTK v: 3.24.41 wm: Muffin v: 6.4.1 vt: 7 dm: LightDM v: 1.30.0
Distro: Linux Mint 22.1 Xia base: Ubuntu 24.04 noble

Also I don´t know what "linted with pylint before pushing" means, sorry if I missed something

Originally created by @terrastrial on GitHub (Aug 12, 2025). Original GitHub issue: https://github.com/Googolplexed0/zotify/issues/48 **Bug Description** Inability to get past "logging in" stage to select downloadable songs. Entering zotify -s will allow for a search to be entered but when entered the same error is output. Was mass downloading from a playlist when I returned to find it timed out (I did not copy that code unfortunately), ctrl+c, and the next time i tried the same zotify -p that I had been using it gave the error, also restarted the terminal. **Bug Triggering Command** `zotify -p` **Error Traceback / Logs** ``` ### config_DEBUG.json saved to /home/terra/.config/zotify ### [∙∙∙] Logging in... Traceback (most recent call last): File "/home/terra/.local/bin/zotify", line 7, in <module> sys.exit(main()) ^^^^^^ File "/home/terra/.local/share/pipx/venvs/zotify/lib/python3.12/site-packages/zotify/__main__.py", line 119, in main args.func(args) File "/home/terra/.local/share/pipx/venvs/zotify/lib/python3.12/site-packages/zotify/app.py", line 257, in client download_from_user_playlist() File "/home/terra/.local/share/pipx/venvs/zotify/lib/python3.12/site-packages/zotify/playlist.py", line 110, in download_from_user_playlist users_playlists = Zotify.invoke_url_nextable(USER_PLAYLISTS_URL, ITEMS) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terra/.local/share/pipx/venvs/zotify/lib/python3.12/site-packages/zotify/config.py", line 669, in invoke_url_nextable resp = cls.invoke_url_with_params(url, limit=limit, offset=offset) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terra/.local/share/pipx/venvs/zotify/lib/python3.12/site-packages/zotify/config.py", line 664, in invoke_url_with_params _, responsejson = cls.invoke_url(url, params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terra/.local/share/pipx/venvs/zotify/lib/python3.12/site-packages/zotify/config.py", line 627, in invoke_url headers = cls.get_auth_header() ^^^^^^^^^^^^^^^^^^^^^ File "/home/terra/.local/share/pipx/venvs/zotify/lib/python3.12/site-packages/zotify/config.py", line 618, in get_auth_header 'Authorization': f'Bearer {cls.__get_auth_token()}', ^^^^^^^^^^^^^^^^^^^^^^ File "/home/terra/.local/share/pipx/venvs/zotify/lib/python3.12/site-packages/zotify/config.py", line 611, in __get_auth_token return cls.SESSION.tokens().get_token( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terra/.local/share/pipx/venvs/zotify/lib/python3.12/site-packages/zotify/__init__.py", line 213, in get_token return super().get_token(*scopes) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terra/.local/share/pipx/venvs/zotify/lib/python3.12/site-packages/librespot/core.py", line 2301, in get_token response = self._session.mercury().send_sync_json( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terra/.local/share/pipx/venvs/zotify/lib/python3.12/site-packages/librespot/mercury.py", line 186, in send_sync_json raise MercuryClient.MercuryException(response) librespot.mercury.MercuryClient.MercuryException: status: 403 ``` **Config File** `{ "DEBUG": "True", "ROOT_PATH": "~/Music/Zotify Music", "SAVE_CREDENTIALS": "True", "CREDENTIALS_LOCATION": "", "OUTPUT": "", "OUTPUT_PLAYLIST": "{playlist}/{artist}_{song_name}", "OUTPUT_PLAYLIST_EXT": "{playlist}/{playlist_num}_{artist}_{song_name}", "OUTPUT_LIKED_SONGS": "Liked Songs/{artist}_{song_name}", "OUTPUT_SINGLE": "{artist}/{album}/{artist}_{song_name}", "OUTPUT_ALBUM": "{artist}/{album}/{album_num}_{artist}_{song_name}", "ROOT_PODCAST_PATH": "~/Music/Zotify Podcasts", "SPLIT_ALBUM_DISCS": "False", "MAX_FILENAME_LENGTH": "0", "BULK_WAIT_TIME": "2", "DOWNLOAD_REAL_TIME": "True", "TEMP_DOWNLOAD_DIR": "", "DOWNLOAD_PARENT_ALBUM": "False", "NO_COMPILATION_ALBUMS": "False", "REGEX_ENABLED": "False", "REGEX_TRACK_SKIP": "", "REGEX_EPISODE_SKIP": "", "REGEX_ALBUM_SKIP": "", "DOWNLOAD_FORMAT": "mp3", "DOWNLOAD_QUALITY": "auto", "TRANSCODE_BITRATE": "auto", "SONG_ARCHIVE_LOCATION": "", "DISABLE_SONG_ARCHIVE": "False", "DISABLE_DIRECTORY_ARCHIVES": "False", "SKIP_EXISTING": "True", "SKIP_PREVIOUSLY_DOWNLOADED": "False", "EXPORT_M3U8": "False", "M3U8_LOCATION": "", "M3U8_REL_PATHS": "True", "LIKED_SONGS_ARCHIVE_M3U8": "True", "DOWNLOAD_LYRICS": "True", "LYRICS_LOCATION": "", "ALWAYS_CHECK_LYRICS": "False", "LYRICS_MD_HEADER": "False", "LANGUAGE": "en", "STRICT_LIBRARY_VERIFY": "True", "MD_DISC_TRACK_TOTALS": "True", "MD_SAVE_GENRES": "True", "MD_ALLGENRES": "False", "MD_GENREDELIMITER": ", ", "MD_ARTISTDELIMITER": ", ", "MD_SAVE_LYRICS": "True", "ALBUM_ART_JPG_FILE": "False", "RETRY_ATTEMPTS": "1", "CHUNK_SIZE": "20000", "OAUTH_ADDRESS": "0.0.0.0", "REDIRECT_ADDRESS": "127.0.0.1", "PRINT_SPLASH": "False", "PRINT_PROGRESS_INFO": "True", "PRINT_SKIPS": "True", "PRINT_DOWNLOADS": "True", "PRINT_DOWNLOAD_PROGRESS": "True", "PRINT_URL_PROGRESS": "True", "PRINT_ALBUM_PROGRESS": "True", "PRINT_ARTIST_PROGRESS": "True", "PRINT_PLAYLIST_PROGRESS": "True", "PRINT_WARNINGS": "True", "PRINT_ERRORS": "True", "PRINT_API_ERRORS": "True", "FFMPEG_LOG_LEVEL": "error" } ` **Zotify Version** Zotify v0.9.13 **Additional Context** System: Kernel: 6.8.0-71-generic arch: x86_64 bits: 64 compiler: gcc v: 13.3.0 clocksource: tsc Desktop: Cinnamon v: 6.4.8 tk: GTK v: 3.24.41 wm: Muffin v: 6.4.1 vt: 7 dm: LightDM v: 1.30.0 Distro: Linux Mint 22.1 Xia base: Ubuntu 24.04 noble Also I don´t know what "linted with pylint before pushing" means, sorry if I missed something
kerem 2026-02-27 04:57:14 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@terrastrial commented on GitHub (Aug 12, 2025):

I also tried restarting the terminal*

<!-- gh-comment-id:3180305617 --> @terrastrial commented on GitHub (Aug 12, 2025): I also tried restarting the terminal*
Author
Owner

@trustosas commented on GitHub (Aug 12, 2025):

It affects the original main branch (the one I use), as well as other forks of Zotify (https://github.com/DraftKinner/zotify/issues/80)

<!-- gh-comment-id:3180352775 --> @trustosas commented on GitHub (Aug 12, 2025): It affects the original main branch (the one I use), as well as other forks of Zotify (https://github.com/DraftKinner/zotify/issues/80)
Author
Owner

@Googolplexed0 commented on GitHub (Aug 12, 2025):

Config File
{ "DEBUG": "True"

Can you attach the debug .log file as well?

librespot.mercury.MercuryClient.MercuryException: status: 403

It affects the original main branch (the one I use), as well as other forks of Zotify (DraftKinner#80)

This is an issue with librespot-python, which the original repo and all forks rely on. The API has been undergoing changes this month, so this is not unexpected. I would suggest you create an issue there. I will do some investigation to see if I can find a fix in the meantime.

<!-- gh-comment-id:3180439629 --> @Googolplexed0 commented on GitHub (Aug 12, 2025): > Config File > { "DEBUG": "True" Can you attach the debug `.log` file as well? > librespot.mercury.MercuryClient.MercuryException: status: 403 > It affects the original main branch (the one I use), as well as other forks of Zotify (DraftKinner#80) This is an issue with [librespot-python](https://github.com/kokarare1212/librespot-python), which the original repo and all forks rely on. The API has been undergoing changes this month, so this is not unexpected. I would suggest you create an issue there. I will do some investigation to see if I can find a fix in the meantime.
Author
Owner

@terrastrial commented on GitHub (Aug 12, 2025):

Can you attach the debug .log file as well?

I'm looking for it for ya. I only installed linux for the first time this week and I am not a software person so it might take me a minute lol.

If you have any suggestions for where I can find the .log file I would appreciate it.

<!-- gh-comment-id:3180639309 --> @terrastrial commented on GitHub (Aug 12, 2025): > Can you attach the debug `.log` file as well? I'm looking for it for ya. I only installed linux for the first time this week and I am not a software person so it might take me a minute lol. If you have any suggestions for where I can find the .log file I would appreciate it.
Author
Owner

@mchlschlz commented on GitHub (Aug 12, 2025):

It seems to be that a credentials.json is created in ~/.local/share/zotify/

Removing it allows you to redo the auth process and it works for that session at least. Delete the credentials again to repeat. I can't seem to re-use authorization credentials.

<!-- gh-comment-id:3181142306 --> @mchlschlz commented on GitHub (Aug 12, 2025): It seems to be that a credentials.json is created in ~/.local/share/zotify/ Removing it allows you to redo the auth process and it works for that session at least. Delete the credentials again to repeat. I can't seem to re-use authorization credentials.
Author
Owner

@Googolplexed0 commented on GitHub (Aug 12, 2025):

If you have any suggestions for where I can find the .log file I would appreciate it.

Should be in your ROOT_PATH. Added a debug print with 21504fd72d (v0.9.14) to show this on running.

<!-- gh-comment-id:3181239011 --> @Googolplexed0 commented on GitHub (Aug 12, 2025): > If you have any suggestions for where I can find the .log file I would appreciate it. Should be in your `ROOT_PATH`. Added a debug print with 21504fd72d3e588626ea7339d0a42398b412fa3e (v0.9.14) to show this on running.
Author
Owner

@terrastrial commented on GitHub (Aug 13, 2025):

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): apresolve.spotify.com:443
DEBUG:urllib3.connectionpool:https://apresolve.spotify.com:443 "GET /?type=accesspoint HTTP/1.1" 200 None
INFO:Librespot:Session:Created new session! device_id: e8a0ff6f13b1b491fefcea18c889429d2e11efb8, ap: ap-guc3.spotify.com:4070
INFO:Librespot:Session:Connection successfully!
INFO:Librespot:Session:Session.Receiver started
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): apresolve.spotify.com:443
DEBUG:urllib3.connectionpool:https://apresolve.spotify.com:443 "GET /?type=spclient HTTP/1.1" 200 None
INFO:Librespot:Session:Skipping 02
INFO:Librespot:Session:Received license_version: 0
INFO:Librespot:Session:Received country_code: CA
DEBUG:Librespot:Session:Parsed product info: {'type': 'premium', 'ab-ad-player-targeting': '1', 'ab-watch-now': '0', 'ab_recently_played_feature_time_filter_threshold': 'com.spotify.gaia=30,driving-mode=120,spotify%3Ainternal%3Astartpage=30', 'active-session-days': '1', 'ad-formats-preroll-video': '0', 'ad-session-persistence': '1', 'ads': '0', 'app-developer': '0', 'arsenal_country': '1', 'audio-preview-url-template': 'https://p.scdn.co/mp3-preview/{id}', 'audio-quality': '1', 'audiobook-onboarding-completed': '0', 'autoplay': '1', 'browse-overview-enabled': '1', 'capper-profile': None, 'capping-bar-threshold': '3601', 'catalogue': 'premium', 'collection': '1', 'created_by_partner': 'samsung-mobile-preload', 'employee-free-opt-in': '0', 'enable-annotations': '2', 'enable-annotations-read': '0', 'enable-crossfade': '1', 'explicit-content': '1', 'fb-grant-permission-local-render': '0', 'fb-info-confirmation': 'control', 'financial-product': 'pr:premium,tc:0,rt:v2_CA_default_intro-1m_0_CAD_default', 'head-file-caching': '1', 'head-files': '1', 'head-files-url': 'https://heads-fa-tls13.spotifycdn.com/head/{file_id}', 'high-bitrate': '1', 'image-url': 'https://i.scdn.co/image/{file_id}', 'incognito_mode_timeout': '21600', 'is_email_verified': '0', 'key-caching-auto-offline': '0', 'key-caching-max-count': '10000', 'key-caching-max-offline-seconds': '1800', 'key-memory-cache-mode': '1:15,300', 'libspotify': '1', 'license-acceptance-grace-days': '30', 'license-agreements': None, 'loudness-levels': '1:-5.0,0.0,3.0:-2.0', 'metadata-link-lookup-modes': '0', 'mobile': '1', 'mobile-payment': '0', 'mobile-product-test': 'samsung-mobile-preload', 'name': 'Spotify Premium', 'network-operator-premium-activation': '1', 'nft-disabled': '1', 'offline': '1', 'on-demand': '1', 'on-demand-trial': 'trial_with_offline_active', 'on-demand-trial-in-progress': '1', 'payments-initial-campaign': 'default', 'payments-locked-state': '0', 'player-license': 'premium', 'player-license-v2': 'premium', 'playlist-annotations-markup': '0', 'preferred-locale': 'en', 'prefetch-keys': '1', 'prefetch-strategy': '18', 'prefetch-window-max': '2', 'product-expiry': None, 'publish-activity': '0', 'publish-playlist': '1', 'radio': '1', 'rating-access': '1', 'remote-control': '6', 'restrict-playlist-collaboration': '0', 'send-email': '1', 'shows-collection': '1', 'shows-collection-jam': '0', 'shuffle': '0', 'shuffle-algorithm': 'FRESH', 'sidebar-navigation-enabled': '0', 'storage-size-config': '10240,90,500,3', 'streaming': '1', 'streaming-rules': None, 'track-cap': '0', 'ugc-abuse-report': '1', 'ugc-abuse-report-url': 'https://support.spotify.com/abuse/?uri={uri}', 'unrestricted': '1', 'use-fb-publish-backend': '2', 'user-profile-show-invitation-codes': '0', 'video-cdn-sampling': '100', 'video-device-blacklisted': '0', 'video-initial-bitrate': '200000', 'video-keyframe-url': 'http://keyframes-fa.cdn.spotify.com/keyframes/v1/sources/{source_id}/keyframe/heights/{height}/timestamps/{timestamp_ms}.jpg', 'video-manifest-url': 'https://spclient.wg.spotify.com/manifests/v6/{type}/sources/{source_id}/options/supports_drm', 'video-wifi-initial-bitrate': '800000', 'widevine-license-url': 'https://spclient.wg.spotify.com/widevine-license/v1/video/license'}
INFO:Librespot:Session:Skipping 1f
INFO:Librespot:Session:Skipping 69
DEBUG:Librespot:MercuryClient:Handling packet, cmd: 0xb5, seq: 376912586001612800, flags: b'\x01', parts: 1
DEBUG:Librespot:MercuryClient:Couldn't dispatch Mercury event seq: 376912586001612800, uri: hm://pusher/v1/connections/ZThhMGZmNmYxM2IxYjQ5MWZlZmNlYTE4Yzg4OTQyOWQyZTExZWZiOCtBUCt0Y3A6Ly8wYWIxNDk2Zi5pcC5ndWMzLnNwb3RpZnkubmV0OjUwMDkrNEY1NzdFOTA4MjQ5QkUwMDQ0N0I2NzJDNkQ4NzlDQTMwRURDQjFCNzA2NzdBMUQzQThFMjY5RTI0QjRBOTIxRA%3D%3D, code: 200, payload: b''
DEBUG:Librespot:Session:Received 0x10: 3a27b2f03d162aa915bb5224665c8bfed37132ba
INFO:Librespot:Session:Skipping unknown command cmd: 0x75, payload: b'\x00\x00\x01'
DEBUG:Librespot:TokenProvider:Token expired or not suitable, requesting again. scopes: ['user-read-email', 'playlist-read-private', 'user-library-read', 'user-follow-read'], old_token: None
DEBUG:Librespot:MercuryClient:Send Mercury request, seq: 0, uri: hm://keymaster/token/authenticated?scope=user-read-email,playlist-read-private,user-library-read,user-follow-read&client_id=65b708073fc0480ea92a077233ca87bd&device_id=e8a0ff6f13b1b491fefcea18c889429d2e11efb8, method: GET
DEBUG:Librespot:MercuryClient:Handling packet, cmd: 0xb2, seq: 0, flags: b'\x01', parts: 2

This is what you're looking for?

<!-- gh-comment-id:3181665451 --> @terrastrial commented on GitHub (Aug 13, 2025): ``` DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): apresolve.spotify.com:443 DEBUG:urllib3.connectionpool:https://apresolve.spotify.com:443 "GET /?type=accesspoint HTTP/1.1" 200 None INFO:Librespot:Session:Created new session! device_id: e8a0ff6f13b1b491fefcea18c889429d2e11efb8, ap: ap-guc3.spotify.com:4070 INFO:Librespot:Session:Connection successfully! INFO:Librespot:Session:Session.Receiver started DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): apresolve.spotify.com:443 DEBUG:urllib3.connectionpool:https://apresolve.spotify.com:443 "GET /?type=spclient HTTP/1.1" 200 None INFO:Librespot:Session:Skipping 02 INFO:Librespot:Session:Received license_version: 0 INFO:Librespot:Session:Received country_code: CA DEBUG:Librespot:Session:Parsed product info: {'type': 'premium', 'ab-ad-player-targeting': '1', 'ab-watch-now': '0', 'ab_recently_played_feature_time_filter_threshold': 'com.spotify.gaia=30,driving-mode=120,spotify%3Ainternal%3Astartpage=30', 'active-session-days': '1', 'ad-formats-preroll-video': '0', 'ad-session-persistence': '1', 'ads': '0', 'app-developer': '0', 'arsenal_country': '1', 'audio-preview-url-template': 'https://p.scdn.co/mp3-preview/{id}', 'audio-quality': '1', 'audiobook-onboarding-completed': '0', 'autoplay': '1', 'browse-overview-enabled': '1', 'capper-profile': None, 'capping-bar-threshold': '3601', 'catalogue': 'premium', 'collection': '1', 'created_by_partner': 'samsung-mobile-preload', 'employee-free-opt-in': '0', 'enable-annotations': '2', 'enable-annotations-read': '0', 'enable-crossfade': '1', 'explicit-content': '1', 'fb-grant-permission-local-render': '0', 'fb-info-confirmation': 'control', 'financial-product': 'pr:premium,tc:0,rt:v2_CA_default_intro-1m_0_CAD_default', 'head-file-caching': '1', 'head-files': '1', 'head-files-url': 'https://heads-fa-tls13.spotifycdn.com/head/{file_id}', 'high-bitrate': '1', 'image-url': 'https://i.scdn.co/image/{file_id}', 'incognito_mode_timeout': '21600', 'is_email_verified': '0', 'key-caching-auto-offline': '0', 'key-caching-max-count': '10000', 'key-caching-max-offline-seconds': '1800', 'key-memory-cache-mode': '1:15,300', 'libspotify': '1', 'license-acceptance-grace-days': '30', 'license-agreements': None, 'loudness-levels': '1:-5.0,0.0,3.0:-2.0', 'metadata-link-lookup-modes': '0', 'mobile': '1', 'mobile-payment': '0', 'mobile-product-test': 'samsung-mobile-preload', 'name': 'Spotify Premium', 'network-operator-premium-activation': '1', 'nft-disabled': '1', 'offline': '1', 'on-demand': '1', 'on-demand-trial': 'trial_with_offline_active', 'on-demand-trial-in-progress': '1', 'payments-initial-campaign': 'default', 'payments-locked-state': '0', 'player-license': 'premium', 'player-license-v2': 'premium', 'playlist-annotations-markup': '0', 'preferred-locale': 'en', 'prefetch-keys': '1', 'prefetch-strategy': '18', 'prefetch-window-max': '2', 'product-expiry': None, 'publish-activity': '0', 'publish-playlist': '1', 'radio': '1', 'rating-access': '1', 'remote-control': '6', 'restrict-playlist-collaboration': '0', 'send-email': '1', 'shows-collection': '1', 'shows-collection-jam': '0', 'shuffle': '0', 'shuffle-algorithm': 'FRESH', 'sidebar-navigation-enabled': '0', 'storage-size-config': '10240,90,500,3', 'streaming': '1', 'streaming-rules': None, 'track-cap': '0', 'ugc-abuse-report': '1', 'ugc-abuse-report-url': 'https://support.spotify.com/abuse/?uri={uri}', 'unrestricted': '1', 'use-fb-publish-backend': '2', 'user-profile-show-invitation-codes': '0', 'video-cdn-sampling': '100', 'video-device-blacklisted': '0', 'video-initial-bitrate': '200000', 'video-keyframe-url': 'http://keyframes-fa.cdn.spotify.com/keyframes/v1/sources/{source_id}/keyframe/heights/{height}/timestamps/{timestamp_ms}.jpg', 'video-manifest-url': 'https://spclient.wg.spotify.com/manifests/v6/{type}/sources/{source_id}/options/supports_drm', 'video-wifi-initial-bitrate': '800000', 'widevine-license-url': 'https://spclient.wg.spotify.com/widevine-license/v1/video/license'} INFO:Librespot:Session:Skipping 1f INFO:Librespot:Session:Skipping 69 DEBUG:Librespot:MercuryClient:Handling packet, cmd: 0xb5, seq: 376912586001612800, flags: b'\x01', parts: 1 DEBUG:Librespot:MercuryClient:Couldn't dispatch Mercury event seq: 376912586001612800, uri: hm://pusher/v1/connections/ZThhMGZmNmYxM2IxYjQ5MWZlZmNlYTE4Yzg4OTQyOWQyZTExZWZiOCtBUCt0Y3A6Ly8wYWIxNDk2Zi5pcC5ndWMzLnNwb3RpZnkubmV0OjUwMDkrNEY1NzdFOTA4MjQ5QkUwMDQ0N0I2NzJDNkQ4NzlDQTMwRURDQjFCNzA2NzdBMUQzQThFMjY5RTI0QjRBOTIxRA%3D%3D, code: 200, payload: b'' DEBUG:Librespot:Session:Received 0x10: 3a27b2f03d162aa915bb5224665c8bfed37132ba INFO:Librespot:Session:Skipping unknown command cmd: 0x75, payload: b'\x00\x00\x01' DEBUG:Librespot:TokenProvider:Token expired or not suitable, requesting again. scopes: ['user-read-email', 'playlist-read-private', 'user-library-read', 'user-follow-read'], old_token: None DEBUG:Librespot:MercuryClient:Send Mercury request, seq: 0, uri: hm://keymaster/token/authenticated?scope=user-read-email,playlist-read-private,user-library-read,user-follow-read&client_id=65b708073fc0480ea92a077233ca87bd&device_id=e8a0ff6f13b1b491fefcea18c889429d2e11efb8, method: GET DEBUG:Librespot:MercuryClient:Handling packet, cmd: 0xb2, seq: 0, flags: b'\x01', parts: 2 ``` This is what you're looking for?
Author
Owner

@Googolplexed0 commented on GitHub (Aug 13, 2025):

This is what you're looking for?

Yes. As I feared, the issue exists with the keymaster, which is above the scope of the librespot-python implementation we use. It seems to be happening across many other projects and is even affecting the original librespot library. This will require a fix from someone with more experience in OAuth and networking. Give some attention the the librespot issue to encourage a more serious investigation.

<!-- gh-comment-id:3182074973 --> @Googolplexed0 commented on GitHub (Aug 13, 2025): > This is what you're looking for? Yes. As I feared, the issue exists with the keymaster, which is above the scope of the [librespot-python](https://github.com/kokarare1212/librespot-python) implementation we use. It seems to be happening across many other projects and is even affecting the [original librespot library](https://github.com/librespot-org/librespot/issues/1532). This will require a fix from someone with more experience in OAuth and networking. Give some attention the the librespot issue to encourage a more serious investigation.
Author
Owner

@IsaacAgulhas commented on GitHub (Aug 13, 2025):

Hi guys been swimming around the various repos that use/implement librespot (which includes this repo, the original zotify repo and all forks of zotify) as well as the various implementations/versions of librespot (java and python respectively)
The issue is with the mercury token generation and authorization, the solution is to change to login5 token authentication, however this is done in librespot itself and not in zotify, however zotify is the one that is choosing to use mercury auth process, and the login5 setup already exists in librespot so it can be implemented, here is a link to a contributor in the librespot java library that produced a patch for using login5 https://github.com/librespot-org/librespot-java/issues/1099 and that has resolved the issue

@Googolplexed0 since the main zotify repo does not look to be maintained and since your fork is very far ahead of dev (170 commits) it appears you or a contributor will need to implement a similar patch to use login5 token auth
I have a build of the main zotify running on my ubuntu server that I will be looking to implement the above mentioned patch and if I do so successfully I will openly share it here so you can do the same for yours and produce an official release

<!-- gh-comment-id:3184511715 --> @IsaacAgulhas commented on GitHub (Aug 13, 2025): Hi guys been swimming around the various repos that use/implement librespot (which includes this repo, the original zotify repo and all forks of zotify) as well as the various implementations/versions of librespot (java and python respectively) The issue is with the mercury token generation and authorization, the solution is to change to login5 token authentication, however this is done in librespot itself and not in zotify, however zotify is the one that is choosing to use mercury auth process, and the login5 setup already exists in librespot so it can be implemented, here is a link to a contributor in the librespot java library that produced a patch for using login5 [https://github.com/librespot-org/librespot-java/issues/1099](url) and that has resolved the issue @Googolplexed0 since the main zotify repo does not look to be maintained and since your fork is very far ahead of dev (170 commits) it appears you or a contributor will need to implement a similar patch to use login5 token auth I have a build of the main zotify running on my ubuntu server that I will be looking to implement the above mentioned patch and if I do so successfully I will openly share it here so you can do the same for yours and produce an official release
Author
Owner

@nefariouslegion commented on GitHub (Aug 13, 2025):

Hi guys been swimming around the various repos that use/implement librespot (which includes this repo, the original zotify repo and all forks of zotify) as well as the various implementations/versions of librespot (java and python respectively) The issue is with the mercury token generation and authorization, the solution is to change to login5 token authentication, however this is done in librespot itself and not in zotify, however zotify is the one that is choosing to use mercury auth process, and the login5 setup already exists in librespot so it can be implemented, here is a link to a contributor in the librespot java library that produced a patch for using login5 https://github.com/librespot-org/librespot-java/issues/1099 and that has resolved the issue

@Googolplexed0 since the main zotify repo does not look to be maintained and since your fork is very far ahead of dev (170 commits) it appears you or a contributor will need to implement a similar patch to use login5 token auth I have a build of the main zotify running on my ubuntu server that I will be looking to implement the above mentioned patch and if I do so successfully I will openly share it here so you can do the same for yours and produce an official release

Hey, dumb question but how do I actually implement this patch on Windows? When I download the file it has the .patch extension which when I try to run it just prompts the Open With screen.

<!-- gh-comment-id:3184711252 --> @nefariouslegion commented on GitHub (Aug 13, 2025): > Hi guys been swimming around the various repos that use/implement librespot (which includes this repo, the original zotify repo and all forks of zotify) as well as the various implementations/versions of librespot (java and python respectively) The issue is with the mercury token generation and authorization, the solution is to change to login5 token authentication, however this is done in librespot itself and not in zotify, however zotify is the one that is choosing to use mercury auth process, and the login5 setup already exists in librespot so it can be implemented, here is a link to a contributor in the librespot java library that produced a patch for using login5 [https://github.com/librespot-org/librespot-java/issues/1099](url) and that has resolved the issue > > [@Googolplexed0](https://github.com/Googolplexed0) since the main zotify repo does not look to be maintained and since your fork is very far ahead of dev (170 commits) it appears you or a contributor will need to implement a similar patch to use login5 token auth I have a build of the main zotify running on my ubuntu server that I will be looking to implement the above mentioned patch and if I do so successfully I will openly share it here so you can do the same for yours and produce an official release Hey, dumb question but how do I actually implement this patch on Windows? When I download the file it has the .patch extension which when I try to run it just prompts the Open With screen.
Author
Owner

@IsaacAgulhas commented on GitHub (Aug 13, 2025):

Hi guys been swimming around the various repos that use/implement librespot (which includes this repo, the original zotify repo and all forks of zotify) as well as the various implementations/versions of librespot (java and python respectively) The issue is with the mercury token generation and authorization, the solution is to change to login5 token authentication, however this is done in librespot itself and not in zotify, however zotify is the one that is choosing to use mercury auth process, and the login5 setup already exists in librespot so it can be implemented, here is a link to a contributor in the librespot java library that produced a patch for using login5 https://github.com/librespot-org/librespot-java/issues/1099 and that has resolved the issue
@Googolplexed0 since the main zotify repo does not look to be maintained and since your fork is very far ahead of dev (170 commits) it appears you or a contributor will need to implement a similar patch to use login5 token auth I have a build of the main zotify running on my ubuntu server that I will be looking to implement the above mentioned patch and if I do so successfully I will openly share it here so you can do the same for yours and produce an official release

Hey, dumb question but how do I actually implement this patch on Windows? When I download the file it has the .patch extension which when I try to run it just prompts the Open With screen.

unfortunately that won't work as that is for the java version of the library, please wait for an official release

<!-- gh-comment-id:3184718187 --> @IsaacAgulhas commented on GitHub (Aug 13, 2025): > > Hi guys been swimming around the various repos that use/implement librespot (which includes this repo, the original zotify repo and all forks of zotify) as well as the various implementations/versions of librespot (java and python respectively) The issue is with the mercury token generation and authorization, the solution is to change to login5 token authentication, however this is done in librespot itself and not in zotify, however zotify is the one that is choosing to use mercury auth process, and the login5 setup already exists in librespot so it can be implemented, here is a link to a contributor in the librespot java library that produced a patch for using login5 [https://github.com/librespot-org/librespot-java/issues/1099](url) and that has resolved the issue > > [@Googolplexed0](https://github.com/Googolplexed0) since the main zotify repo does not look to be maintained and since your fork is very far ahead of dev (170 commits) it appears you or a contributor will need to implement a similar patch to use login5 token auth I have a build of the main zotify running on my ubuntu server that I will be looking to implement the above mentioned patch and if I do so successfully I will openly share it here so you can do the same for yours and produce an official release > > Hey, dumb question but how do I actually implement this patch on Windows? When I download the file it has the .patch extension which when I try to run it just prompts the Open With screen. unfortunately that won't work as that is for the java version of the library, please wait for an official release
Author
Owner

@Googolplexed0 commented on GitHub (Aug 14, 2025):

the login5 setup already exists in librespot so it can be implemented, here is a link to a contributor in the librespot java library that produced a patch for using login5 https://github.com/librespot-org/librespot-java/issues/1099 and that has resolved the issue

I did a bit of digging as well (great find on the Java implementation!) and came to a similar conclusion. We will need our own implementation of login5. Either you @IsaacAgulhas, I, or another contributor will need to create this since I am fairly certain kokarare1212 doesn't make feature updates anymore.

I will do my best to come up with a workable pull request, but the lower levels of OAuth are something I will have to learn as I go. May make some progress this weekend. If you make a successful implementation before I get anywhere, I will gladly piggyback off you and help do any cleaning required to make it pull-worthy to the upstream librespot-python library.

<!-- gh-comment-id:3186668609 --> @Googolplexed0 commented on GitHub (Aug 14, 2025): > the login5 setup already exists in librespot so it can be implemented, here is a link to a contributor in the librespot java library that produced a patch for using login5 [https://github.com/librespot-org/librespot-java/issues/1099](url) and that has resolved the issue I did a bit of digging as well (great find on the Java implementation!) and came to a similar conclusion. We will need our own implementation of login5. Either you @IsaacAgulhas, I, or another contributor will need to create this since I am fairly certain kokarare1212 doesn't make feature updates anymore. I will do my best to come up with a workable pull request, but the lower levels of OAuth are something I will have to learn as I go. May make some progress this weekend. If you make a successful implementation before I get anywhere, I will gladly piggyback off you and help do any cleaning required to make it pull-worthy to the upstream librespot-python library.
Author
Owner

@qMvhmoud commented on GitHub (Aug 14, 2025):

I had the same issue with librespot-python, but I tried zotify and it worked for me once, then I got a 403 error. I guess it's an issue with the login endpoint, or maybe the authorization code only works once, which I doubt. Also, this package go-librespot works fine, but only on Linux/Docker. I was able to save the audio of all the songs I played while connected to the device, but it doesn't save each song individually, it saves them all as one combined file.

Edit:

I deleted the credentials.json file, logged in again, and tried to download another file, which worked.

<!-- gh-comment-id:3186903520 --> @qMvhmoud commented on GitHub (Aug 14, 2025): I had the same issue with librespot-python, but I tried zotify and it worked for me once, then I got a 403 error. I guess it's an issue with the login endpoint, or maybe the authorization code only works once, which I doubt. Also, this package [go-librespot](https://github.com/devgianlu/go-librespot) works fine, but only on Linux/Docker. I was able to save the audio of all the songs I played while connected to the device, but it doesn't save each song individually, it saves them all as one combined file. Edit: I deleted the credentials.json file, logged in again, and tried to download another file, which worked.
Author
Owner

@Googolplexed0 commented on GitHub (Aug 14, 2025):

Either you @IsaacAgulhas, I, or another contributor will need to create this

There seems to have been a semi-successful python implementation here. Worth looking at when building ours.

<!-- gh-comment-id:3188621347 --> @Googolplexed0 commented on GitHub (Aug 14, 2025): > Either you @IsaacAgulhas, I, or another contributor will need to create this There seems to have been a semi-successful python implementation [here](https://github.com/Xoconoch/librespot-spotizerr/pull/6). Worth looking at when building ours.
Author
Owner

@IsaacAgulhas commented on GitHub (Aug 14, 2025):

Either you @IsaacAgulhas, I, or another contributor will need to create this

There seems to have been a semi-successful python implementation here. Worth looking at when building ours.

I tested the new python implementation by uninstalling my current librespot python package and installing the above mentioned one and it works pretty well.

The implementation for it was intense because in the librespot python library the login5 component was available as a proto and that made development quite challenging, not to mention the actual implementation of the authentication flow so i'm glad that is now off my hands.

As for this repo its going to be a challenge since the issue is not with the project but rather a dependency so I'm interested to see how you will solve it. In any case I wish you the best of luck, happy hacking.

<!-- gh-comment-id:3189008893 --> @IsaacAgulhas commented on GitHub (Aug 14, 2025): > > Either you [@IsaacAgulhas](https://github.com/IsaacAgulhas), I, or another contributor will need to create this > > There seems to have been a semi-successful python implementation [here](https://github.com/Xoconoch/librespot-spotizerr/pull/6). Worth looking at when building ours. I tested the new python implementation by uninstalling my current librespot python package and installing the above mentioned one and it works pretty well. The implementation for it was intense because in the librespot python library the login5 component was available as a proto and that made development quite challenging, not to mention the actual implementation of the authentication flow so i'm glad that is now off my hands. As for this repo its going to be a challenge since the issue is not with the project but rather a dependency so I'm interested to see how you will solve it. In any case I wish you the best of luck, happy hacking.
Author
Owner

@Googolplexed0 commented on GitHub (Aug 17, 2025):

Submitted a fix for this to the upstream library. Until it gets accepted pushed into the main release, this library will use my fork. Everything should work like before after updating Zotify to v0.9.21.

<!-- gh-comment-id:3194103170 --> @Googolplexed0 commented on GitHub (Aug 17, 2025): Submitted [a fix for this](https://github.com/kokarare1212/librespot-python/pull/311) to the upstream library. Until it gets accepted pushed into the main release, this library will use my fork. Everything should work like before after updating Zotify to v0.9.21.
Author
Owner

@nefariouslegion commented on GitHub (Aug 17, 2025):

Submitted a fix for this to the upstream library. Until it gets accepted pushed into the main release, you can use my fixed version by running:

pip uninstall librespot-python
pip install git+https://github.com/Googolplexed0/librespot-python.git@login5-auth

Maybe I'm doing something wrong but I ran those commands and then tried to use Zotify. Still got errors.

Image
<!-- gh-comment-id:3194105553 --> @nefariouslegion commented on GitHub (Aug 17, 2025): > Submitted [a fix for this](https://github.com/kokarare1212/librespot-python/pull/311) to the upstream library. Until it gets accepted pushed into the main release, you can use my fixed version by running: > > ``` > pip uninstall librespot-python > pip install git+https://github.com/Googolplexed0/librespot-python.git@login5-auth > ``` Maybe I'm doing something wrong but I ran those commands and then tried to use Zotify. Still got errors. <img width="1219" height="1016" alt="Image" src="https://github.com/user-attachments/assets/6c0d58a7-b9f1-433f-a7b9-f5738cc877cc" />
Author
Owner

@Googolplexed0 commented on GitHub (Aug 17, 2025):

Maybe I'm doing something wrong but I ran those commands and then tried to use Zotify. Still got errors.

You are still using the previous version v0.9.14, since get_token() is calling super().get_token() in __init__.py. In v0.9.20, __init__.py has no functions. Make sure you update first.

<!-- gh-comment-id:3194108188 --> @Googolplexed0 commented on GitHub (Aug 17, 2025): > Maybe I'm doing something wrong but I ran those commands and then tried to use Zotify. Still got errors. You are still using the previous version v0.9.14, since `get_token()` is calling `super().get_token()` in `__init__.py`. In v0.9.20, `__init__.py` has no functions. Make sure you update first.
Author
Owner

@nefariouslegion commented on GitHub (Aug 17, 2025):

Update what exactly? I ran those 2 commands and it said they were successful. Do I need to run them while in a specific directory?

<!-- gh-comment-id:3194108913 --> @nefariouslegion commented on GitHub (Aug 17, 2025): Update what exactly? I ran those 2 commands and it said they were successful. Do I need to run them while in a specific directory?
Author
Owner

@Googolplexed0 commented on GitHub (Aug 17, 2025):

Update what exactly?

Update Zotify. You have updated an upstream library that Zotify uses, but your older version of Zotify is not using the patched library correctly (it's overwriting some functions).

<!-- gh-comment-id:3194109771 --> @Googolplexed0 commented on GitHub (Aug 17, 2025): > Update what exactly? Update Zotify. You have updated an upstream library that Zotify uses, but your older version of Zotify is not using the patched library correctly (it's overwriting some functions).
Author
Owner

@nefariouslegion commented on GitHub (Aug 17, 2025):

Apologies because I'm probably being dumb. But I don't see the v0.9.20 update. It shows this as the most recent on the github

Image
<!-- gh-comment-id:3194111518 --> @nefariouslegion commented on GitHub (Aug 17, 2025): Apologies because I'm probably being dumb. But I don't see the v0.9.20 update. It shows this as the most recent on the github <img width="316" height="135" alt="Image" src="https://github.com/user-attachments/assets/7de001e2-c03a-4cf8-bac9-2e81c2e562c6" />
Author
Owner

@Googolplexed0 commented on GitHub (Aug 17, 2025):

Apologies because I'm probably being dumb.

You're not dumb at all, I can see the source of your confusion.

But I don't see the v0.9.20 update. It shows this as the most recent on the github

These are just feature releases, or releases that I felt the need to write specific change notes for. I am going to make one for v0.9.20 shortly, I just haven't gotten around to that yet. Any change to the main branch, shown here, is technically a new version. These changes will be made to your install after running pipx install --force git+https://github.com/Googolplexed0/zotify.git whether there is an "official" release for it or not.

<!-- gh-comment-id:3194121607 --> @Googolplexed0 commented on GitHub (Aug 17, 2025): > Apologies because I'm probably being dumb. You're not dumb at all, I can see the source of your confusion. > But I don't see the v0.9.20 update. It shows this as the most recent on the github These are just feature releases, or releases that I felt the need to write specific change notes for. I am going to make one for v0.9.20 shortly, I just haven't gotten around to that yet. Any change to the `main` branch, shown [here](https://github.com/Googolplexed0/zotify/commits/main/), is technically a new version. These changes will be made to your install after running `pipx install --force git+https://github.com/Googolplexed0/zotify.git` whether there is an "official" release for it or not.
Author
Owner

@MianReplicate commented on GitHub (Aug 17, 2025):

Heyo so I'm having the same errors here as @nefariouslegion , but I can confirm that I have v0.9.20 as my console says this.

Image Image
<!-- gh-comment-id:3194129649 --> @MianReplicate commented on GitHub (Aug 17, 2025): Heyo so I'm having the same errors here as @nefariouslegion , but I can confirm that I have v0.9.20 as my console says this. <img width="1059" height="122" alt="Image" src="https://github.com/user-attachments/assets/0b5fd832-2001-4052-b237-4eb21a2919ac" /> <img width="989" height="774" alt="Image" src="https://github.com/user-attachments/assets/e52a2b67-5f19-4c87-b394-32736754f8d4" />
Author
Owner

@qMvhmoud commented on GitHub (Aug 17, 2025):

Check my own version #50, It should work fine. I've tested it on two different devices.

<!-- gh-comment-id:3194133962 --> @qMvhmoud commented on GitHub (Aug 17, 2025): Check my own version #50, It should work fine. I've tested it on two different devices.
Author
Owner

@Googolplexed0 commented on GitHub (Aug 17, 2025):

I can confirm that I have v0.9.20 as my console says this.

You are indeed on v0.9.20, but I have just realized that there is a mistake in v0.9.20 that will use the un-forked library for pipx. Should be fixed with v0.9.21.

<!-- gh-comment-id:3194141155 --> @Googolplexed0 commented on GitHub (Aug 17, 2025): > I can confirm that I have v0.9.20 as my console says this. You are indeed on v0.9.20, but I have just realized that there is a mistake in v0.9.20 that will use the un-forked library for pipx. Should be fixed with v0.9.21.
Author
Owner

@jaynetics commented on GitHub (Aug 17, 2025):

thank you!

maybe helpful for others: if pip uninstall librespot-python fails, as it did on my machine, using --force to install the branch also works:

pip install git+https://github.com/Googolplexed0/librespot-python.git@login5-auth --force
<!-- gh-comment-id:3194244858 --> @jaynetics commented on GitHub (Aug 17, 2025): thank you! maybe helpful for others: if `pip uninstall librespot-python` fails, as it did on my machine, using `--force` to install the branch also works: ``` pip install git+https://github.com/Googolplexed0/librespot-python.git@login5-auth --force ```
Author
Owner

@Aeiron2 commented on GitHub (Aug 18, 2025):

im still getting raise MercuryClient.MercuryException(response)
librespot.mercury.MercuryClient.MercuryException: status: 403

I updated librespot and downloaded the latest release. anyone know a fix?

<!-- gh-comment-id:3194870040 --> @Aeiron2 commented on GitHub (Aug 18, 2025): im still getting raise MercuryClient.MercuryException(response) librespot.mercury.MercuryClient.MercuryException: status: 403 I updated librespot and downloaded the latest release. anyone know a fix?
Author
Owner

@Aeiron2 commented on GitHub (Aug 18, 2025):

im still getting raise MercuryClient.MercuryException(response) librespot.mercury.MercuryClient.MercuryException: status: 403

I updated librespot and downloaded the latest release. anyone know a fix?

nvm i fixed it by replacing these 2 files github.com/kokarare1212/librespot-python@7481dca654 (diff-3f04af0b3e)

<!-- gh-comment-id:3194885869 --> @Aeiron2 commented on GitHub (Aug 18, 2025): > im still getting raise MercuryClient.MercuryException(response) librespot.mercury.MercuryClient.MercuryException: status: 403 > > I updated librespot and downloaded the latest release. anyone know a fix? nvm i fixed it by replacing these 2 files https://github.com/kokarare1212/librespot-python/commit/7481dca6549c996d319e934dc397b1fa471906fe#diff-3f04af0b3ee85e6de39ca0f604fbf7a26483edfa82eefe7a7323ea87ce67ecce
Author
Owner

@TNAS123 commented on GitHub (Aug 18, 2025):

Unfortunately getting more errors with the latest version
AttributeError: 'NoneType' object has no attribute 'access_token'

This is after updating Zotify and librespot-python. I may need to try downgrading as it was more reliable for playlist/list of entries in succession.

<!-- gh-comment-id:3196801525 --> @TNAS123 commented on GitHub (Aug 18, 2025): Unfortunately getting more errors with the latest version `AttributeError: 'NoneType' object has no attribute 'access_token'` This is after updating Zotify and librespot-python. I may need to try downgrading as it was more reliable for playlist/list of entries in succession.
Author
Owner

@ulyxie commented on GitHub (Aug 18, 2025):

Unfortunately getting more errors with the latest version AttributeError: 'NoneType' object has no attribute 'access_token'

This is after updating Zotify and librespot-python. I may need to try downgrading as it was more reliable for playlist/list of entries in succession.

Ditto on this.

The end of the log just repeats DEBUG:Librespot:TokenProvider:Login5 token expired, need to re-authenticate so I don't know what the issue could be.

zotify is version 0.9.22 installed from git repo, master branch, commit e5d8fab via pipx install . (before I was installing with the -e parameter as well but that doesnt seem to be the issue). Im running this on Debian so pip is super limited on this system.

Edit:
I fully forgot to add the command I'm running and the config that got generated from debug. Sorry! This could help with debugging
The command is the following:

zotify \
  --download-lyrics=true \
  --download-format=mp3 \
  --download-quality=very_high \
  -rp . \
  -ie True \
  --md-allgenres True \
  --retry-attempts 5 \
  --bulk-wait-time=10 \
  -rt True \
  -f songs.txt #contains playlist links

config_DEBUG.json

zotify_DEBUG_2025-08-18_15-12-24.log

<!-- gh-comment-id:3197675288 --> @ulyxie commented on GitHub (Aug 18, 2025): > Unfortunately getting more errors with the latest version `AttributeError: 'NoneType' object has no attribute 'access_token'` > > This is after updating Zotify and librespot-python. I may need to try downgrading as it was more reliable for playlist/list of entries in succession. Ditto on this. The end of the log just repeats `DEBUG:Librespot:TokenProvider:Login5 token expired, need to re-authenticate` so I don't know what the issue could be. zotify is version 0.9.22 installed from git repo, master branch, commit e5d8fab via `pipx install .` (before I was installing with the -e parameter as well but that doesnt seem to be the issue). Im running this on Debian so pip is super limited on this system. Edit: I fully forgot to add the command I'm running and the config that got generated from debug. Sorry! This could help with debugging The command is the following: ```bash zotify \ --download-lyrics=true \ --download-format=mp3 \ --download-quality=very_high \ -rp . \ -ie True \ --md-allgenres True \ --retry-attempts 5 \ --bulk-wait-time=10 \ -rt True \ -f songs.txt #contains playlist links ``` [config_DEBUG.json](https://github.com/user-attachments/files/21842281/config_DEBUG.json) [zotify_DEBUG_2025-08-18_15-12-24.log](https://github.com/user-attachments/files/21840142/zotify_DEBUG_2025-08-18_15-12-24.log)
Author
Owner

@RGPZ commented on GitHub (Aug 19, 2025):

@ulyxie I'm getting the error but only after a while of downloading a playlist since 'DEBUG:Librespot:TokenProvider:Login5 token expired, need to re-authenticate' says that the token expires, I assume that means the token used to sign in only lasts for a while before being reset. And I take it that the program doesn't know how to grab a new token after the original one has been reset until you restart the code.

<!-- gh-comment-id:3198834943 --> @RGPZ commented on GitHub (Aug 19, 2025): @ulyxie I'm getting the error but only after a while of downloading a playlist since 'DEBUG:Librespot:TokenProvider:Login5 token expired, need to re-authenticate' says that the token expires, I assume that means the token used to sign in only lasts for a while before being reset. And I take it that the program doesn't know how to grab a new token after the original one has been reset until you restart the code.
Author
Owner

@Googolplexed0 commented on GitHub (Aug 19, 2025):

I assume that means the token used to sign in only lasts for a while before being reset. And I take it that the program doesn't know how to grab a new token after the original one has been reset until you restart the code.

This is likely the case. All tokens come with an expire time, so the function to renew the authentication must not be implemented correctly. I will look into this. At least it is working for single-token sessions!

@TNAS123 @ulyxie @RGPZ, this should be spun off into its own new issue since it's very different from the MercuryException 403 error. Since the 403 is solved, I'm going to close this issue.

<!-- gh-comment-id:3198970456 --> @Googolplexed0 commented on GitHub (Aug 19, 2025): > I assume that means the token used to sign in only lasts for a while before being reset. And I take it that the program doesn't know how to grab a new token after the original one has been reset until you restart the code. This is likely the case. All tokens come with an expire time, so the function to renew the authentication must not be implemented correctly. I will look into this. At least it is working for single-token sessions! @TNAS123 @ulyxie @RGPZ, this should be spun off into its own new issue since it's very different from the MercuryException 403 error. Since the 403 is solved, I'm going to close this issue.
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#41
No description provided.