Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: foo_scrobble (Read 49571 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foo_scrobble

foo_scrobble is a component that scrobbles to last.fm.

The old foo_audioscrobbler component is unmaintained and has various issues. This replacement:

  • Uses the current token-based submission API. You authorize the component with last.fm instead of entering your login credentials.
  • Manages the scrobble cache automatically. There is no need to manually submit the cache.
  • Handles intermittent network outages or reconnects well. No "waiting for handshake" issue.

URL: https://github.com/gix/foo_scrobble/
Use the releases tab to download.

To get started, open foobar's preferences, navigate to "Tools > Last.fm Scrobbling" and use the top button to authorize your client (it provides a tooltip with instructions).

You can post issues/requests here or on github directly.

Re: foo_scrobble

Reply #1
@gix:
Component works without problems so far =)

A few feature requests, if you don't mind:
  • Feature: 'Toggle Scrobbling' command in main menu.
    Description: This command enables\disables Last Fm scrobbling.
    Use cases:
    • Control scrobbling from other components, e.g. JScript panels or custom playlists.
    • Control scrobbling with keyboard shortcuts.
  • Feature: 'Elapsed % before submit' and 'Elapsed time before submit' in preferences page. Not really needed (see below).
    Description: The component scrobbles track only if one of the conditions from these fields is true.  Minimal values should be locked to something sensible though to prevent spamming.
    Use cases:
    • Some tracks might be very lengthy (e.g. over two hours), with 'Elapsed time before submit' it will be possible to submit them to LastFm even if they were not played completely.
    • 'Elapsed % before submit' helps to differentiate between skipping the track after listening it for a short time (don't want submit) and moving to the next track, when most of the track has been already played, for example when outro has started (want to submit).

 

Re: foo_scrobble

Reply #2
Last.fm already have their own guidelines in place which scrobbler authors are supposed to stick to. No matter how long a track is, you shouldn't have to listen for more than 4 minutes for it to count.

https://www.last.fm/api/scrobbling#when-is-a-scrobble-a-scrobble

Quote
When is a scrobble a scrobble?

A track should only be scrobbled when the following conditions have been met:

    The track must be longer than 30 seconds.
    And the track has been played for at least half its duration, or for 4 minutes (whichever occurs earlier.)



Re: foo_scrobble

Reply #3
To keep proper track of feature requests:
This plugin misses certain functionality from original one (blocking tracks from being scrobbled, based on tags). I added my own tag named "LFM_BLOCKED" and when it has value "1" or "yes" tracks are not scrobbled.
Use case:
On my PC there are ripped both my CDs and CDs of my wife. Sometimes I play her music for her from my account and honestly I don't want them to be counted on my LFM profile. Simple tag for all wife's CDs allowed me to achieve this.

Re: foo_scrobble

Reply #4
Last.fm already have their own guidelines in place which scrobbler authors are supposed to stick to. No matter how long a track is, you shouldn't have to listen for more than 4 minutes for it to count.
That's nice to know, thanks! Scratch that feature request from the list then =)

PS: Some of the scrobblers I've used on Android ignored those guidelines magnificently though :\

... blocking tracks from being scrobbled, based on tags ...
+1 on this.

Re: foo_scrobble

Reply #5
I've not tested this yet but given it has dialogs for artist/title title formatting, it should support not submitting based on tags like the old component.

Just make sure the value is blank if a certain condition is met and then the component should either not submit or last.fm will refuse the submission because of bad parameters. For example...

Code: [Select]
$ifequal(%rating%,1,,%artist%)

Re: foo_scrobble

Reply #6
Tracks are only scrobbled when a next track starts or playback is stopped (and they are valid according to last.fm's guidelines). This works equally for local and streamed tracks. It would be possible to scrobble earlier but then you have to keep track of the current submission state across restarts or else you may scrobble a long track twice.

To keep proper track of feature requests:
This plugin misses certain functionality from original one (blocking tracks from being scrobbled, based on tags). I added my own tag named "LFM_BLOCKED" and when it has value "1" or "yes" tracks are not scrobbled.
Use case:
On my PC there are ripped both my CDs and CDs of my wife. Sometimes I play her music for her from my account and honestly I don't want them to be counted on my LFM profile. Simple tag for all wife's CDs allowed me to achieve this.

Just curious, where or how was this configured? I don't see this functionality in the old foo_audioscrobbler 1.4.7. Or do you mean another component?

Edit: Ah I see, it was just the fact that it ignores tracks without artist that could be used to do this.

Re: foo_scrobble

Reply #7
Just looking at the readme, you don't need to link to the 64bit C++ redist as foobar2000 and your component are only 32bit.

Re: foo_scrobble

Reply #8
I've made some tests and... I think it is bit vague how this plugin works. It seems that I can not rewind track to make it scrobbled - looks like only track of which 100% of its length is listened is scrobbled, while 50% should be enough accordingly to L.fm rules, even if rewind was used - as long as total time was more than 50% of track.
Plugin says that it scrobbles something (would be nice to have information which exactly track was send - its title - just to make it more clear) and it scrobbles everything, no matter if tags are present or not - and that was confusing for me and that's why I asked for adding special functionality. Last.fm however filters tracks without title for example, so still expression
$if(%skip_lastfm%,,%title%)
put into "Field remappings - Title" causes that tracks with my special tag filled in are not visible in Last.fm . So let's say that requested functionality is de facto present in pipeline, but thanks to filtering applied on Last.fm servers, and not because it is implemented in plugin itself (plugin reports that it was scrobbled). But I suppose it shouldn't work like this. After changing it, it would be great if plugin was differentiating tracks that should not be scrobbled from others and if it was clearly printed in console ("Not scrobbling because: missing tile" or "Not scrobbling - insufficient legth" for example). Similarly to information about track being outside of ML.

Re: foo_scrobble

Reply #9
I've made some tests and... I think it is bit vague how this plugin works. It seems that I can not rewind track to make it scrobbled - looks like only track of which 100% of its length is listened is scrobbled, while 50% should be enough accordingly to L.fm rules, even if rewind was used - as long as total time was more than 50% of track.
I cannot reproduce that. It tracks the total time the track has been played, regardless of any seeks (Same as foo_audioscrobbler).

Plugin says that it scrobbles something (would be nice to have information which exactly track was send - its title - just to make it more clear) and it scrobbles everything, no matter if tags are present or not - and that was confusing for me and that's why I asked for adding special functionality. [...]
Yes I was unaware that people were using these field mappings that way.

I've added a new release that allows skipping tracks based on a titleformat script and adds a mainmenu command to toggle scrobbling.


Re: foo_scrobble

Reply #10
I've made some tests and... I think it is bit vague how this plugin works. It seems that I can not rewind track to make it scrobbled - looks like only track of which 100% of its length is listened is scrobbled, while 50% should be enough accordingly to L.fm rules, even if rewind was used - as long as total time was more than 50% of track.
I cannot reproduce that. It tracks the total time the track has been played, regardless of any seeks (Same as foo_audioscrobbler).

(...)

OK, but it seems that foo_scrobble plugin requires that total tracked time is at least 100% length of the track. As far as I remember from my experiments foo_audioscrobbler was simply sending scrobble after half of this time was achieved. So I could listen to 20% of the song, then skip next 30% with seekbar AND on 80% of track length, track was scrobbled. And I could advance to next track at let's say - 82%. Still 50% was achieved (in 2 parts - 20% + 32% ) and everything was in accordance with the rules. In foo_scrobble, when I omit just 5% of the track - there is no scrobble. I haven't checked if I can search back and forth and scrobble is done if total listening time sums up to at least 100%. But it does not matter if scrobble should be sent after 50% (or after 4 minutes, whichever occurs first - as mentioned by marc2003).

Re: foo_scrobble

Reply #11
OK, but it seems that foo_scrobble plugin requires that total tracked time is at least 100% length of the track. As far as I remember from my experiments foo_audioscrobbler was simply sending scrobble after half of this time was achieved. So I could listen to 20% of the song, then skip next 30% with seekbar AND on 80% of track length, track was scrobbled. And I could advance to next track at let's say - 82%. Still 50% was achieved (in 2 parts - 20% + 32% ) and everything was in accordance with the rules. In foo_scrobble, when I omit just 5% of the track - there is no scrobble. I haven't checked if I can search back and forth and scrobble is done if total listening time sums up to at least 100%. But it does not matter if scrobble should be sent after 50% (or after 4 minutes, whichever occurs first - as mentioned by marc2003).
As said earlier a track is submitted when the next one starts playing or playback is stopped even if the actual conditions are met earlier. This is no different than the other plugin.


Re: foo_scrobble

Reply #13
I've not tested this yet but given it has dialogs for artist/title title formatting, it should support not submitting based on tags like the old component.

Just make sure the value is blank if a certain condition is met and then the component should either not submit or last.fm will refuse the submission because of bad parameters. For example...

Code: [Select]
$ifequal(%rating%,1,,%artist%)
+1
A rose will bloom, it then will fade.


Re: foo_scrobble

Reply #15
fantastic, was getting so sick of the old plugin's bugs (e.g. it would randomly stop scrobbling until you restarted foobar). This seems to work great!

Re: foo_scrobble

Reply #16
+1 works like a charm here. Thank Gix !

Re: foo_scrobble

Reply #17
Trying to request authorization:

foo_scrobble: Requesting auth token
foo_scrobble: Failed to get auth token. (error: -2, <unknown error>)


Nothing is happening in my browser either.

Re: foo_scrobble

Reply #18
I see this implements its own scrobble timing rules. The player core provides an interface for reporting a track has been "played", but it follows different rules:

1) Track must play at least 60 seconds.
OR
2) Track must play at least 1/3 of its duration before ending.

See: SDK, play_callback.h, playback_statistics_collector. Implement your own service of this class, and receive a notification when the core has determined a metadb_handle has been played to its own definition of completion. Use your own implementation if you have already written something to the completion of the core service.

The core service observes multiple facets of the play_callback service, including counting the ticking seconds of the file towards the completion. You probably already do this, though. I haven't looked at your code thoroughly. Just enough to know you didn't use the above mentioned service.

Re: foo_scrobble

Reply #19
With the different rules playback_statistics_collector I can't really use this service. If the rules were simply stricter, maybe. A bigger problem is that it doesn't seem to support dynamic track info. Playing a stream just reports the stream name after a minute.

Re: foo_scrobble

Reply #20
Trying to request authorization:

foo_scrobble: Requesting auth token
foo_scrobble: Failed to get auth token. (error: -2, <unknown error>)

Nothing is happening in my browser either.
I installed this plugin on my work machine. Turns out that for some reason, IT blocks the API request call (I can't explain why Chrome doesn't even open though). Anyway, I switched my wifi to a guest account that for some reason is unblocked, and now I was able to authorize and everything is working perfectly again.

Re: foo_scrobble

Reply #21
I installed this plugin on my work machine. Turns out that for some reason, IT blocks the API request call (I can't explain why Chrome doesn't even open though). Anyway, I switched my wifi to a guest account that for some reason is unblocked, and now I was able to authorize and everything is working perfectly again.
The browser page that should be displayed requires the auth token in the URL, so without any token there's no way to proceed. I admit that the error reporting could be a bit better there.

Re: foo_scrobble

Reply #22
Does this component support other scrobbling services, such as libre.fm or is it strictly for last.fm only?

Re: foo_scrobble

Reply #23
I haven't been here in forever, but I recovered my account just to say thanks!

Re: foo_scrobble

Reply #24
For some reason after my antivirus Bitdefender made an update it started catching foo_scrobble.dll as a threat and blocked it. The result is foobar2000 can't access the dll anymore. Strange. All other foobar2000 dll work fine, only foo_scrobble is indicated as a threat.

Bitdefender says: "item was deleted. Threat name: Gen:Suspicious.Cloud.4.Uu8@aya8bPgi. Path: D:\foobar2000_music\user-components\foo_scrobble\foo_scrobble.dll"