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

Cant get webscrobbler to work #157

Open iluvatyr opened 2 weeks ago

iluvatyr commented 2 weeks ago

Describe the bug I do a filebased config for webscrobbler from a chrome browser. I also have webscrobbler scrobble to last.fm just to make sure it works and it does.

The webscrobbler.json in multi-scrobbler: [0.7.1 on docker] looks like this:

[
  {
    "name": "lala",
    "clients": [
      "Brave2Maloja"
    ],
    "data": {
      "slug": "GXm621XSNa65"
    }
  },
  {
    "name": "example",
    "clients": [
      "exampleclient2Maloja"
    ],
    "data": {
      "slug": "examplestringforurl"
    }
  },
    {
    "name": "MyWebScrobbler",
    "data": {
      "slug": null,
      "whitelist": [],
      "blacklist": []
    }
  }
]

I then setup webhook in webscrobbler within Brave (Chrome) with the several API_URLS according to the docs: multi2

http://192.168.1.2:9078/api/webscrobbler/GXm621XSNa65 Multiscrobbler http://192.168.1.2:9078/api/webscrobbler Multiscrobbler http://192.168.1.2:9078/api/webscrobbler/examplestringforur

but non of them work and I get following debug log:

[2024-06-13 00:02:27.163 +0200] DEBUG : [App] [API] Server received OPTIONS request from ::ffff:192.168.1.103 (UA: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36) to unknown route: /api/webscrobbler/examplestringforurl [2024-06-13 00:02:27.160 +0200] DEBUG : [App] [API] Server received OPTIONS request from ::ffff:192.168.1.103 (UA: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36) to unknown route: /api/webscrobbler [2024-06-13 00:02:27.157 +0200] DEBUG : [App] [API] Server received OPTIONS request from ::ffff:192.168.1.103 (UA: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36) to unknown route: /api/webscrobbler/GXm621XSNa65

I also tried with FQDN, but same debug log. Anyone has the same problem or knows what Im doing wrong?

FoxxMD commented 2 weeks ago

Thanks for the logs and config samples. Can you try using docker image foxxmd/multiscrobbler:issue157 to see if this fixes your issue?

iluvatyr commented 2 weeks ago

No problem. It seems like this fixed the issue. I receive songs via webscrobbler now and it shows as discovered in the WebUI. Thank you very much!

[2024-06-17 00:59:47.227 +0200] DEBUG  : [App] [Sources] [Webscrobbler - ] [Player undefined-991085259-SingleUser] Started new Player listen range.
[2024-06-17 00:59:47.224 +0200] DEBUG  : [App] [Sources] [Webscrobbler - ] [Player undefined-991085259-SingleUser] New Play: (DF3XjEhJ40Y) Indila - Love Story
[2024-06-17 00:59:47.222 +0200] DEBUG  : [App] [Sources] [Webscrobbler - ] [Player undefined-991085259-SingleUser] Generating play object with playDateCompleted
[2024-06-17 00:59:47.219 +0200] DEBUG  : [App] [Sources] [Webscrobbler - ] [Player undefined-991085259-SingleUser] Incoming play state ((DF3XjEhJ40Y) Indila - Love Story) does not match existing state, removing existing: 

one probably offtopic question regarding pushing discovered tracks from webscrobbler: It does not push automatically to maloja. I guess this is default behaviour and it is waiting until the buffer is full or something like this? I am just confused because it shows "Queued Scrobbles: 0" in the WebUI for maloja, while webscrobbler has now discovered 2 tracks already.

FoxxMD commented 2 weeks ago

It should push them automatically. There are several reasons it may not be scrobbling though:

MS waits for scrobble from Webscrobbler

In the logs on startup you should see this message:

[2024-06-17 09:55:29.735 -0400] INFO   : [App] [Sources] [Webscrobbler - example] Note: The player for this source is an analogue for the 'Now Playing' status exposed by webscrobbler which is NOT used for scrobbling. Instead, the 'recently played' or 'history' information provided by this source is used for scrobbles.

MS will show the currently playing track reported by webscrobbler but will not actually scrobble the song until Webscrobbler reports it should be scrobbled. This should occur after a majority of the track has been played.

Client to scrobble to has an incorrect name

In your config example, for the webscrobbler using slug GXm621XSNa65, MS will only scrobble to a client you have configured named Brave2Maloja. This applies to webscrobble with slug examplestringforurl only scrobbling to a client named exampleclient2Maloja. If you do not have those named clients (IE maloja.json with two configured clients) then the webscrobbler sources will have nowhere to scrobble to.

You can verify if this is happening by checking DEBUG logging after a track is 'discovered' for a message that looks like:

[2024-06-17 09:55:27.105 -0400] DEBUG  : [App] [Scrobblers] [Maloja - default] Client was filtered out by Source 'webscrobbler - lala'

Duplicate tracks

If you are testing MS and still have your webscrobbler extension configured to scrobble to Maloja directly then it is possible that:

You can get more information from MS on duplicate scrobbles by adding verbose options to the maloja client config like this in maloja.json:

[
  {
    "name": "example",
    "data": {
      "url": "https://example.com",
      "apiKey": "fdsfs"
    }
    "options": {
      "verbose": {
        "match": {
          "onNoMatch": true,
          "confidenceBreakdown": true
        }
      }
    }
  }
]
iluvatyr commented 2 weeks ago

That was it. Apparently I did not quite get the client field. I changed it accordingly and now it works. can be closed ! Thank you very very much!

EDIT: I don't know if it should be kept open until the fix is merged into main. So I'll leave the closing to you.