mirror of
https://github.com/aome510/spotify-player.git
synced 2026-04-26 01:15:55 +03:00
[GH-ISSUE #665] Local music support #1323
Labels
No labels
bug
documentation
enhancement
good first issue
help wanted
pull-request
question
third-party
third-party
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotify-player#1323
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ManiProjs on GitHub (Jan 16, 2025).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/665
Is your feature already implemented in the latest
master?Please go through the Features README page to make sure your request feature hasn't been implemented.
Is your feature request related to a problem? Please describe.
No, it isn't.
Describe the solution you'd like
Much appreciated if you (or your contributors) add support to local music. I know that's not wise (because it named
spotify_playernotlocal_playeror something else), but it would be fun to play local music.Describe alternatives you've considered

I used
termusic. It is good, but not as perfect as this project. I don't like its UI. I thinkspotify_playeris more interesting for meAdditional context
It would be good to add local music (I don't have anything else to say😁)
@variegatedcat commented on GitHub (Feb 13, 2025):
i would like to see this implemented as well
@mantacid commented on GitHub (May 10, 2025):
Same here. Some of the artists I follow don't upload to spotify, so I instead have their music downloaded, and played through spotify locally. It would be nice to do that with this program as well!
@ManiProjs commented on GitHub (May 13, 2025):
Well, you can use
termusic.I am using it. But I like the
spotify_player's UI more.I am mentioning @aome510 because it may cause him/her to see the issue (The software is provided "as is", it means I cannot sue him/her because for not implementing the feature)
I will open a PR soon
@aome510 commented on GitHub (May 13, 2025):
Thanks for raising. Somewhat related to #62. I don't have any plan to implement local music or offline feature cause I don't really need one.
That said, feel free to implement one and open a PR. PRs are welcomed and highly appreciated!
@SapiensAnatis commented on GitHub (Aug 2, 2025):
I have been looking at this a little bit, though I can't make any promises... It seems like the issue is that we pass the list of tracks returned by the Spotify API into
filter_map(try_from_playlist_item)which callstry_from_full_track_with_date, which itself returnsNoneany track that has noidset:github.com/aome510/spotify-player@a445674b6f/spotify_player/src/state/model.rs (L385)Local files may not have an
idaccording torspotify_model.My initial thoughts are that we need to map these differently with enough information so that they can be played via some alternative mechanism. I've not studied the API closely enough yet to know what that is.
@SapiensAnatis commented on GitHub (Aug 10, 2025):
It is easy enough to display local files and send a request to play these to
librespot(although I have done some hacks which will need cleaning up). However,librespotdoesn't currently support local playback, so that will need to be implemented first. See: https://github.com/librespot-org/librespot/discussions/1525@ManiProjs commented on GitHub (Aug 17, 2025):
Or we can use another library, such as
rodiojust for playing local files, and adding local file support as an optional feature. Which it can be enabled or disabled by default.Then we can add a parameter to the app’s settings, which can be enabled with
—l/—-localand settings file.@KUHLwasStolen commented on GitHub (Aug 19, 2025):
Just noticed that this issue is still active and I thought I might chime in here.
I've done pretty much exactly this here https://github.com/KUHLwasStolen/spotify-player/tree/local-playback ...
... however, making it an optional feature looks pretty hard to me (at least with the approach that I took) as I had to make some major changes to
spotify_player. (Not saying it's impossible, but a ton of#[cfg(feature = "local")]would be required haha)That said, feel free to check out my fork and leave feedback.
Currently all the basic local player functionality works and I also enabled the app to start without Internet connection or login (otherwise local playback wouldn't really make sense if it still depends on Spotify/Internet anyway).
Currently supported formats are
mp3andflac, but after some more testing I can extend the support to all the usual audio formats.Next up on my to-do list is implementing shuffle and repeat functionality.
Edit: the local player is accessible by default via pressing
g o("go offline") and it will start in the directory specified in thelocal_library_rootconfig option.@SapiensAnatis commented on GitHub (Aug 19, 2025):
Yes, I didn't consider the possibility that you could just extend the app with local audio capability directly. Nice work!
Does your player allow playing local files that are in an existing Spotify playlist? That to me would be the main advantage of doing this via Spotify.
I also want to say that I am looking into adding local files support into librespot but it looks like it could be a long road with lots of changes to the library. I have however made an initial PR to lay the groundwork with some refactoring in how the app handles URIs.
@SapiensAnatis commented on GitHub (Aug 19, 2025):
That said, maybe I misunderstood the issue a little bit - perhaps the original poster was actually talking about a separate local player (as you have made) and https://github.com/aome510/spotify-player/issues/333 is more about Spotify local files specifically (which is what I am focusing on)
@KUHLwasStolen commented on GitHub (Aug 20, 2025):
No, my player works completely independent from Spotify, at the moment. I'm not quite sure how I would handle this tbh in the event of a device switch, because music files may be local to only one device. Or how does the official app handle this?
I think I'll also ask for more details in #333, as I'm now a bit confused myself haha
@SapiensAnatis commented on GitHub (Aug 20, 2025):
Any tracks it can't find on the same device it shows as greyed out and refuses to play them with an error pop up if you try.
@charliefrance commented on GitHub (Aug 20, 2025):
This is the only thing stopping me from switching from official client! I have many songs from bandcamp downloaded as mp3s which are integrated into my spotify client, and since I have the files on my phone and PC it is very convenient and they work just like normal spotify songs.
@ManiProjs commented on GitHub (Sep 18, 2025):
Hello, I opened a PR (#833) now.
I currently just added a member called
local_playerand that member prints a message. Contributions are welcome.