[GH-ISSUE #1316] AudioFiles not available for some tracks #598

Closed
opened 2026-02-27 19:31:30 +03:00 by kerem · 5 comments
Owner

Originally created by @x528491x on GitHub (Aug 28, 2024).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/1316

Steps to reproduce the behavior:

Use the track 4LRPiXqCikLlN15c3yImP7 as input

// spotify:track:4LRPiXqCikLlN15c3yImP7

let x = AudioItem::get_file(&session, track_id).await.unwrap().files;
println!("{:?}", x);

// AudioFiles({})
Originally created by @x528491x on GitHub (Aug 28, 2024). Original GitHub issue: https://github.com/librespot-org/librespot/issues/1316 Steps to reproduce the behavior: Use the track 4LRPiXqCikLlN15c3yImP7 as input ``` // spotify:track:4LRPiXqCikLlN15c3yImP7 let x = AudioItem::get_file(&session, track_id).await.unwrap().files; println!("{:?}", x); // AudioFiles({}) ```
kerem 2026-02-27 19:31:30 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@x528491x commented on GitHub (Aug 28, 2024):

The audiofiles are available for the alternative track listed in the response.

Is this a general thing for Spotify - having to query alternative tracks?

It must also be noted that when the alternative track is queried, it does not list the original queried track as an alternative.

So what must be done in case Spotify had not grouped alternative tracks? How does one get the audiofiles then?

<!-- gh-comment-id:2314640546 --> @x528491x commented on GitHub (Aug 28, 2024): The audiofiles are available for the alternative track listed in the response. Is this a general thing for Spotify - having to query alternative tracks? It must also be noted that when the alternative track is queried, it does not list the original queried track as an alternative. So what must be done in case Spotify had not grouped alternative tracks? How does one get the audiofiles then?
Author
Owner

@kingosticks commented on GitHub (Aug 28, 2024):

They will always provide alternate tracks if required. Why would you need a way to access the "original" track that you can't play?

Have you read https://developer.spotify.com/documentation/web-api/concepts/track-relinking ?

The general Spotify principles explained in their officla docs are often relevant to working with librespot.

<!-- gh-comment-id:2314706263 --> @kingosticks commented on GitHub (Aug 28, 2024): They will always provide alternate tracks if required. Why would you need a way to access the "original" track that you can't play? Have you read https://developer.spotify.com/documentation/web-api/concepts/track-relinking ? The general Spotify principles explained in their officla docs are often relevant to working with librespot.
Author
Owner

@x528491x commented on GitHub (Aug 28, 2024):

I'll close this issue, but "always provide alternative tracks if required".

Does that mean that if the track is found to be playable, the alternative track would automatically be empty,

Or does the developer need to check if the track is unplayable and then loop over the alternative tracks listed if any.

<!-- gh-comment-id:2314910811 --> @x528491x commented on GitHub (Aug 28, 2024): I'll close this issue, but "always provide alternative tracks if required". Does that mean that if the track is found to be playable, the alternative track would automatically be empty, Or does the developer need to check if the track is unplayable and then loop over the alternative tracks listed if any.
Author
Owner

@kingosticks commented on GitHub (Aug 28, 2024):

Does that mean that if the track is found to be playable, the alternative track would automatically be empty,

I don't remember. But I recall they provide some field to describe the availability.

Look how this is done at github.com/librespot-org/librespot@2ea7436e60/playback/src/player.rs (L881) ?

<!-- gh-comment-id:2315118946 --> @kingosticks commented on GitHub (Aug 28, 2024): > Does that mean that if the track is found to be playable, the alternative track would automatically be empty, I don't remember. But I recall they provide some field to describe the availability. Look how this is done at https://github.com/librespot-org/librespot/blob/2ea7436e60750d56e747abfca3893be39c0162fd/playback/src/player.rs#L881 ?
Author
Owner

@x528491x commented on GitHub (Aug 28, 2024):

Does that mean that if the track is found to be playable, the alternative track would automatically be empty,

I don't remember. But I recall they provide some field to describe the availability.

Look how this is done at github.com/librespot-org/librespot@2ea7436e60/playback/src/player.rs (L881) ?

Thanks. That helped. Closing now.

<!-- gh-comment-id:2315418645 --> @x528491x commented on GitHub (Aug 28, 2024): > > Does that mean that if the track is found to be playable, the alternative track would automatically be empty, > > I don't remember. But I recall they provide some field to describe the availability. > > Look how this is done at https://github.com/librespot-org/librespot/blob/2ea7436e60750d56e747abfca3893be39c0162fd/playback/src/player.rs#L881 ? Thanks. That helped. Closing now.
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#598
No description provided.