Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Failed fetching audio key! gid #276

Open
Masterolic opened this issue Jul 7, 2024 · 14 comments
Open

[BUG] Failed fetching audio key! gid #276

Masterolic opened this issue Jul 7, 2024 · 14 comments
Labels
bug Something isn't working

Comments

@Masterolic
Copy link

Traceback (most recent call last):
File "/root/Spotify-downloa-bot/mbot/plugins/Spotify.py", line 166, in spotify_dl
await create_task(episode_down(item , item_name, randomdir , Mbot , message, get_prem))
File "/root/Spotify-downloa-bot/mbot/utils/SpotDL.py", line 97, in episode_down
randomfile = await create_task(download_file(session, episode_id, randomdir, get_prem))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/Spotify-downloa-bot/mbot/utils/SpotDL.py", line 58, in download_file
stream = session.content_feeder().load(episode_id, VorbisOnlyAudioQuality(AudioQuality.HIGH), False, None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/librespot/audio/init.py", line 742, in load
return self.load_episode(playable_id, audio_quality_picker,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/librespot/audio/init.py", line 780, in load_episode
return self.load_stream(file, None, episode, preload, halt_listener)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/librespot/audio/init.py", line 756, in load_stream
return CdnFeedHelper.load_episode(self.__session, episode, file,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/librespot/audio/init.py", line 391, in load_episode
key = session.audio_key().get_audio_key(episode.gid, file.file_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/librespot/audio/init.py", line 277, in get_audio_key
return self.get_audio_key(gid, file_id, False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/librespot/audio/init.py", line 278, in get_audio_key
raise RuntimeError(
RuntimeError: Failed fetching audio key! gid: ef41ab6ee4495ebb9a4a8e9593699e6c, fileId: 051faa3f4b7b38a1687bd7f3ba2a6f7d0236bf28

Item_,type = Episode

@Masterolic Masterolic added the bug Something isn't working label Jul 7, 2024
@kokarare1212
Copy link
Owner

Generally, you are trying to load 320 kbps music on a non-premium account or region-locked.

@pdtan
Copy link

pdtan commented Aug 30, 2024

I got this error with Audio key error, code: 2
Account premium, if retry, it may work again. So it's not region-locked.
first try:

[DEBUG    11:52:07] https://guc3-spclient.spotify.com:443 "GET /metadata/4/track/17bd212d25dd45d088136391057e274f HTTP/1.1" 200 702
[DEBUG    11:52:08] https://guc3-spclient.spotify.com:443 "GET /storage-resolve/files/audio/interactive/3e65c9ae6648bef681f0b66508693f4cfd78bd4d HTTP/1.1" 200 347
[CRITICAL 11:52:08] Audio key error, code: 2
[CRITICAL 11:52:08] Audio key error, code: 2
Traceback (most recent call last):
  File "spot.py", line 108, in <module>
    stream = session.content_feeder().load(trackId, VorbisOnlyAudioQuality(AudioQuality.VERY_HIGH), False, None)
  File "/usr/local/lib/python3.8/dist-packages/librespot/audio/__init__.py", line 739, in load
    return self.load_track(playable_id, audio_quality_picker, preload,
  File "/usr/local/lib/python3.8/dist-packages/librespot/audio/__init__.py", line 800, in load_track
    return self.load_stream(file, track, None, preload, halt_listener)
  File "/usr/local/lib/python3.8/dist-packages/librespot/audio/__init__.py", line 754, in load_stream
    return CdnFeedHelper.load_track(self.__session, track, file,
  File "/usr/local/lib/python3.8/dist-packages/librespot/audio/__init__.py", line 339, in load_track
    key = session.audio_key().get_audio_key(track.gid, file.file_id)
  File "/usr/local/lib/python3.8/dist-packages/librespot/audio/__init__.py", line 277, in get_audio_key
    return self.get_audio_key(gid, file_id, False)
  File "/usr/local/lib/python3.8/dist-packages/librespot/audio/__init__.py", line 278, in get_audio_key
    raise RuntimeError(
RuntimeError: Failed fetching audio key! gid: 17bd212d25dd45d088136391057e274f, fileId: 3e65c9ae6648bef681f0b66508693f4cfd78bd4d

success in 2nd try:

[DEBUG    11:53:14] https://guc3-spclient.spotify.com:443 "GET /metadata/4/track/17bd212d25dd45d088136391057e274f HTTP/1.1" 200 702
[DEBUG    11:53:14] https://guc3-spclient.spotify.com:443 "GET /storage-resolve/files/audio/interactive/3e65c9ae6648bef681f0b66508693f4cfd78bd4d HTTP/1.1" 200 347
[DEBUG    11:53:14] Starting new HTTPS connection (1): audio4-fa.scdn.co:443
[DEBUG    11:53:14] https://audio4-fa.scdn.co:443 "GET /audio/3e65c9ae6648bef681f0b66508693f4cfd78bd4d?1725105194_hUqm75ZOf5qGSCKdiQ1YRTqpRWmc5SHiEKzh6jRBSKU= HTTP/1.1" 206 131072
[DEBUG    11:53:14] Chunk 1/57 completed, cached: False, stream: file_id: 3e65c9ae6648bef681f0b66508693f4cfd78bd4d
[DEBUG    11:53:14] Loaded normalization data, track_gain: -9.830001831054688, track_peak: 1.033494472503662, album_gain: -9.959999084472656, album_peak: 1.0541013479232788

@Masterolic
Copy link
Author

I got this error with Audio key error, code: 2 Account premium, if retry, it may work again. So it's not region-locked. first try:

[DEBUG    11:52:07] https://guc3-spclient.spotify.com:443 "GET /metadata/4/track/17bd212d25dd45d088136391057e274f HTTP/1.1" 200 702
[DEBUG    11:52:08] https://guc3-spclient.spotify.com:443 "GET /storage-resolve/files/audio/interactive/3e65c9ae6648bef681f0b66508693f4cfd78bd4d HTTP/1.1" 200 347
[CRITICAL 11:52:08] Audio key error, code: 2
[CRITICAL 11:52:08] Audio key error, code: 2
Traceback (most recent call last):
  File "spot.py", line 108, in <module>
    stream = session.content_feeder().load(trackId, VorbisOnlyAudioQuality(AudioQuality.VERY_HIGH), False, None)
  File "/usr/local/lib/python3.8/dist-packages/librespot/audio/__init__.py", line 739, in load
    return self.load_track(playable_id, audio_quality_picker, preload,
  File "/usr/local/lib/python3.8/dist-packages/librespot/audio/__init__.py", line 800, in load_track
    return self.load_stream(file, track, None, preload, halt_listener)
  File "/usr/local/lib/python3.8/dist-packages/librespot/audio/__init__.py", line 754, in load_stream
    return CdnFeedHelper.load_track(self.__session, track, file,
  File "/usr/local/lib/python3.8/dist-packages/librespot/audio/__init__.py", line 339, in load_track
    key = session.audio_key().get_audio_key(track.gid, file.file_id)
  File "/usr/local/lib/python3.8/dist-packages/librespot/audio/__init__.py", line 277, in get_audio_key
    return self.get_audio_key(gid, file_id, False)
  File "/usr/local/lib/python3.8/dist-packages/librespot/audio/__init__.py", line 278, in get_audio_key
    raise RuntimeError(
RuntimeError: Failed fetching audio key! gid: 17bd212d25dd45d088136391057e274f, fileId: 3e65c9ae6648bef681f0b66508693f4cfd78bd4d

success in 2nd try:

[DEBUG    11:53:14] https://guc3-spclient.spotify.com:443 "GET /metadata/4/track/17bd212d25dd45d088136391057e274f HTTP/1.1" 200 702
[DEBUG    11:53:14] https://guc3-spclient.spotify.com:443 "GET /storage-resolve/files/audio/interactive/3e65c9ae6648bef681f0b66508693f4cfd78bd4d HTTP/1.1" 200 347
[DEBUG    11:53:14] Starting new HTTPS connection (1): audio4-fa.scdn.co:443
[DEBUG    11:53:14] https://audio4-fa.scdn.co:443 "GET /audio/3e65c9ae6648bef681f0b66508693f4cfd78bd4d?1725105194_hUqm75ZOf5qGSCKdiQ1YRTqpRWmc5SHiEKzh6jRBSKU= HTTP/1.1" 206 131072
[DEBUG    11:53:14] Chunk 1/57 completed, cached: False, stream: file_id: 3e65c9ae6648bef681f0b66508693f4cfd78bd4d
[DEBUG    11:53:14] Loaded normalization data, track_gain: -9.830001831054688, track_peak: 1.033494472503662, album_gain: -9.959999084472656, album_peak: 1.0541013479232788

Yes buddy i too facing same issues:)

@pdtan
Copy link

pdtan commented Sep 4, 2024

seems problem is about rate limit, checkout here
I switched to fetch audio key from seektables & mp4 format

@Masterolic
Copy link
Author

Masterolic commented Sep 5, 2024

seems problem is about rate limit, checkout here I switched to fetch audio key from seektables & mp4 format

Fetching from seektables also has the rate limit issue right?

@pdtan
Copy link

pdtan commented Sep 5, 2024

Fetching from seektables also has the rate limit issue right?

Not yet. Still in testing

@Masterolic
Copy link
Author

Fetching from seektables also has the rate limit issue right?

Not yet. Still in testing

Could you please share the repo which support seektables

@pdtan
Copy link

pdtan commented Sep 5, 2024

@Masterolic I'm using this

@Masterolic
Copy link
Author

@Masterolic I'm using this

Thank you

https://github.com/KagChi/librespot-python

Support seektables seems like that also has limits after certain time

@wolkenschieber
Copy link

seems problem is about rate limit, checkout here I switched to fetch audio key from seektables & mp4 format

Any idea about the limit? For me the error appears at random, even with sequential track processing.

@Masterolic
Copy link
Author

seems problem is about rate limit, checkout here I switched to fetch audio key from seektables & mp4 format

Any idea about the limit? For me the error appears at random, even with sequential track processing.

For me around 10 to 15 is the maximum then it goes for awhile

@KagChi
Copy link

KagChi commented Oct 7, 2024

@Masterolic I'm using this

Thank you

https://github.com/KagChi/librespot-python

Support seektables seems like that also has limits after certain time

Hey, did you got it working with the repo? 🤔

@Masterolic
Copy link
Author

Hey, did you got it working with the repo? 🤔

No buddy it wont as 404 raise from seektables seems like its a cdn so generate when requested but dont know how to request

Purchasing family package and creating 6 account and sharing the premium and using multiple account to generate link works fine

@KagChi
Copy link

KagChi commented Oct 7, 2024

Hey, did you got it working with the repo? 🤔

No buddy it wont as 404 raise from seektables seems like its a cdn so generate when requested but dont know how to request

Purchasing family package and creating 6 account and sharing the premium and using multiple account to generate link works fine

seektables only works on aac format which is need wvd files as far i know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants