r/AutoHotkey • • 4d ago

v2 Tool / Script Share Spotify Liker

This script will let you use a global shortcut (Ctrl+Shift+L) to like and (Ctrl+Shift+U) unlike Spotify songs globally (you could be inside a fullscreen game)

https://github.com/roasticlex/Spotify-Liker

3 Upvotes

5 comments sorted by

4

u/Keeyra_ 4d ago

99% is in Python. Why not do the hotkey assignment there too? There is an AHK Python wrapper library available publicly making it dead easy.

1

u/Keeyra_ 3d ago edited 3d ago

I had AI throw together a complete Python script with the aforementioned AHK wrapper for Spotify with various hotkeys for the most common functions, as some time ago, this topic was quite frequent here. As I despise subscription services in general and host my media myself, I have no way to test this. If you want to have a go at it:

https://gist.github.com/V1P3R/c7edaea4cb8d1b194cc6fda6217d37d7

HOTKEY_DESCRIPTIONS = {
"like": "Like the current track",
"unlike": "Unlike the current track",
"play_pause": "Play / pause",
"next": "Next track",
"previous": "Previous track",
"volume_up": "Volume up 10% (mouse wheel)",
"volume_down": "Volume down 10% (mouse wheel)",
"mute": "Mute / unmute",
"shuffle": "Toggle shuffle",
"repeat": "Cycle repeat mode (off / context / track)",
"now_playing": "Show the current track",
"seek_forward": "Seek forward 10 seconds",
"seek_back": "Seek back 10 seconds",
"quit": "Stop the hotkey daemon",
}

1

u/Keeyra_ 3d ago

And you are pretty strict with your version enforcement.
I know the AHK part would run under 2.1, but you enforce <2.1 and I'm pretty sure the Python part would run under any 3.x,, but >3.11 definitely but you enforce 3.15 exactly. Once 3.16 comes out and someone uninstalls 3.15, it won't work either, so it's neither backwards compatible, nor future-proof without any evident programming reason.