tag:blogger.com,1999:blog-6337741957437560735.post7470283540963063335..comments2023-08-19T18:53:07.595+03:00Comments on Plug-and-Pray: How to gobble (GNU scrobble) to Libre.FM using Amarok2Alexandrahttp://www.blogger.com/profile/07936817579635597668noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-6337741957437560735.post-23310186610571405132010-02-03T14:10:31.695+02:002010-02-03T14:10:31.695+02:00The output is nice, except for the duration.
A so...The output is nice, except for the duration.<br /><br />A solution would be to "parse" that output yourself (lastfmsubmit expects the track length in the format "mm:ss", if I'm not mistaking). First off, install <b>bc</b>. Then, try something like the following:<br /><br /># suppose <i>d_line</i>="duration: 326.671"<br />trunc="$( echo "$d_line" | awk '{ print $2 }' | awk -F. '{ print $1 }' )" # <i>trunc</i> is "326"<br />minutes="$( echo $trunc/60 | bc )" # <i>minutes</i> is "5"<br />seconds="$( echo $trunc-$minutes*60 | bc )" # <i>seconds</i> is "26"<br />length="$minutes:$seconds"<br /><br />And now you just have to use $length as argument for the "--length" parameter in the lastfmsubmit command.Alexandrahttps://www.blogger.com/profile/07936817579635597668noreply@blogger.comtag:blogger.com,1999:blog-6337741957437560735.post-50569043842790754782010-02-03T13:44:27.037+02:002010-02-03T13:44:27.037+02:00Thanks, the script might actually be trivial to wr...Thanks, the script might actually be trivial to write. After crawling through the banshee manpages, I found that I can print most of the information I need about the current playing song:<br /><br />spyked@spaicd-lap:~$ banshee-1 --query-artist --query-album --query-title --query-position --query-duration<br />artist: Meshuggah<br />album: Nothing [Re-Issue]<br />title: Rational Gaze<br />position: 51.694<br />duration: 326.671<br /><br />The problem is: I don't know if the lengths are in the same format and I'm not sure how to sync the querying with the actual submitting (submitting at the end of the song, for example - the Amarok2LibreFM thingie does that in a more orthodox way). Other than that, it shouldn't be too hard.spykedhttp://lucian.mogosanu.ro/bricksnoreply@blogger.comtag:blogger.com,1999:blog-6337741957437560735.post-31470557329201252562010-02-03T05:46:59.373+02:002010-02-03T05:46:59.373+02:00Hello spyked,
I haven't tried out Banshee (I ...Hello spyked,<br /><br />I haven't tried out Banshee (I had a very short time of fooling around with Gnome and I really hated it, whoops). <br /><br />I imagine that the /etc/hosts spoof you're talking about must associate the host post.audioscrobbler.com with turtle.libre.fm's IP. It would be a line like<br /><br />89.16.177.55 post.audioscrobbler.com<br /><br />but that would mean, as you say, that you couldn't scrobble to last.fm at the same time.<br /><br />An ugly workaround, as I see it, would be to use this daemon that can be configured with Libre.FM credentials... and... *cough* a script ran each few minutes with cron. There would roughly be two steps in this process:<br /><br /><b>1.</b> install lastfmsubmitd and edit the /etc/lastfmdaemond.conf file:<br /><br />[account]<br />user = your_libre.fm_username<br />password = your_libre.fm_password<br /><br />[server]<br />url=http://turtle.libre.fm<br /><br />(Don't forget to set chmod 777 on /var/spool/lastfm and /var/log/lastfm.)<br /><br /><b>2.</b> Write a bash script that finds out (uses CLI parameters provided by banshee?) the track title, the track album, the track artist and the track length and sends this information to turtle.libre.fm using lastfmsubmitd, then add it in your user's crontab.<br /><br />The lastfmdaemond syntax would be:<br /><br />/usr/lib/lastfmdaemond/lastfmsubmitd --encoding "UTF-8" --artist "$ARTIST" --album "$ALBUM" --title "$TITLE" --length "$LENGTH"<br /><br />I'm sorry I can't come up with an actual no-script solution.Alexandrahttps://www.blogger.com/profile/07936817579635597668noreply@blogger.comtag:blogger.com,1999:blog-6337741957437560735.post-7628055418443147122010-02-03T02:16:50.078+02:002010-02-03T02:16:50.078+02:00Do you, by any chance, know a way to make Banshee ...Do you, by any chance, know a way to make Banshee work with libre.fm? There's some sort of /etc/hosts domain name spoof workaround, but it renders last.fm useless and some people (loosely translated: I) use that one too.<br /><br />I mean. Any option besides the „write a plugin yourself, lazy bum” one.spykedhttp://lucian.mogosanu.ro/bricksnoreply@blogger.com