ethanndickson / iina-lastfm

mpv script to scrobble songs played through iina to last.fm
MIT License
30 stars 3 forks source link

No scrobbling on M1 mac #5

Closed tyhwer closed 2 years ago

tyhwer commented 2 years ago

Hi! Thanks for doing this, great idea.

I haven't been able to make this work on my M1 running Monterey. Manually running perl /.config/mpv/lastfmscrobbler/scrobble.pl with iina opened with a paused track returns:

malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "(end of string)") at /Users/gabrielgonzalez/.config/mpv/lastfmscrobbler/scrobble.pl line 22.

Running echo '{ "command": ["get_property", "metadata"] }' | nc -U /tmp/mpv-socket just fails and returns nothing:

image

Any ideas? The files I'm playing have the right metadata on them:

Screen Shot 2022-07-23 at 09 36 42
ethanndickson commented 2 years ago

If the netcat (nc) command is failing, then iina isn't using the JSON IPC at /tmp/mpv-socket for whatever reason.

If you've double checked your iina settings, specifically that input-ipc-server is equal to /tmp/mpv-socket, and it's still not working, then this is either an issue with iina not passing these settings to the underlying mpv, or the underlying mpv not creating the JSON IPC server, and unfortunately, either way, not something I have the ability to fix.

If I was in your position, I would probably take a look and see if a separately installed mpv can make a working JSON IPC server, by doing mpv file.mp3 --input-ipc-server=/tmp/mpv-socket and echo '{ "command": ["get_property", "metadata"] }' | nc -U /tmp/mpv-socket. If that works you could narrow it down to an iina issue.

Best of luck, although if you do find out why iina is breaking in this way, i'd love to know!

tyhwer commented 2 years ago

So opening a separate instance of mpv works fine, but I still get nothing for echo '{ "command": ["get_property", "metadata"] }' | nc -U /tmp/mpv-socket:

Screen Shot 2022-07-23 at 11 03 03 image

Oh well, I guess I'll chalk it down to Apple silicon and move on. Thanks in any case!

ethanndickson commented 2 years ago

Sorry, I missed the hyphen in the mpv command I posted, should be mpv file.mp3 --input-ipc-server=/tmp/mpv-socket (not mpvsocket)

tyhwer commented 2 years ago

Yeah, that one works:

Screen Shot 2022-07-23 at 11 34 53

Settings look fine to me, so I guess it's an error in iina itself indeed:

image