Merge pull request #51 from deuslhepague/main

Update authorization endpoints and TOTP
This commit is contained in:
Rafael Moraes
2025-07-04 18:20:11 -03:00
committed by GitHub
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -77,12 +77,12 @@ class SpotifyApi:
self._set_user_profile()
def _set_session_info(self):
server_time_response = self.session.get("https://open.spotify.com/server-time")
server_time_response = self.session.get("https://open.spotify.com/api/server-time")
check_response(server_time_response)
server_time = 1e3 * server_time_response.json()["serverTime"]
totp = self.totp.generate(timestamp=server_time)
session_info_response = self.session.get(
"https://open.spotify.com/get_access_token",
"https://open.spotify.com/api/token",
params={
"reason": "init",
"productType": "web-player",
+2 -2
View File
@@ -6,8 +6,8 @@ import math
class TOTP:
def __init__(self) -> None:
# dumped directly from the object, after all decryptions
self.secret = b"5507145853487499592248630329347"
self.version = 5
self.secret = b"449443649084886328893534571041315"
self.version = 8
self.period = 30
self.digits = 6