Open SkyLeite opened 5 years ago
We provide the ability to change the URL for a given connector. See https://github.com/web-scrobbler/web-scrobbler/wiki/Custom-URL-patterns
Is that sufficient?
It works in the short term, but I think ideally it's best to have something like having the extension look for certain meta tags to automatically identify such services.
This has been mentioned before. Perhaps it's time to start implementing some Dom parsing matcher as an experimental feature for this.
Hi, Funkwhale maintainer here :)
If needed, I can easily add a meta tag into Funkwhale HTML, like <meta name="generator" content="funkwhale 0.18">
. I'm not sure how the actual scrobbling work though. How does Web Scrobbler identifies that the player switched to another track? If I can help with that, let me know!
Hey @EliotBerriot - thanks for reaching out. Once we start implementing this feature I can imagine that'll be useful for injecting the correct logic into the page.
The scrobbling normally works by binding to DOM elements and watching for changes. e.g. like this: https://github.com/web-scrobbler/web-scrobbler/blob/master/src/connectors/mnet.js
Sometimes even binding to native audio
elements or the JS that the apps expose.
The scrobbling normally works by binding to DOM elements and watching for changes. e.g. like this: https://github.com/web-scrobbler/web-scrobbler/blob/master/src/connectors/mnet.js
Makes sense, I'll try to keep stable class names for artists / albums / track data then!
I've added a basic support for identifying websites via checking for match rules in a content script. Will merge these changes into master branch after some testing and extending the match rules.
@EliotBerriot would be great if you add a meta tag like you suggested. I think it should contain no version:
<meta name="generator" content="Funkwhale">
as the version is redundant here (can be added as a separate meta
tag, though).
@alexesprit, sure, I'll do that today, and it will be included in our next release :)
@alexesprit So it's been implemented, and deployed at https://open.audio/library if you want to try it. Let me know if you need me to set some static classes / attributes on the player to make the job easier for you :)
Can we find a method to do this with the Spotify and Bandcamp embeds as well? These are still open/unmerged:
@stephanebruckert the way I added should work for embeds in theory, but I haven't checked it.
There're some known limitations:
@alexesprit did you make any progress on this injection mechanism?
https://github.com/web-scrobbler/web-scrobbler/tree/feature/request-inject but it's not finished.
Is it possible to add an option for connectors to identify a service through means other than the website's URL? It would make adding support for self-hosted platforms such as https://funkwhale.audio, which are not tied to a specific pattern or URL, but work consistently across all of them.