xou816 / spot

Native Spotify client for the GNOME desktop
MIT License
2.3k stars 125 forks source link

[Feature Request] Support the Spotify URI scheme #326

Open bbb651 opened 3 years ago

bbb651 commented 3 years ago

I think it'll be useful to implement the Spotify URI scheme, it's used on the web player and in discord embeds, and it can be inconvenient to manually look for the song on Spot.

The only crate I found that can register a URI handler is system_uri which is archived and not maintained anymore, I forked it and updated it's dependencies, I'll try publishing it to crates.io, alternatively we can just do it manually in Spot because we don't have to worry about other platforms, we just need to make a desktop file in ~/.local/share/applications/ with the proper information.

According to wikipedia, this is how the Spotify URI scheme is used

spotify:<artist|album|track>:<id> or spotify:search:<text> or spotify:user:<username>:playlist:<id>

example: spotify:track:2jCnn1QPQ3E8ExtLe6INsx

xou816 commented 3 years ago

Hi! This is indeed something that would be very handy :) I guess we only need to handle the http(s) scheme (users are unlikely to encounter a Spotify URI in the wild)

bbb651 commented 3 years ago

I've only seen the URI used (in the web player if you right click and select open in desktop app, it redirects you to a spotify:... link), afaik the offical client doesn't handle http(s).

I'll try working on this, I'm still learning GTK and I'm still not super comfortable in Rust so I'll see how far I can get.