mpdscribble icon indicating copy to clipboard operation
mpdscribble copied to clipboard

Send love doesn't work on lastfm

Open emagra opened this issue 3 years ago • 5 comments

While playing some some running

$: mpc channels mpdscribble $: mpc sendmessage mpdscribble love

doesn't work. No love shown on Lastfm

emagra avatar Jul 04 '21 08:07 emagra

Just tested this and it seems like it's not working, indeed. Any updates on why?

BachoSeven avatar Jan 29 '22 10:01 BachoSeven

You did not specify your version number and no verbose log.

MaxKellermann avatar Mar 14 '22 10:03 MaxKellermann

Here are some details:

  • the package was installed from the mpdscribble-git AUR package, recompiled today from master (0.23.r60.gd62d214-2 )

  • I started playing a song in MPD, and then executed

mpc --verbose sendmessage mpdscribble love

(which didn't return any error)

  • Here is the journalctl -xeu log from the user unit for mpdscribble:
mar 15 14:57:07 hyperversum systemd[717]: Starting AudioScrobbler for MPD...
░░ Subject: A start job for unit UNIT has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit UNIT has begun execution.
░░
░░ The job identifier is 3782.
mar 15 14:57:07 hyperversum mpdscribble[41014]: 2022-03-15T14:57:07+0100 starting mpdscribble (mdc 0.25)
mar 15 14:57:07 hyperversum mpdscribble[41014]: 2022-03-15T14:57:07+0100 loaded 0 songs from /var/cache/mpdscribble/lastfm.journal
mar 15 14:57:07 hyperversum systemd[717]: Started AudioScrobbler for MPD.
░░ Subject: A start job for unit UNIT has finished successfully
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit UNIT has finished successfully.
░░
░░ The job identifier is 3782.
mar 15 14:57:07 hyperversum mpdscribble[41014]: 2022-03-15T14:57:07+0100 connected to mpd 0.23.5 at localhost:6602
mar 15 14:57:07 hyperversum mpdscribble[41014]: 2022-03-15T14:57:07+0100 new song detected (Alice et Moi - Filme moi), id: 2, pos: 0
mar 15 14:57:09 hyperversum mpdscribble[41014]: 2022-03-15T14:57:09+0100 [last.fm] handshake successful
mar 15 14:57:09 hyperversum mpdscribble[41014]: 2022-03-15T14:57:09+0100 [last.fm] session: bb2bdc3986818f360867640b1d35b9bf
mar 15 14:57:09 hyperversum mpdscribble[41014]: 2022-03-15T14:57:09+0100 [last.fm] now playing url: http://post.audioscrobbler.com:80/np_1.2
mar 15 14:57:09 hyperversum mpdscribble[41014]: 2022-03-15T14:57:09+0100 [last.fm] submit url: http://post2.audioscrobbler.com:80/protocol_1.2
mar 15 14:57:09 hyperversum mpdscribble[41014]: 2022-03-15T14:57:09+0100 [last.fm] sending 'now playing' notification
mar 15 14:57:09 hyperversum mpdscribble[41014]: 2022-03-15T14:57:09+0100 [last.fm] OK
mar 15 14:59:10 hyperversum mpdscribble[41014]: 2022-03-15T14:59:10+0100 1647352750, songchange: Alice et Moi - Filme moi (209)
mar 15 14:59:11 hyperversum mpdscribble[41014]: 2022-03-15T14:59:11+0100 [last.fm] submitting 1 song
mar 15 14:59:11 hyperversum mpdscribble[41014]: 2022-03-15T14:59:11+0100 [last.fm] post data: s=bb2bdc3986818f360867640b1d35b9bf&a[0]=Alice%20et%20Moi&t[0]=Filme%20moi&l[0]=209&i[0]=1647352750&o[0]=P&r[0]=&b[0]=Filme%20Moi&n[0]=1&m[0]=&r[0]=L
mar 15 14:59:11 hyperversum mpdscribble[41014]: 2022-03-15T14:59:11+0100 [last.fm] url: http://post2.audioscrobbler.com:80/protocol_1.2
mar 15 14:59:11 hyperversum mpdscribble[41014]: 2022-03-15T14:59:11+0100 [last.fm] OK

(includes the log until after the song ended)

In the end, going to https://www.last.fm/user/BachoSeven you can see that the "Filme Moi" song doesn't have a love attribute.

BachoSeven avatar Mar 15 '22 14:03 BachoSeven

Using pylast, I managed to love tracks

shdbwa avatar May 18 '22 21:05 shdbwa

I looked a bit to see what caused this bug. MPD and mpdscribble handle love without issue. It is submitted to last.fm according to the API 1.2 docs. It is the &r[0]=L in the url above. See https://www.last.fm/api/submissions

So the problem comes from last.fm. But API 1.2 is deprecated. I guess the only solution would be to rewrite mpdscribble to use the last.fm API 2.0 version.

ghost avatar Jun 28 '23 17:06 ghost