[GH-ISSUE #125] [BUG]AudioQuality Error #14

Closed
opened 2026-02-27 08:11:26 +03:00 by kerem · 6 comments
Owner

Originally created by @Pranavprana on GitHub (Apr 26, 2022).
Original GitHub issue: https://github.com/kokarare1212/librespot-python/issues/125

File "C:\Python39\lib\enum.py", line 352, in getattr
raise AttributeError(name) from None
AttributeError: AudioQuality

Originally created by @Pranavprana on GitHub (Apr 26, 2022). Original GitHub issue: https://github.com/kokarare1212/librespot-python/issues/125 File "C:\Python39\lib\enum.py", line 352, in __getattr__ raise AttributeError(name) from None AttributeError: AudioQuality
kerem 2026-02-27 08:11:26 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@kokarare1212 commented on GitHub (Apr 26, 2022):

Please provide the code that reproduces the problem.

<!-- gh-comment-id:1110337579 --> @kokarare1212 commented on GitHub (Apr 26, 2022): Please provide the code that reproduces the problem.
Author
Owner

@Pranavprana commented on GitHub (Apr 27, 2022):

from librespot.core import Session

from librespot.metadata import TrackId
from librespot.audio.decoders import AudioQuality, VorbisOnlyAudioQuality

session = Session.Builder()
.user_pass("Username", "Password")
.create()

track_id = TrackId.from_uri("spotify:track:xxxxxxxxxxxxxxxxxxxxxx")
stream = session.content_feeder().load(track_id, VorbisOnlyAudioQuality(AudioQuality.VERY_HIGH), False, None)
stream.input_stream.stream().read()
##############################################################
stream = session.content_feeder().load(track_id, VorbisOnlyAudioQuality(AudioQuality.VERY_HIGH), False, None)
File "C:\Python39\lib\site-packages\librespot\audio_init_.py", line 717, in load
return self.load_track(playable_id, audio_quality_picker, preload,
File "C:\Python39\lib\site-packages\librespot\audio_init_.py", line 778, in load_track
return self.load_stream(file, track, None, preload, halt_listener)
File "C:\Python39\lib\site-packages\librespot\audio_init_.py", line 732, in load_stream
return CdnFeedHelper.load_track(self.session, track, file,
File "C:\Python39\lib\site-packages\librespot\audio_init
.py", line 335, in load_track
key = session.audio_key().get_audio_key(track.gid, file.file_id)
File "C:\Python39\lib\site-packages\librespot\audio_init
.py", line 277, in get_audio_key
return self.get_audio_key(gid, file_id, False)
File "C:\Python39\lib\site-packages\librespot\audio_init_.py", line 278, in get_audio_key
raise RuntimeError(
RuntimeError: Failed fetching audio key! gid: c2de18c6ab584f27bfbd42893dd7d7ca, fileId: 059df821cead0cde67b1e88a47ae87d05b6b5c3c

<!-- gh-comment-id:1111158854 --> @Pranavprana commented on GitHub (Apr 27, 2022): from librespot.core import Session from librespot.metadata import TrackId from librespot.audio.decoders import AudioQuality, VorbisOnlyAudioQuality session = Session.Builder() \ .user_pass("Username", "Password") \ .create() track_id = TrackId.from_uri("spotify:track:xxxxxxxxxxxxxxxxxxxxxx") stream = session.content_feeder().load(track_id, VorbisOnlyAudioQuality(AudioQuality.VERY_HIGH), False, None) stream.input_stream.stream().read() ############################################################## stream = session.content_feeder().load(track_id, VorbisOnlyAudioQuality(AudioQuality.VERY_HIGH), False, None) File "C:\Python39\lib\site-packages\librespot\audio\__init__.py", line 717, in load return self.load_track(playable_id, audio_quality_picker, preload, File "C:\Python39\lib\site-packages\librespot\audio\__init__.py", line 778, in load_track return self.load_stream(file, track, None, preload, halt_listener) File "C:\Python39\lib\site-packages\librespot\audio\__init__.py", line 732, in load_stream return CdnFeedHelper.load_track(self.__session, track, file, File "C:\Python39\lib\site-packages\librespot\audio\__init__.py", line 335, in load_track key = session.audio_key().get_audio_key(track.gid, file.file_id) File "C:\Python39\lib\site-packages\librespot\audio\__init__.py", line 277, in get_audio_key return self.get_audio_key(gid, file_id, False) File "C:\Python39\lib\site-packages\librespot\audio\__init__.py", line 278, in get_audio_key raise RuntimeError( RuntimeError: Failed fetching audio key! gid: c2de18c6ab584f27bfbd42893dd7d7ca, fileId: 059df821cead0cde67b1e88a47ae87d05b6b5c3c
Author
Owner

@kokarare1212 commented on GitHub (Apr 27, 2022):

You used an unsupported codec or
You may have used VERY_HIGH by logging in with a non-Premium account.

<!-- gh-comment-id:1111511651 --> @kokarare1212 commented on GitHub (Apr 27, 2022): You used an unsupported codec or You may have used VERY_HIGH by logging in with a non-Premium account.
Author
Owner

@Pranavprana commented on GitHub (Apr 27, 2022):

i did normal no error
but can u guide me on what should I use to get music played from it
running this code just complete without any error

<!-- gh-comment-id:1111517276 --> @Pranavprana commented on GitHub (Apr 27, 2022): i did normal no error but can u guide me on what should I use to get music played from it running this code just complete without any error
Author
Owner

@kokarare1212 commented on GitHub (Apr 27, 2022):

Music can be played by using external applications.
e.g. FFplay * not tested

import subprocess

proc = subprocess.Popen(["/path/to/ffplay", "-"], stdin=subprocess.PIPE)
proc.communicate(input=stream.input_stream.stream().read())
<!-- gh-comment-id:1111522857 --> @kokarare1212 commented on GitHub (Apr 27, 2022): Music can be played by using external applications. e.g. FFplay * not tested ```python import subprocess proc = subprocess.Popen(["/path/to/ffplay", "-"], stdin=subprocess.PIPE) proc.communicate(input=stream.input_stream.stream().read()) ```
Author
Owner

@Pranavprana commented on GitHub (Apr 27, 2022):

thankyou!

<!-- gh-comment-id:1111524195 --> @Pranavprana commented on GitHub (Apr 27, 2022): thankyou!
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/librespot-python-kokarare1212#14
No description provided.