vjeranc / cmus-status-scrobbler

Standalone scrobbler program, not a continuously running process, written in Python 3 that works together with cmus. Allows offline mode, scrobbling multiple servers simultaneously, sending a now playing request and handles pause status well.
GNU General Public License v3.0
17 stars 1 forks source link

ListenBrainz scrobbling error - required parameter missing? #8

Closed jptuominen closed 1 year ago

jptuominen commented 1 year ago

Hey,

I am trying to set up scrobbling to ListenBrainz without success.

My config looks like this:

[global]
now_playing = yes

[listenbrainz]
api_key = <api_key>
api_url = https://listenbrainz.org/2.0/
auth_url = https://listenbrainz.org/api/auth/
format_xml = yes

Here is relevant part from my log:

11572 2023-05-11 21:30:52 INFO root Status(status='playing', file='/home/defaultuser/Music/40 Below Summer - Rope.mp3', artist='40 Below Summer', albumartist=None, album='Invitation To The Dance', discnumber=1, tracknumber=None, title='Rope', date=None, duration='261', musicbrainz_trackid=None, cur_time=datetime.datetime(2023, 5, 11, 18, 30, 52, 914429))
11572 2023-05-11 21:30:52 INFO root Scrobbling previous tracks for listenbrainz
11572 2023-05-11 21:30:52 INFO root {'artist[0]': '40 Below Summer', 'track[0]': 'Tell Me Now', 'timestamp[0]': '1683829595', 'album[0]': 'The Last Dance', 'duration[0]': '260', 'api_key': '<api_key>', 'method': 'track.scrobble'}
11572 2023-05-11 21:30:53 INFO root <?xml version="1.0" encoding="utf-8"?>
<lfm status="failed">
  <error code="6">Invalid parameters - Your request is missing a required parameter</error>
</lfm>
11572 2023-05-11 21:30:53 INFO root Sending now playing for listenbrainz
11572 2023-05-11 21:30:53 INFO root {'artist': '40 Below Summer', 'track': 'Rope', 'album': 'Invitation To The Dance', 'duration': '261', 'api_key': '<api_key>', 'method': 'track.updateNowPlaying'}
11572 2023-05-11 21:30:53 INFO root <?xml version="1.0" encoding="utf-8"?>
<lfm status="failed">
  <error code="6">Invalid parameters - Your request is missing a required parameter</error>
</lfm>

lfm = Last.fm? What am I missing? Thank you for any help. I would like to switch to ListenBrainz full time.

vjeranc commented 1 year ago

Keep the api_key and shared_secret in the config. These are linked to the registered scrobbler application and you can change them, but it's not necessary.

Then call the py script with --auth. This will give you a link, you open it in a browser, you have to be logged in to your account and eventually the API should respond with a session key that will be automatically saved to the config.

After that you can scrobble normally.

jptuominen commented 1 year ago

Yes, works! Thank you.