[GH-ISSUE #19] Issues with Playlist Downloading #18

Closed
opened 2026-02-27 04:57:07 +03:00 by kerem · 1 comment
Owner

Originally created by @dancinbutterfly on GitHub (Jun 9, 2025).
Original GitHub issue: https://github.com/Googolplexed0/zotify/issues/19

Originally assigned to: @Googolplexed0 on GitHub.

Hello! Thank you so much for your help!
Progress has been made! I am learning!

But I'm having more issues! And I'm not sure what what mistake I'm making now

Zotify -p worked but there's new issues now?

When I tried to do a set of playlists instead of just one.

So I asked to download playists 3 though 13 with a dash and it looked like this

ID(s): 3-13,
Traceback (most recent call last):
File "/Users/admin/.local/bin/zotify", line 8, in
sys.exit(main())
~~~~^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/main.py", line 71, in main
args.func(args)
~~~~~~~~~^^^^^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/app.py", line 56, in client
download_from_user_playlist()
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/playlist.py", line 99, in download_from_user_playlist
playlist_choices = split_input(selection)
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/utils.py", line 146, in split_input
for number in range(int(selection.split('-')[0]), int(selection.split('-')[1]) + 1):
~~~^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: '13,'

So I tried again and tried to download JUST playlist 3
That seems like it's working!

But there are some strange things happening in the code. For quite a few there will be a result

Spotify API Error (unknown): received an empty response

And then it seemed to just get overwhelemed and sit up bunch of rejection message and then it stopped and this is about the end of it. I'm not sure what exactly went wrong here? But I do know that "error" and "failed" happening a lot is a problem.

So what do you think?

Thanks again. I really appreciate your patience.

And hey! This is farther than I got last time! I'm encouraged! :D

Audio key error, code: 2
Audio key error, code: 2███████████████▊ | 54.0/60.0 [02:20<00:04, 1.43songs/s]

SKIPPING: Stand Atlantic - Hate Me (Sometimes) (GENERAL DOWNLOAD ERROR) - Track_ID: 69Y6dB1U7AZ0FfDdzol6ir

Extra_Keys {"playlist_song_name": "Hate Me (Sometimes)", "playlist": "Bad Falling Bitches ", "playlist_num": "55", "playlist_id": "1HGpRbVDOlFvciSnkNKOgW", "playlist_track_id": "69Y6dB1U7AZ0FfDdzol6ir"}

Traceback (most recent call last):
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/track.py", line 291, in download_track
stream = Zotify.get_content_stream(track, Zotify.DOWNLOAD_QUALITY)
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/zotify.py", line 52, in get_content_stream
return cls.SESSION.content_feeder().load(content_id, VorbisOnlyAudioQuality(quality), False, None)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 739, in load
return self.load_track(playable_id, audio_quality_picker, preload,
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
halt_listener)
^^^^^^^^^^^^^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 800, in load_track
return self.load_stream(file, track, None, preload, halt_listener)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 754, in load_stream
return CdnFeedHelper.load_track(self.__session, track, file,
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
response, preload, halt_lister)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 339, in load_track
key = session.audio_key().get_audio_key(track.gid, file.file_id)
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 277, in get_audio_key
return self.get_audio_key(gid, file_id, False)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 278, in get_audio_key
raise RuntimeError(
"Failed fetching audio key! gid: {}, fileId: {}".format(
util.bytes_to_hex(gid), util.bytes_to_hex(file_id)))
RuntimeError: Failed fetching audio key! gid: ca6ca4c26c424940850a6d6822a73ac7, fileId: 2ac623c632c454dbc3d917015b6b02230442c4bf

                                                                                                                                                             [●∙∙] Preparing download...                                                                                                                      
    [∙●∙] Preparing download...                                                                                                                      

Audio key error, code: 2%|██████████████▋ | 55.0/60.0 [02:20<00:02, 1.73songs/s]

SKIPPING: Honey Revenge - Are You Impressed_ (GENERAL DOWNLOAD ERROR) - Track_ID: 46UDlYUFZgpRDzouOGBM1m

Extra_Keys {"playlist_song_name": "Are You Impressed?", "playlist": "Bad Falling Bitches ", "playlist_num": "56", "playlist_id": "1HGpRbVDOlFvciSnkNKOgW", "playlist_track_id": "46UDlYUFZgpRDzouOGBM1m"}

Traceback (most recent call last):
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/track.py", line 291, in download_track
stream = Zotify.get_content_stream(track, Zotify.DOWNLOAD_QUALITY)
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/zotify.py", line 52, in get_content_stream
return cls.SESSION.content_feeder().load(content_id, VorbisOnlyAudioQuality(quality), False, None)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 739, in load
return self.load_track(playable_id, audio_quality_picker, preload,
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
halt_listener)
^^^^^^^^^^^^^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 800, in load_track
return self.load_stream(file, track, None, preload, halt_listener)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 754, in load_stream
return CdnFeedHelper.load_track(self.__session, track, file,
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
response, preload, halt_lister)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 339, in load_track
key = session.audio_key().get_audio_key(track.gid, file.file_id)
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 277, in get_audio_key
return self.get_audio_key(gid, file_id, False)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 278, in get_audio_key
raise RuntimeError(
"Failed fetching audio key! gid: {}, fileId: {}".format(
util.bytes_to_hex(gid), util.bytes_to_hex(file_id)))
RuntimeError: Failed fetching audio key! gid: 871759643c914aceb6580338abf00fcc, fileId: e3cfe60a814ee8c1f4cc9e26fb7036b7f2eb51ea

                                                                                                                                                             [●∙∙] Fetching track information...                                                                                                              
    [∙●∙] Preparing download...                                                                                                                      

Are You Impressed?: 93%|███████████████▊ | 56.0/60.0 [02:20<00:01, 2.13songs/s] Spotify API Error (unknown): received an empty response

SKIPPING: LYRICS FOR "The Maine - Loved You A Little (with Taking Back Sunday and Charlotte Sands)" (LYRICS NOT AVAILABLE)

    [●∙∙] Converting file...                                                                                                                         
                                                                                                                                                     
                                                                                                                                                             [∙●∙] Preparing download...                                                                                                                      

Audio key error, code: 2
Audio key error, code: 2 Taking Back Sunday and Charlotte Sands): 95%|▉| 57.0/6

SKIPPING: We Are The In Crowd - The Best Thing (That Never Happened) (GENERAL DOWNLOAD ERROR) - Track_ID: 5H4nCAMT63jW86e8s81VV4

Extra_Keys {"playlist_song_name": "The Best Thing (That Never Happened)", "playlist": "Bad Falling Bitches ", "playlist_num": "58", "playlist_id": "1HGpRbVDOlFvciSnkNKOgW", "playlist_track_id": "5H4nCAMT63jW86e8s81VV4"}

Traceback (most recent call last):
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/track.py", line 291, in download_track
stream = Zotify.get_content_stream(track, Zotify.DOWNLOAD_QUALITY)
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/zotify.py", line 52, in get_content_stream
return cls.SESSION.content_feeder().load(content_id, VorbisOnlyAudioQuality(quality), False, None)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 739, in load
return self.load_track(playable_id, audio_quality_picker, preload,
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
halt_listener)
^^^^^^^^^^^^^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 800, in load_track
return self.load_stream(file, track, None, preload, halt_listener)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 754, in load_stream
return CdnFeedHelper.load_track(self.__session, track, file,
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
response, preload, halt_lister)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 339, in load_track
key = session.audio_key().get_audio_key(track.gid, file.file_id)
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 277, in get_audio_key
return self.get_audio_key(gid, file_id, False)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 278, in get_audio_key
raise RuntimeError(
"Failed fetching audio key! gid: {}, fileId: {}".format(
util.bytes_to_hex(gid), util.bytes_to_hex(file_id)))
RuntimeError: Failed fetching audio key! gid: bb1c0b1b0b8f42b19350fe2b418e06ae, fileId: 908ad202226c432f5d513fbdc072c27ec0d2b11e

                                                                                                                                                             [∙●∙] Preparing download...                                                                                                                      
    [∙∙●] Preparing download...                                                                                                                      

Audio key error, code: 2er Happened): 97%|▉| 58.0/60.0 [02:23<00:01, 1.16songs/

SKIPPING: Telltale - Won't Be Me (GENERAL DOWNLOAD ERROR) - Track_ID: 7nm9EVUk20prpgX0JxvdbH

Extra_Keys {"playlist_song_name": "Won't Be Me", "playlist": "Bad Falling Bitches ", "playlist_num": "59", "playlist_id": "1HGpRbVDOlFvciSnkNKOgW", "playlist_track_id": "7nm9EVUk20prpgX0JxvdbH"}

Traceback (most recent call last):
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/track.py", line 291, in download_track
stream = Zotify.get_content_stream(track, Zotify.DOWNLOAD_QUALITY)
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/zotify.py", line 52, in get_content_stream
return cls.SESSION.content_feeder().load(content_id, VorbisOnlyAudioQuality(quality), False, None)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 739, in load
return self.load_track(playable_id, audio_quality_picker, preload,
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
halt_listener)
^^^^^^^^^^^^^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 800, in load_track
return self.load_stream(file, track, None, preload, halt_listener)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 754, in load_stream
return CdnFeedHelper.load_track(self.__session, track, file,
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
response, preload, halt_lister)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 339, in load_track
key = session.audio_key().get_audio_key(track.gid, file.file_id)
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 277, in get_audio_key
return self.get_audio_key(gid, file_id, False)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 278, in get_audio_key
raise RuntimeError(
"Failed fetching audio key! gid: {}, fileId: {}".format(
util.bytes_to_hex(gid), util.bytes_to_hex(file_id)))
RuntimeError: Failed fetching audio key! gid: f2604ebc738640dbbedede0b4411af01, fileId: e61f20bc00c4c25a3c444fbe99c622e1b6175e64

                                                                                                                                                             [●∙∙] Preparing download...                                                                                                                      
    [∙●∙] Preparing download...                                                                                                                      

Audio key error, code: 2█████████████████▌| 59.0/60.0 [02:23<00:00, 1.42songs/s]

SKIPPING: Hot Milk - June Gloom (GENERAL DOWNLOAD ERROR) - Track_ID: 5qtUcb6KW9O8NMETtahSXv

Extra_Keys {"playlist_song_name": "June Gloom", "playlist": "Bad Falling Bitches ", "playlist_num": "60", "playlist_id": "1HGpRbVDOlFvciSnkNKOgW", "playlist_track_id": "5qtUcb6KW9O8NMETtahSXv"}

Traceback (most recent call last):
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/track.py", line 291, in download_track
stream = Zotify.get_content_stream(track, Zotify.DOWNLOAD_QUALITY)
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/zotify.py", line 52, in get_content_stream
return cls.SESSION.content_feeder().load(content_id, VorbisOnlyAudioQuality(quality), False, None)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 739, in load
return self.load_track(playable_id, audio_quality_picker, preload,
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
halt_listener)
^^^^^^^^^^^^^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 800, in load_track
return self.load_stream(file, track, None, preload, halt_listener)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 754, in load_stream
return CdnFeedHelper.load_track(self.__session, track, file,
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
response, preload, halt_lister)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 339, in load_track
key = session.audio_key().get_audio_key(track.gid, file.file_id)
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 277, in get_audio_key
return self.get_audio_key(gid, file_id, False)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/init.py", line 278, in get_audio_key
raise RuntimeError(
"Failed fetching audio key! gid: {}, fileId: {}".format(
util.bytes_to_hex(gid), util.bytes_to_hex(file_id)))
RuntimeError: Failed fetching audio key! gid: b2518ee49ce44630bf3b1b8df2889479, fileId: 1717148c58332100711bac28412dda5729d52a00

admin@MacBookPro ~ %

Originally created by @dancinbutterfly on GitHub (Jun 9, 2025). Original GitHub issue: https://github.com/Googolplexed0/zotify/issues/19 Originally assigned to: @Googolplexed0 on GitHub. Hello! Thank you so much for your help! Progress has been made! I am learning! But I'm having more issues! And I'm not sure what what mistake I'm making now Zotify -p worked but there's new issues now? When I tried to do a set of playlists instead of just one. So I asked to download playists 3 though 13 with a dash and it looked like this > ID(s): 3-13, > Traceback (most recent call last): > File "/Users/admin/.local/bin/zotify", line 8, in <module> > sys.exit(main()) > ~~~~^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/__main__.py", line 71, in main > args.func(args) > ~~~~~~~~~^^^^^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/app.py", line 56, in client > download_from_user_playlist() > ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/playlist.py", line 99, in download_from_user_playlist > playlist_choices = split_input(selection) > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/utils.py", line 146, in split_input > for number in range(int(selection.split('-')[0]), int(selection.split('-')[1]) + 1): > ~~~^^^^^^^^^^^^^^^^^^^^^^^^^ > ValueError: invalid literal for int() with base 10: '13,' So I tried again and tried to download JUST playlist 3 That seems like it's working! But there are some strange things happening in the code. For quite a few there will be a result > Spotify API Error (unknown): received an empty response And then it seemed to just get overwhelemed and sit up bunch of rejection message and then it stopped and this is about the end of it. I'm not sure what exactly went wrong here? But I do know that "error" and "failed" happening a lot is a problem. So what do you think? Thanks again. I really appreciate your patience. And hey! This is farther than I got last time! I'm encouraged! :D > > Audio key error, code: 2 > Audio key error, code: 2███████████████▊ | 54.0/60.0 [02:20<00:04, 1.43songs/s] > ### SKIPPING: Stand Atlantic - Hate Me (Sometimes) (GENERAL DOWNLOAD ERROR) - Track_ID: 69Y6dB1U7AZ0FfDdzol6ir ### > Extra_Keys {"playlist_song_name": "Hate Me (Sometimes)", "playlist": "Bad Falling Bitches ", "playlist_num": "55", "playlist_id": "1HGpRbVDOlFvciSnkNKOgW", "playlist_track_id": "69Y6dB1U7AZ0FfDdzol6ir"} > > Traceback (most recent call last): > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/track.py", line 291, in download_track > stream = Zotify.get_content_stream(track, Zotify.DOWNLOAD_QUALITY) > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/zotify.py", line 52, in get_content_stream > return cls.SESSION.content_feeder().load(content_id, VorbisOnlyAudioQuality(quality), False, None) > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 739, in load > return self.load_track(playable_id, audio_quality_picker, preload, > ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > halt_listener) > ^^^^^^^^^^^^^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 800, in load_track > return self.load_stream(file, track, None, preload, halt_listener) > ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 754, in load_stream > return CdnFeedHelper.load_track(self.__session, track, file, > ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > response, preload, halt_lister) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 339, in load_track > key = session.audio_key().get_audio_key(track.gid, file.file_id) > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 277, in get_audio_key > return self.get_audio_key(gid, file_id, False) > ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 278, in get_audio_key > raise RuntimeError( > "Failed fetching audio key! gid: {}, fileId: {}".format( > util.bytes_to_hex(gid), util.bytes_to_hex(file_id))) > RuntimeError: Failed fetching audio key! gid: ca6ca4c26c424940850a6d6822a73ac7, fileId: 2ac623c632c454dbc3d917015b6b02230442c4bf > > > > [●∙∙] Preparing download... > [∙●∙] Preparing download... > Audio key error, code: 2%|██████████████▋ | 55.0/60.0 [02:20<00:02, 1.73songs/s] > ### SKIPPING: Honey Revenge - Are You Impressed_ (GENERAL DOWNLOAD ERROR) - Track_ID: 46UDlYUFZgpRDzouOGBM1m ### > Extra_Keys {"playlist_song_name": "Are You Impressed?", "playlist": "Bad Falling Bitches ", "playlist_num": "56", "playlist_id": "1HGpRbVDOlFvciSnkNKOgW", "playlist_track_id": "46UDlYUFZgpRDzouOGBM1m"} > > Traceback (most recent call last): > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/track.py", line 291, in download_track > stream = Zotify.get_content_stream(track, Zotify.DOWNLOAD_QUALITY) > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/zotify.py", line 52, in get_content_stream > return cls.SESSION.content_feeder().load(content_id, VorbisOnlyAudioQuality(quality), False, None) > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 739, in load > return self.load_track(playable_id, audio_quality_picker, preload, > ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > halt_listener) > ^^^^^^^^^^^^^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 800, in load_track > return self.load_stream(file, track, None, preload, halt_listener) > ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 754, in load_stream > return CdnFeedHelper.load_track(self.__session, track, file, > ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > response, preload, halt_lister) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 339, in load_track > key = session.audio_key().get_audio_key(track.gid, file.file_id) > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 277, in get_audio_key > return self.get_audio_key(gid, file_id, False) > ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 278, in get_audio_key > raise RuntimeError( > "Failed fetching audio key! gid: {}, fileId: {}".format( > util.bytes_to_hex(gid), util.bytes_to_hex(file_id))) > RuntimeError: Failed fetching audio key! gid: 871759643c914aceb6580338abf00fcc, fileId: e3cfe60a814ee8c1f4cc9e26fb7036b7f2eb51ea > > > > [●∙∙] Fetching track information... > [∙●∙] Preparing download... > Are You Impressed?: 93%|███████████████▊ | 56.0/60.0 [02:20<00:01, 2.13songs/s] Spotify API Error (unknown): received an empty response > > ### SKIPPING: LYRICS FOR "The Maine - Loved You A Little (with Taking Back Sunday and Charlotte Sands)" (LYRICS NOT AVAILABLE) ### > [●∙∙] Converting file... > > [∙●∙] Preparing download... > Audio key error, code: 2 > Audio key error, code: 2 Taking Back Sunday and Charlotte Sands): 95%|▉| 57.0/6 > ### SKIPPING: We Are The In Crowd - The Best Thing (That Never Happened) (GENERAL DOWNLOAD ERROR) - Track_ID: 5H4nCAMT63jW86e8s81VV4 ### > Extra_Keys {"playlist_song_name": "The Best Thing (That Never Happened)", "playlist": "Bad Falling Bitches ", "playlist_num": "58", "playlist_id": "1HGpRbVDOlFvciSnkNKOgW", "playlist_track_id": "5H4nCAMT63jW86e8s81VV4"} > > Traceback (most recent call last): > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/track.py", line 291, in download_track > stream = Zotify.get_content_stream(track, Zotify.DOWNLOAD_QUALITY) > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/zotify.py", line 52, in get_content_stream > return cls.SESSION.content_feeder().load(content_id, VorbisOnlyAudioQuality(quality), False, None) > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 739, in load > return self.load_track(playable_id, audio_quality_picker, preload, > ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > halt_listener) > ^^^^^^^^^^^^^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 800, in load_track > return self.load_stream(file, track, None, preload, halt_listener) > ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 754, in load_stream > return CdnFeedHelper.load_track(self.__session, track, file, > ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > response, preload, halt_lister) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 339, in load_track > key = session.audio_key().get_audio_key(track.gid, file.file_id) > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 277, in get_audio_key > return self.get_audio_key(gid, file_id, False) > ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 278, in get_audio_key > raise RuntimeError( > "Failed fetching audio key! gid: {}, fileId: {}".format( > util.bytes_to_hex(gid), util.bytes_to_hex(file_id))) > RuntimeError: Failed fetching audio key! gid: bb1c0b1b0b8f42b19350fe2b418e06ae, fileId: 908ad202226c432f5d513fbdc072c27ec0d2b11e > > > > [∙●∙] Preparing download... > [∙∙●] Preparing download... > Audio key error, code: 2er Happened): 97%|▉| 58.0/60.0 [02:23<00:01, 1.16songs/ > ### SKIPPING: Telltale - Won't Be Me (GENERAL DOWNLOAD ERROR) - Track_ID: 7nm9EVUk20prpgX0JxvdbH ### > Extra_Keys {"playlist_song_name": "Won't Be Me", "playlist": "Bad Falling Bitches ", "playlist_num": "59", "playlist_id": "1HGpRbVDOlFvciSnkNKOgW", "playlist_track_id": "7nm9EVUk20prpgX0JxvdbH"} > > Traceback (most recent call last): > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/track.py", line 291, in download_track > stream = Zotify.get_content_stream(track, Zotify.DOWNLOAD_QUALITY) > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/zotify.py", line 52, in get_content_stream > return cls.SESSION.content_feeder().load(content_id, VorbisOnlyAudioQuality(quality), False, None) > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 739, in load > return self.load_track(playable_id, audio_quality_picker, preload, > ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > halt_listener) > ^^^^^^^^^^^^^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 800, in load_track > return self.load_stream(file, track, None, preload, halt_listener) > ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 754, in load_stream > return CdnFeedHelper.load_track(self.__session, track, file, > ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > response, preload, halt_lister) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 339, in load_track > key = session.audio_key().get_audio_key(track.gid, file.file_id) > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 277, in get_audio_key > return self.get_audio_key(gid, file_id, False) > ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 278, in get_audio_key > raise RuntimeError( > "Failed fetching audio key! gid: {}, fileId: {}".format( > util.bytes_to_hex(gid), util.bytes_to_hex(file_id))) > RuntimeError: Failed fetching audio key! gid: f2604ebc738640dbbedede0b4411af01, fileId: e61f20bc00c4c25a3c444fbe99c622e1b6175e64 > > > > [●∙∙] Preparing download... > [∙●∙] Preparing download... > Audio key error, code: 2█████████████████▌| 59.0/60.0 [02:23<00:00, 1.42songs/s] > ### SKIPPING: Hot Milk - June Gloom (GENERAL DOWNLOAD ERROR) - Track_ID: 5qtUcb6KW9O8NMETtahSXv ### > Extra_Keys {"playlist_song_name": "June Gloom", "playlist": "Bad Falling Bitches ", "playlist_num": "60", "playlist_id": "1HGpRbVDOlFvciSnkNKOgW", "playlist_track_id": "5qtUcb6KW9O8NMETtahSXv"} > > Traceback (most recent call last): > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/track.py", line 291, in download_track > stream = Zotify.get_content_stream(track, Zotify.DOWNLOAD_QUALITY) > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/zotify.py", line 52, in get_content_stream > return cls.SESSION.content_feeder().load(content_id, VorbisOnlyAudioQuality(quality), False, None) > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 739, in load > return self.load_track(playable_id, audio_quality_picker, preload, > ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > halt_listener) > ^^^^^^^^^^^^^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 800, in load_track > return self.load_stream(file, track, None, preload, halt_listener) > ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 754, in load_stream > return CdnFeedHelper.load_track(self.__session, track, file, > ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > response, preload, halt_lister) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 339, in load_track > key = session.audio_key().get_audio_key(track.gid, file.file_id) > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 277, in get_audio_key > return self.get_audio_key(gid, file_id, False) > ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^ > File "/Users/admin/.local/pipx/venvs/zotify/lib/python3.13/site-packages/librespot/audio/__init__.py", line 278, in get_audio_key > raise RuntimeError( > "Failed fetching audio key! gid: {}, fileId: {}".format( > util.bytes_to_hex(gid), util.bytes_to_hex(file_id))) > RuntimeError: Failed fetching audio key! gid: b2518ee49ce44630bf3b1b8df2889479, fileId: 1717148c58332100711bac28412dda5729d52a00 > > > > admin@MacBookPro ~ %
kerem 2026-02-27 04:57:07 +03:00
Author
Owner

@Googolplexed0 commented on GitHub (Jun 9, 2025):

So I asked to download playists 3 though 13 with a dash and it looked like this
ValueError: invalid literal for int() with base 10: '13,'

This ValueError means that there is something wrong with how you are typing the ID selections. It looks like you added an extra comma that is unnecessary. To select 3 through 13 simply enter 3-13, the commas are only necessary when choosing multiple individual options (i.e. 1, 4, 5-8, 12).

RuntimeError: Failed fetching audio key! gid: b2518ee49ce44630bf3b1b8df2889479, fileId: 1717148c58332100711bac28412dda5729d52a00

The "Failed fetching audio key!" error is known to happen, but it is not an error with the Zotify library. Sometimes Spotify will timeout requests from your computer if it receives too many in a period of time. See the README for suggested countermeasures.

And hey! This is farther than I got last time! I'm encouraged! :D

Glad you are not becoming frustrated and giving up. Everyone is a beginner at some point and you are learning, so keep at it! Also, I've pushed out a few major updates (now v0.7.10) that might help give you some clearer error messages in the future, so consider updating.

<!-- gh-comment-id:2955699716 --> @Googolplexed0 commented on GitHub (Jun 9, 2025): > So I asked to download playists 3 though 13 with a dash and it looked like this > `ValueError: invalid literal for int() with base 10: '13,'` This ValueError means that there is something wrong with how you are typing the ID selections. It looks like you added an extra comma that is unnecessary. To select 3 through 13 simply enter `3-13`, the commas are only necessary when choosing multiple individual options (i.e. `1, 4, 5-8, 12`). > RuntimeError: Failed fetching audio key! gid: b2518ee49ce44630bf3b1b8df2889479, fileId: 1717148c58332100711bac28412dda5729d52a00 The "Failed fetching audio key!" error is known to happen, but it is not an error with the Zotify library. Sometimes Spotify will timeout requests from your computer if it receives too many in a period of time. See the [README](https://github.com/Googolplexed0/zotify?tab=readme-ov-file#what-do-i-do-if-i-see-repeated-failed-fetching-audio-key-errors) for suggested countermeasures. > And hey! This is farther than I got last time! I'm encouraged! :D Glad you are not becoming frustrated and giving up. Everyone is a beginner at some point and you are learning, so keep at it! Also, I've pushed out a few major updates (now v0.7.10) that might help give you some clearer error messages in the future, so consider updating.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/zotify#18
No description provided.