mirror of
https://github.com/aome510/spotify-player.git
synced 2026-04-26 09:25:49 +03:00
[GH-ISSUE #190] Player hooks with data arguments #1034
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#1034
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 @sewnie on GitHub (May 5, 2023).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/190
Is your feature request related to a problem? Please describe.
Recently, I have stopped using spotify-player simply because libreapot does not has support for external connections such as last.fm, and can not do notifications without Dbus.
Describe the solution you'd like
A hook system that launches a program with arguments set in the configuration for events such as pre, post, during (second interval) for sub-events for playing, pausing, skipping, etc..
I can use these to pass to notification or lastfm scrobller clients.
Describe alternatives you've considered
Using librespot or spotifyd directly, I believe librespot has direct support for this feature, so I don't think it would be trivial to implement it here.
@sewnie commented on GitHub (Jul 21, 2023):
@aome510 i would like to hear from this.
i am tired of the propietary spotify client.
@aome510 commented on GitHub (Jul 21, 2023):
I've been quite busy lately, so I won't be able to implement this soon. However, will put this up in my TODO list and see look into ways to integrate the last.fm APIs, if any.
@sewnie commented on GitHub (Jul 21, 2023):
well, this feature request is for hooks, which is alot simpler than implementing the last.fm API, since that can be handled by another program making the stack simpler.
@aome510 commented on GitHub (Aug 26, 2023):
Plan to implement this next week or so. Does writing player events in a cache file work? You can write a script to watch for changes in that file every second or so, and port that to last.fm client. Lmk if I need to include any fields other than the event data (I plan to include the timestamp).
@sewnie commented on GitHub (Aug 26, 2023):
honestly been using the propietary spotify client for a long while now, i'd much rather have librespot itself actually supporting this shit rather than me having to send last.fm api requests constantly
@aome510 commented on GitHub (Aug 26, 2023):
Just saw this issue: https://github.com/jpochyla/psst/issues/424. Look like
lastfmscrobbling is supported via Spotify connect, so it should work by default withspotify_player. I just double check on last.fm website and it shows all the scrobbles when I usespotify_player. Can you confirm? If that's the case, I'll close this issue.@sewnie commented on GitHub (Aug 26, 2023):
Wow, okay!!!! I'll check tommorow!!
I will be very happy if this is true.
@sewnie commented on GitHub (Aug 27, 2023):
SEEMS TO WORK!!
although, spotify cant quite see what i'm playing, so that spotify yearly thing wont quite work
@sewnie commented on GitHub (Aug 27, 2023):
thank u
@aome510 commented on GitHub (Aug 27, 2023):
Related https://github.com/librespot-org/librespot/issues/913. That's one thing I miss from the official app and wish that
librespotfigure out ways to reverse-engineer the feature.@sewnie commented on GitHub (Aug 27, 2023):
It is a bit infuriating to be honest, considering its been a problem for 4 years and no one had stepped up and reversed engineered it :(@sewnie commented on GitHub (Aug 31, 2023):
Wait, this issue still remains.
@sewnie commented on GitHub (Aug 31, 2023):
I do want to have some form of player hooks to be honest; my use case being to avoid constant D-Bus requests.
@aome510 commented on GitHub (Sep 2, 2023):
Does writing player events into a file work? I'm not too familiar with the player hook concept and how to implement one.
@sewnie commented on GitHub (Sep 3, 2023):
Player hooks is to launch a program with certain metadata (such as song, album, title) as arguments, on certain events (such as play, new song, pause, etc)
@aome510 commented on GitHub (Sep 3, 2023):
Implemented in #244. Refer to https://github.com/aome510/spotify-player/blob/add-player-hook/docs/config.md#player-event-hook-command for how to use the command.
@sewnie commented on GitHub (Sep 4, 2023):
why json? :(
@aome510 commented on GitHub (Sep 4, 2023):
for consistency with CLI commands' output and because the app already supports exporting Spotify data in JSON format.
@sewnie commented on GitHub (Sep 4, 2023):
Why not ususe JSON for big Spotify data? For example for simple data it should simply be it in plain text, and the arguments to be passed as the arguments themselves:
script "Playing" "Artist" "Album" "Song", this ensures that scripting is very easy. I'd appreciate it if you did this as this is what I had expected..@sewnie commented on GitHub (Sep 7, 2023):
I can't use this feature; setting
player_event_hook_commandto a valid binary path gives:player_event_hook_command: None.@aome510 commented on GitHub (Sep 7, 2023):
Please refer to the linked document to use a correct format. It should be
player_event_hook_command = { command = "spotify_player-hook", args = [] }Regarding why JSON but not plain text with arguments,
spotify_playerside is not. As a result, the passing data logic should be simple (e.g passing the event as a single input).@sewnie commented on GitHub (Sep 7, 2023):
I hightly suggest to you to please use a arguement system, as it makes my life and others much easier when scripting for spotify-player.
@aome510 commented on GitHub (Sep 7, 2023):
Ok, I'll think about it.
@aome510 commented on GitHub (Sep 7, 2023):
Just a note that with the arguments approach, new user will be confused between the arguments, e.g is it
Changed old_track_id new_track_idorChanged new_track_id old_track_id? Then they are required to actually read the document, which many don't usually.@sewnie commented on GitHub (Sep 7, 2023):
Well? They need to read the docs to understand what the hooks do, their arguments and commands to begin with.
@aome510 commented on GitHub (Sep 10, 2023):
Should be updated with https://github.com/aome510/spotify-player/pull/251.