FoxxMD / multi-scrobbler

Scrobble plays from multiple sources to multiple clients
https://foxxmd.github.io/multi-scrobbler
MIT License
299 stars 14 forks source link

Tautulli and LastFM scrobbling issue - author was not an allowed user #84

Closed Haelski closed 11 months ago

Haelski commented 11 months ago

Please check the FAQ before submitting a bug report.

Describe the bug Scrobbling from Tautulli/Plex does not get scrobbled to LastFM. Instead it fails to scrobble due to the author not being an allowed user.

To Reproduce Steps to reproduce the behavior:

I have configured Tautulli to send a webhook notification to MS. I can see this being sent in the Tautulli logs, and MS logs do show the webhook being received.

I had MS configured to allow a single user using the ENV variable: TAUTULLI_USER=. This was configured to allow my Tautulli username that I use for the Tautulli web portal. I have also tested adding my plex username (comma delimited after the Tautulli username) to see if that was why the author not being allowed error appeared.

I also tried reauthenticating with LastFM, but that did not resolve the "author was not an allowed user" error.

Notes/Questions As seen in the logs, the author is not being allowed. Would this be due to a username mismatch between my LastFM and my Plex or Tautulli usernames? They do not currently match. Though, they didn't match previously either. Could it also be a LastFM issue?

Let me know if there's anything else I can provide info or log-wise.

Expected behavior Expected to see Tautulli send the webhook to MS and MS scrobble the track to LastFM.

Logs Debug logs:

2023-07-12T08:53:44-05:00 verbose : [Sources] [Tautulli - unnamed] Will not scrobble event because author was not an allowed user: myPlexusername {"artists":["Devin Townsend"],"track":"Call of the Void"}
2023-07-12T08:53:44-05:00 info : [Ingress] [Tautulli] Received request from a new remote address: ::ffff:192.168.160.1 (UA: python-requests/2.28.2) | Received data from server plexserver for the first time.
2023-07-12T08:50:16-05:00 info : [App] Server started at http://localhost:9078
2023-07-12T08:50:16-05:00 info : [Sources] tautulli (unnamed) source initialized
2023-07-12T08:50:16-05:00 info : [Sources] [Tautulli - unnamed] Initializing with the following filters => Users: myTautulliusername,myPlexusername | Libraries: N/A | Servers: N/A
2023-07-12T08:50:15-05:00 debug : [Sources] (unnamed) Constructing tautulli source
2023-07-12T08:50:15-05:00 info : [Scrobblers] lastfm (unnamed-lfm) client auth OK
2023-07-12T08:50:15-05:00 info : [API - Lastfm - unnamed-lfm] Client authorized for user myLastFMusername
2023-07-12T08:50:15-05:00 debug : [Scrobblers] Checking lastfm (unnamed-lfm) client auth...
2023-07-12T08:50:15-05:00 info : [Scrobblers] lastfm (unnamed-lfm) client initialized
2023-07-12T08:50:15-05:00 debug : [Scrobblers] Attempting lastfm (unnamed-lfm) initialization...
2023-07-12T08:50:15-05:00 debug : [Scrobblers] Constructing lastfm (unnamed-lfm) client...
2023-07-12T08:50:15-05:00 debug : [App] Config Dir ENV: /config -> Resolved: /config

Versions (please complete the following information):

Haelski commented 11 months ago

I did just confirm this works fine if I don't use any Tautulli environment variables but instead use a tautulli.json file:

[
  {
    "name": "Tautulli",
    "clients": [],
    "data": {
      "user": []
    }
  }
]

Was my configuration with the ENV variable incorrect or is there another variable I need to use in addition to TAUTULLI_USER?

Haelski commented 11 months ago

Accidentally closed this previously, feel free to close if needed.

Just curious now for potentially using an ENV variable instead of the json file.

FoxxMD commented 11 months ago

Thanks for the detailed logs and writeup! Please try the develop branch or image foxxmd/multi-scrobbler:develop and let me know if this fixes the issue for you (when using ENV only). It may have been a whitespace or comma-delim issue I've added a fix for.

At the very least you should now be able to determine why the users don't match up. I've updated the logging statement so it should look like this now:

2023-07-13T09:55:26-04:00 verbose : [Sources] [Tautulli - MyTautuilli] Will not scrobble event because author was not an allowed user. Expected: 'myplexuser' or 'mytautulliuser' | Found: 'foxxmd' {"artists":["A.M. Architect"],"track":"Unspoken"}
Haelski commented 11 months ago

Nice, that fixed it! I can confirm the logging statement worked too. I had a typo the first time, so the log was useful.

One other question, is it possible to pass nothing for that ENV variable? I'm thinking of trying to replicate the tautulli.json file option of scrobbling for any user instead of a specified user/list of users. If not, no problem. Just a curiosity.

FoxxMD commented 11 months ago

It is now! Update your branch/image to use that.

Haelski commented 11 months ago

Awesome, thank you!