From ee056791dc5260e8c0abf28eb7ed26f641efc2ab Mon Sep 17 00:00:00 2001 From: Rafael Moraes <50295204+glomatico@users.noreply.github.com> Date: Mon, 16 Dec 2024 20:11:34 -0300 Subject: [PATCH] adjust `User-Agent` header from `get_seek_table` --- votify/spotify_api.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/votify/spotify_api.py b/votify/spotify_api.py index 78da931..02ce592 100644 --- a/votify/spotify_api.py +++ b/votify/spotify_api.py @@ -273,7 +273,6 @@ class SpotifyApi: return response.json() def get_seek_table(self, file_id: str) -> dict: - # self._refresh_session_auth() # no session refresh is needed headers = { "Accept": "*/*", "Accept-Encoding": "gzip, deflate, br, zstd", @@ -287,9 +286,12 @@ class SpotifyApi: "Sec-Fetch-Dest": "empty", "Sec-Fetch-Mode": "cors", "Sec-Fetch-Site": "cross-site", - "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0", + "User-Agent": self.session.headers["user-agent"], } - response = requests.get(self.SEEK_TABLE_API_URL.format(file_id=file_id), headers=headers) + response = requests.get( + self.SEEK_TABLE_API_URL.format(file_id=file_id), + headers=headers, + ) check_response(response) return response.json()