Amarok2LibreFM

Amarok 2.x Scripts

Source (required if based on other people's work):

5
Score 50%
Description:

This script will scrobble your listening habits to LibreFM.

It depends on the 'lastfmsubmitd' daemon which is available in most repos otherwise you can get the source here: http://www.red-bean.com/decklin/lastfmsubmitd/
Last changelog:

9 years ago

Added delay before the track is submitted, currently set at 33% (see main.js for more information)

bugmenot1234

7 years ago

hi,

is the behavior that now i have amarok scrobbling to libre.fm only?

Report

C

esdaniel1

7 years ago

Hard to say - I have to make some assumptions...

#1 You're not using Amarok's inbuilt LastFM scrobbling

#2 You've only configured a single Lastfmsubmitd daemon, with your LibreFM info and using the Amarok2LibreFM script

If you've answered 'yes' to both those then as long as there is not some other wonderful weirdness going on then you will just be scrobbling to LibreFM.

If you enable #1 then you should have both though I've not checked that myself, Shane's your man for that:
http://amarok.kde.org/blog/archives/568-Last.fm-support-in-Amarok-2.html

HTH

ed.

Report

bugmenot1234

7 years ago

hi,

i was using amarok in-build last.fm scrobbler to scrobble last.fm

then i was looking for way to scrobble libre.fm also, so I installed lastfmsubmitd and Amarok2LibreFM and configured it to my libre.fm account

when I checked websited i saw only libre.fm is scrobbled

i was excpecting built-in last.fm to scrobble to last.fm, and Amarok2LibreFM scrobble to libre.fm, but i have libre.fm scrobbling only

Report

C

esdaniel1

7 years ago

Regrettably I think the issue is down to the fact 'we' use /etc/hosts to direct output to turtle.libre.fm instead of post.audioscrobbler.com.

One option is to run a second daemon and modify the parameters used. You might like to download lastfmsubmitd source (http://www.red-bean.com/decklin/lastfmsubmitd/) and hack this yourself - line 28 of the file lastfmsubmitd (SERVER_URL = ). It's not so tough, the daemon is in python so no code to compile - just ensure you think about potential conflicts with lastfmsubmitd daemon and make the necessary changes. There's a setup script in source to help with install as well. A better approach is to run one daemon that takes a parameter specifying where to scrobble.

I suppose 'we' really should fork lastfmsubmitd so librefm has it's own dedicated daemon or better I think to encourage the daemon coder to create multiconfig for different scrobblers - submitting a patch to the coder is probably the most polite approach.

Report

bugmenot1234

7 years ago

hi, in fact i haven't changed my /etc/hosts

it looks like this:

127.0.0.1 mycomp localhost


::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters


i used thees steps: http://bugs.libre.fm/wiki/clients/amarok

i installed deamon, changed /etc/lastfmsubmitd.conf and then amarok2librefm


Report

C

esdaniel1

7 years ago

Indulge me, please let me know the ip address when you ping these two:

a) turtle.libre.fm
b) post.audioscrobbler.com

Are they the same IP address?

Report

bugmenot1234

7 years ago

PING turtle.libre.fm (89.16.177.55)
PING post.glb.audioscrobbler.com (195.24.233.57)

Report

C

esdaniel1

7 years ago

#1 I checked the lastfmsubmitd code and as long as you use the server url parameter there will be no need to hack /etc/hosts as of lastfmsubmitd version: 1.05.

#2 I checked the Amarok2 code to see what urls they were communicating with... http://gitweb.kde.org/amarok/amarok.git?a=search&h=HEAD&st=grep&s=scrobble

My suggestion is that you should try and see what is taking place with Amarok by running it in debug mode (launch amarok from shell: <your shell prompt>amarok -d) to see what errors may be occurring with the LastFM scrobble then paste that info in a post here.

HTH

ed.

Report

bugmenot1234

7 years ago

i haven't checked it from startup, only about song changing and so, but no mention of last.fm, only libre.fm. so I guess last.fm prolly wont startup.. i need to do some tests with turning off librefm and i'll see.

Report

emilo

7 years ago

Maybe possible to fork the 'lastfmsubmitd' to 'librefmsubmitd' having the default settings to librefm server?

Report

Gallaecio

7 years ago

As new(by) packager for a distro, I would just patch the default configuration adding a commented entry for Libre.fm users.

Report

Gallaecio

8 years ago

Hope someone here can help me with this. I'm reading my two /var/log/lastfm/ files, and while one seems to be working, the lastmp log sounds like it can't work, and I don't understand why. I get this:

2010-08-10 22:00:10,367 lastmp[4889] INFO: Starting
2010-08-10 22:00:10,368 lastmp[4889] ERROR: Can't connect or lost connection to MPD

lastfsubmit includes two daemos, and I guess "lastmp" is MPD. So, why could this be not working?

Report

C

esdaniel1

7 years ago

Lastfmsubmitd includes a sample client that connects to MPD (music player daemon):
http://www.red-bean.com/decklin/lastfmsubmitd/

You've got a configuration issue with respect to MPD based on the log info you've shared thus far.

Report

Gallaecio

7 years ago

[chaves@afonsox ~]$ lastfmsubmitd --debug
lastfmsubmitd: no account info found; exiting

I have both /etc/ files, configured like by default the lastmp.conf, and according to the lastfmcubmitd INSTALL file the lastfmcubmitd.conf.

I'll keep looking at it for an hour to try to find out. Thanks for the help :)

Report

Gallaecio

7 years ago

Got it. I did this:
Change also permissions in /var/run/lastfm
Change /etc/lastfmsubmitd.conf to 775

Althogh I assume the last change was the one that actually did it. Found it in an Ubuntu forums. Will do the necesary changes to Chakra packages so this works from the beginning. Thanks a lot!

Report

Gallaecio

8 years ago

Hi,

While trying to make fix the script not getting, I found out that Installing the TAR.GZ from Amarok placed the files into this archive directly into the [...]/scripts folder, instead of [...]/scripts/Amarok2LibreFM folder. Fixing this I got Amarok to recognize the script under "Installed Script".

Even so, I could not get the script working. These are the only *Libre* strings I get in Amarok's output:

[...]
amarok(6443)/kio (Slave) KIO::Slave::createSlave: createSlave "http" for KUrl("http://amarok.kde.org/scriptupdates/Amarok2LibreFM/version")
[...]
amarok(6443)/kio (KIOJob) KIO::SlaveInterface::dispatch: error 111 "http://amarok.kde.org/scriptupdates/Amarok2LibreFM/version"
[...]
amarok(6443)/kdecore (KPluginInfo) KPluginInfo::kcmServices: found 0 offers for "Amarok2LibreFM"

Is there a way I can get an output with more details about the script or why could it not be working? (if it is the script what's not working, of course).

Report

okurz

8 years ago

I had the same problem. The script installed from Amarok's internal script manager is extracted to ~/.kde/share/apps/amarok/scripts
directly, not a subfolder and consequently not recognized.
After moving the script content to a subfolder "Amarok2LibreFM" AND installing and configuring lastfmubmitd, the script works.

And also, the scripts archive filename is still not correct for amarok to recognize as a script archive.

Report

Gallaecio

8 years ago

I'll play with it again, hope this time I get it to work.

Report

Gallaecio

8 years ago

I've just found out it has been working for some days: http://alpha.libre.fm/user/gallaecio/stats

And I didn't noticed... It's time to take use of LibreFM! THANK YOU ALL! :)

Report

C

esdaniel1

8 years ago

Thanks for the pointer, I've updated the download.

Report

Gallaecio

8 years ago

http://xltwo.co.nr/amarok-libre.fm-output.txt

This is the debug output in console, when I start Amarok. And this is what I get in the GUI:

There are exceptions caught in the script 'Amarok2LibreFM'. Please refer to the console debug output for more information.

Can someone tell me why?

Report

C

esdaniel1

8 years ago

Sorry for late reply - just took a peek at the console debug output - thanks btw for posting that.

So the info that helps me trace is here:

"11:56:07 Error: Unable to import qt.core: no such extension on Line: 14"

This refers to the includes in the companion script that provides the on/off toggle for the script being enabled:

Importer.loadQtBinding( "qt.core");
Importer.loadQtBinding( "qt.gui");
Importer.loadQtBinding( "qt.uitools" );

You should check that you've got those libs installed - I think the key package you're looking for is libqt4-scripttools.

HTH

ed (esdaniel)

Report

Gallaecio

8 years ago

I already had the arch version of that package (qtscriptgenerator), but the libs were not in the system. Reinstalling fixed it. Thanks! :)

Report

thenktor

9 years ago

The script submits the tracks at the beginning of the song and not after 50 %.

Report

C

esdaniel1

8 years ago

Sorry for the delay in getting this done - if you edit the main.js in ~/.kde/share/apps/amarok/scripts and replace the old function with this one it should do the trick...

function onTrackChange() {
if (config["showChange"]) {
var currentTrack = Amarok.Engine.currentTrack();
var wait_to_update = currentTrack.length * 0.33; // i.e. wait 33% of track length played before updating (in milliseconds)
var qo = new QObject();
qo.event = function(qevent) {
if (currentTrack.path == Amarok.Engine.currentTrack().path) {
notify();
}
this.killTimer(qo.timerID);
}
qo.timerID = qo.startTimer(wait_to_update);
}
}

I'll update the script in due course but let me know if that works for you.

Report

9 years ago

Added delay before the track is submitted, currently set at 33% (see main.js for more information)

File (click to download) Version Description Packagetype Architecture Downloads Date Filesize DL OCS-Install
Pling
Details
license
version
0.2
updated Sep 24 2010
added Jun 22 2009
downloads today
0
page views today 0
System Tags addon