[BUG] Error in TOKEN Authentication
bug
**Describe the bug**
When i try to log in with the new oauth, the new credentials.json is dumped and then an exeption stop the code execution. If I try to re-run, the login process works with the stored credentials
**To Reproduce**
Run the snippet provided in the readme
from librespot.core import Session
def auth_url_callback(url):
print(url)
session = Session.Builder() \
.oauth(auth_url_callback) \
.create()
**Expected behavior**
It should log in without an exeption
**Client Information (please complete the following information):**
- OS: Windows 11
- Python Version: 3.12.10
- Library Version: Last commit
**Additional context**
The exception
Traceback (most recent call last):
File "c:\Users\matteo\OneDrive - elFusoo\Desktop\Scrivania\Programmazione\Python\musicdownloader\a.py", line 10, in <module>
.create()
^^^^^^^^
File "C:\Users\matteo\OneDrive - elFusoo\Desktop\Scrivania\Programmazione\Python\musicdownloader\.musicdownloader\Lib\site-packages\librespot\core.py", line 1647, in create
session.authenticate(self.login_credentials)
File "C:\Users\matteo\OneDrive - elFusoo\Desktop\Scrivania\Programmazione\Python\musicdownloader\.musicdownloader\Lib\site-packages\librespot\core.py", line 955, in authenticate
self.dealer().connect()
File "C:\Users\matteo\OneDrive - elFusoo\Desktop\Scrivania\Programmazione\Python\musicdownloader\.musicdownloader\Lib\site-packages\librespot\core.py", line 451, in connect
self.__session.tokens().get("playlist-read"),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\matteo\OneDrive - elFusoo\Desktop\Scrivania\Programmazione\Python\musicdownloader\.musicdownloader\Lib\site-packages\librespot\core.py", line 2251, in get
return self.get_token(scope).access_token
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\matteo\OneDrive - elFusoo\Desktop\Scrivania\Programmazione\Python\musicdownloader\.musicdownloader\Lib\site-packages\librespot\core.py", line 2271, in get_token
response = self._session.mercury().send_sync_json(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\matteo\OneDrive - elFusoo\Desktop\Scrivania\Programmazione\Python\musicdownloader\.musicdownloader\Lib\site-packages\librespot\mercury.py", line 186, in send_sync_json
raise MercuryClient.MercuryException(response)
librespot.mercury.MercuryClient.MercuryException: status: 403
关闭于 2025-08-17 7 条评论