mirror of
https://github.com/aome510/spotify-player.git
synced 2026-04-26 09:25:49 +03:00
[GH-ISSUE #537] FR: Store client_id outside dotfiles #307
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#307
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 @chrisgrieser on GitHub (Aug 8, 2024).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/537
Is your feature request related to a problem? Please describe.
I do version control and publish my
.configdirectory in a GitHub repo, as quite a lot of people do. Thus, Due to the inclusion of theclient_id, this results in having to gitignore the~/.config/spotify_player/app.toml, as otherwise the id would be leaked.Describe the solution you'd like
Save
client_idoutside theapp.toml, so the remainder of the spotify-player-config can be stored in a public git repo without any trouble.The client_id could then be read from an environment variable, which one could save in
.zshenv.Alternatively, support something like the
password_cmdfromspotifyd: https://docs.spotifyd.rs/config/File.htmlDescribe alternatives you've considered
app.tomland manually updating it all the time.app.tomlinto a private cloud storage.@masroof-maindak commented on GitHub (Aug 10, 2024):
@aome510 Hi, could you please assign this to me? I've never programmed in Rust before so I'd like to start simple and give this a shot.
@juliamertz commented on GitHub (Aug 10, 2024):
@masroof-maindak I have already started work on this, though i can't test it out right now since authentication with spotify is broken. You can check it out here
Edit:
Authentication is working again for me, tested it on Linux and everything works fine. Only need someone on windows to confirm this is working for them as well.
@masroof-maindak commented on GitHub (Aug 10, 2024):
Oh well, bummer. Thank you for your contribution regardless.
@chrisgrieser commented on GitHub (Jan 3, 2025):
@juliamertz Sorry, I am just testing this now, since the authentication was previously broken.
I tried
client_id_command = 'cat "/path/to/file"'(with the file containing nothing but the client_id) and it is unfortunately not working for me.cat "/path/to/file"does output the correct client_id, and settingclient_id = "..."also does work fine. I also triedclient_id_command = 'cat "/path/to/file"' | tr -d "\n"just in case, but that also does not work.I am on macOS 14.5 (i386), with spotify_player 0.20.4.
@juliamertz commented on GitHub (Jan 4, 2025):
@chrisgrieser Looks like your config isn't quite right, can you try putting this in your app.toml?
@chrisgrieser commented on GitHub (Jan 4, 2025):
@juliamertz that is also not working for me.
btw, the docs on config options do not mention that
client_id_commandneeds sub-keys, so there is no way to know that from a user perspective.@juliamertz commented on GitHub (Jan 4, 2025):
@chrisgrieser That's weird, i'm using the exact same option and it's working fine for me.
Can you check the logs in
~/.cache/spotify-player/*.logand verify your configuration is being parsed correctly?Also there's a bit on using commands here, though i agree this is a bit unclear
@masroof-maindak commented on GitHub (Jan 4, 2025):
@juliamertz same issue.
When I include the following line in config:
My app refuses to launch, and this is what I get: https://pastebin.com/Epz0mfxa
Comment it out and it works just fine.
Doesn't prevent my spotify_player from launching, but it also doesn't work either.
@juliamertz commented on GitHub (Jan 4, 2025):
This won't actually parse so it'd be treated as a None value and default to
client_idI just tried it out with your setup and it looks like you need to specify the full path to the file.
Using
~in place of/home/useralso results in a panic for me@masroof-maindak commented on GitHub (Jan 4, 2025):
Okay, so it boots fine now, and allows me to detect music from my phone, but no longer lists my machine as a 'device' so I can't play music on my own or switch from my phone to my machine.
This goes away once I comment out the
client_id_command line.D in either case does not list my machine as a device.
@chrisgrieser commented on GitHub (Jan 5, 2025):
@juliamertz I just experimented at bit, and it appears the issue is the trailing newline:
Since shell commands commonly add a newline to their output, this should be dealt with by
spotify_player, imho.@reorx commented on GitHub (Jul 10, 2025):
Is it possible to get client id from existing environment variables? I tried the following but it does not work:
@wawwior commented on GitHub (Oct 8, 2025):
This is still the case.