Skip to content

[BUG] RuntimeError: Cannot get alternative track #318

Description

@AleTopp

Describe the bug
RuntimeError from "load_track" in "audio/init.py". Got it using deezspot, and retried directly in librespot-python with same code as #315 (original issue: jakiepari/deezspot#8).

To Reproduce

>>> from librespot.core import Session
>>> session = Session.Builder().stored_file("./credentials.json").create()
>>> from librespot.metadata import TrackId
>>> track_id = TrackId.from_uri("spotify:track:07qo9gnLM488CUr0EtgIA1")
>>> from librespot.audio.decoders import AudioQuality, VorbisOnlyAudioQuality
>>> stream = session.content_feeder().load(track_id, VorbisOnlyAudioQuality(AudioQuality.NORMAL), False, None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/path/venv/lib/python3.12/site-packages/librespot/audio/__init__.py", line 722, in load
    return self.load_track(playable_id, audio_quality_picker, preload,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/venv/lib/python3.12/site-packages/librespot/audio/__init__.py", line 774, in load_track
    raise RuntimeError("Cannot get alternative track")
RuntimeError: Cannot get alternative track

Expected behavior
I did not expect an exception

Client Information (please complete the following information):

  • OS: Ubuntu (WSL)
  • Python Version 3.12.3
  • Library Version 0.0.9

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions