[GH-ISSUE #887] Open spotify player by URI / URL #1470

Open
opened 2026-03-14 15:04:28 +03:00 by kerem · 6 comments
Owner

Originally created by @sand4rt on GitHub (Dec 17, 2025).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/887

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.

no

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

It would be nice if i could open a Spotify track directly in a new or existing Spotify player instance when clicking a spotify: URI (e.g., spotify:track:6rqhFgbbKwnb9MLmUQDhG6) or a link (e.g., http://open.spotify.com/track/6rqhFgbbKwnb9MLmUQDhG6).

Describe the solution you'd like
A clear and concise description of what you want to happen.

Not sure about the solution but, maybe with a new command like spotify_player open {URI/URL} that opens the track in spotify player? This could allow users to configure a .desktop entry with:

xdg-mime default spotify.desktop x-scheme-handler/spotify

Maybe this functionality could be built directly into the Spotify client, so URI and URL's open automatically in a exsisting or new spotify player instance?

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

None

Additional context
Add any other context or screenshots about the feature request here.

https://developer.spotify.com/documentation/web-api/concepts/spotify-uris-ids

Originally created by @sand4rt on GitHub (Dec 17, 2025). Original GitHub issue: https://github.com/aome510/spotify-player/issues/887 **Is your feature already implemented in the latest `master`?** Please go through the [Features README page](https://github.com/aome510/spotify-player?tab=readme-ov-file#features) to make sure your request feature hasn't been implemented. no **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] It would be nice if i could open a Spotify track directly in a new or existing Spotify player instance when clicking a `spotify:` URI (e.g., `spotify:track:6rqhFgbbKwnb9MLmUQDhG6`) or a link (e.g., `http://open.spotify.com/track/6rqhFgbbKwnb9MLmUQDhG6`). **Describe the solution you'd like** A clear and concise description of what you want to happen. Not sure about the solution but, maybe with a new command like `spotify_player open {URI/URL}` that opens the track in spotify player? This could allow users to configure a `.desktop` entry with: ```bash xdg-mime default spotify.desktop x-scheme-handler/spotify ``` Maybe this functionality could be built directly into the Spotify client, so URI and URL's open automatically in a exsisting or new spotify player instance? **Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered. None **Additional context** Add any other context or screenshots about the feature request here. https://developer.spotify.com/documentation/web-api/concepts/spotify-uris-ids
Author
Owner

@RossSmyth commented on GitHub (Dec 29, 2025):

Would be relatively easy to add, just need to add a *.desktop file that adds something similar to MimeType=x-scheme-handler/spotify;

<!-- gh-comment-id:3695279007 --> @RossSmyth commented on GitHub (Dec 29, 2025): Would be relatively easy to add, just need to add a `*.desktop` file that adds something similar to `MimeType=x-scheme-handler/spotify;`
Author
Owner

@greqor commented on GitHub (Feb 12, 2026):

I have implemented this feature and opened a PR.
It adds a spotify_player open <URI_OR_URL> command that accepts both Spotify URIs and web URLs.

This also makes it simple to set up a .desktop handler for spotify: URIs:

[Desktop Entry]
Type=Application
Name=spotify-player
Exec=spotify_player open %u
MimeType=x-scheme-handler/spotify;
xdg-mime default spotify-player.desktop x-scheme-handler/spotify

Feedback welcome.

<!-- gh-comment-id:3892100987 --> @greqor commented on GitHub (Feb 12, 2026): I have implemented this feature and opened a PR. It adds a spotify_player open <URI_OR_URL> command that accepts both Spotify URIs and web URLs. This also makes it simple to set up a .desktop handler for spotify: URIs: ```ini [Desktop Entry] Type=Application Name=spotify-player Exec=spotify_player open %u MimeType=x-scheme-handler/spotify; ``` ```sh xdg-mime default spotify-player.desktop x-scheme-handler/spotify ``` Feedback welcome.
Author
Owner

@sand4rt commented on GitHub (Feb 12, 2026):

Nice @greqor! Does it open the URL in an existing instance, or does it always launch a new one?

<!-- gh-comment-id:3893840257 --> @sand4rt commented on GitHub (Feb 12, 2026): Nice @greqor! Does it open the URL in an existing instance, or does it always launch a new one?
Author
Owner

@greqor commented on GitHub (Feb 13, 2026):

It works the same way as the playback command. If an instance is already running, it uses that one. Otherwise it launches a temporary one to handle the request to Spotify's API and exits.

<!-- gh-comment-id:3894236499 --> @greqor commented on GitHub (Feb 13, 2026): It works the same way as the `playback` command. If an instance is already running, it uses that one. Otherwise it launches a temporary one to handle the request to Spotify's API and exits.
Author
Owner

@greqor commented on GitHub (Feb 13, 2026):

After thinking about it, since my current implementation is only controlling the playback, it might make sense to make it a subcommand of playback command.

For example:

spotify_player playback open spotify:track:6rqhFgbbKwnb9MLmUQDhG6

It never spawns a new instance of TUI interface, but only starts playing a track on connected device (it might be currently opened TUI interface or other spotify client as well, like spotify app on the phone).

To satisfy the original use case, we can add a new command open which will spawn a new instance of TUI interface and start playing the track, or use existing TUI instance if it's already running. If there is another spotify client connected (like spotify app on the phone), it would stop playing it there and start new playback in TUI interface.

# Starts to play a song in currently connected device. No new TUI interface is spawned.
spotify_player playback open spotify:track:6rqhFgbbKwnb9MLmUQDhG6

# Spawns a new TUI interface (or use existing TUI instance if it's already running) and starts to play a song in it.
spotify_player open spotify:track:6rqhFgbbKwnb9MLmUQDhG6

Let me know please if that makes sense.

<!-- gh-comment-id:3895948543 --> @greqor commented on GitHub (Feb 13, 2026): After thinking about it, since my current implementation is only controlling the playback, it might make sense to make it a subcommand of `playback` command. For example: ```bash spotify_player playback open spotify:track:6rqhFgbbKwnb9MLmUQDhG6 ``` It never spawns a new instance of TUI interface, but only starts playing a track on connected device (it might be currently opened TUI interface or other spotify client as well, like spotify app on the phone). To satisfy the original use case, we can add a new command `open` which will spawn a new instance of TUI interface and start playing the track, or use existing TUI instance if it's already running. If there is another spotify client connected (like spotify app on the phone), it would stop playing it there and start new playback in TUI interface. ```bash # Starts to play a song in currently connected device. No new TUI interface is spawned. spotify_player playback open spotify:track:6rqhFgbbKwnb9MLmUQDhG6 # Spawns a new TUI interface (or use existing TUI instance if it's already running) and starts to play a song in it. spotify_player open spotify:track:6rqhFgbbKwnb9MLmUQDhG6 ``` Let me know please if that makes sense.
Author
Owner

@sand4rt commented on GitHub (Feb 13, 2026):

Personally, i’d would only use the open command. I often want to preview a track someone sent me via a link before i start playing it.

<!-- gh-comment-id:3896629944 --> @sand4rt commented on GitHub (Feb 13, 2026): Personally, i’d would only use the open command. I often want to preview a track someone sent me via a link before i start playing it.
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/spotify-player#1470
No description provided.