glomatico / votify

A Python CLI app for downloading songs/podcasts from Spotify.
MIT License
166 stars 11 forks source link

403 Error for specific songs #4

Closed youngoris closed 3 weeks ago

youngoris commented 1 month ago
iMac ~ % votify 'https://open.spotify.com/track/6XvAfT9d1us8tmuqRqzOMm?si=d084299e012943bd'
[INFO     17:50:55] Starting Votify
[INFO     17:50:56] (URL 1/1) Checking "https://open.spotify.com/track/6XvAfT9d1us8tmuqRqzOMm?si=d084299e012943bd"
[INFO     17:50:56] (Track 1/1 from URL 1/1) Downloading "Homage"
[ERROR    17:50:58] (Track 1/1 from URL 1/1) Failed to download "Homage"
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/votify/utils.py", line 8, in check_response
    response.raise_for_status()
  File "/usr/local/lib/python3.11/site-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://seektables.scdn.co/seektable/0b65ca1496e712e5860ec05d487ba4caa788979b.json

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/votify/cli.py", line 584, in main
    downloader_song.download(
  File "/usr/local/lib/python3.11/site-packages/votify/downloader_song.py", line 137, in download
    self._download(*args, **kwargs)
  File "/usr/local/lib/python3.11/site-packages/votify/downloader_song.py", line 165, in _download
    stream_info = self.get_stream_info(gid_metadata, "track")
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/votify/downloader_audio.py", line 82, in get_stream_info
    seek_table = self.downloader.spotify_api.get_seek_table(file_id)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/votify/spotify_api.py", line 274, in get_seek_table
    check_response(response)
  File "/usr/local/lib/python3.11/site-packages/votify/utils.py", line 10, in check_response
    _raise_response_exception(response)
  File "/usr/local/lib/python3.11/site-packages/votify/utils.py", line 14, in _raise_response_exception
    raise Exception(
Exception: Request failed with status code 403: 
[INFO     17:50:58] Done (1 error(s))
NoRRt commented 1 month ago

I also have this problem

Traceback (most recent call last): File "C:\Users\Us\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\votify\utils.py", line 8, in check_response response.raise_for_status() File "C:\Users\Us\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\requests\models.py", line 1024, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://gew4-spclient.spotify.com/playplay/v1/key/c5b64666fcd0d9eaedcb277e050797b7045b82a8

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\Us\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\votify\cli.py", line 584, in main downloader_song.download( File "C:\Users\Us\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\votify\downloader_song.py", line 137, in download self._download(*args, **kwargs) File "C:\Users\Us\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\votify\downloader_song.py", line 213, in _download decryption_key = self.get_decryption_key(stream_info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Us\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\votify\downloader_audio.py", line 94, in get_decryption_key decryption_key = self.downloader.get_playplay_decryption_key( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Us\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\votify\downloader.py", line 370, in get_playplay_decryption_key playplay_license_response_bytes = self.spotify_api.get_playplay_license( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Us\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\votify\spotify_api.py", line 283, in get_playplay_license check_response(response) File "C:\Users\Us\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\votify\utils.py", line 10, in check_response _raise_response_exception(response) File "C:\Users\Us\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\votify\utils.py", line 14, in _raise_response_exception raise Exception( Exception: Request failed with status code 403: [INFO 09:03:41] Done (1 error(s))

djdoolky76 commented 1 month ago

This usually happens when you set the "audio_quality": "aac-high", vorbis-high might fixed the problem

Fxzzi commented 1 month ago

could we have an option for aac-high and to then fallback to vorbis high?