Author Topic: Small script for importing last.fm playcounts (lastfm_laite)  (Read 6095 times)

laite

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
    • Gmusicbrowser-plugins by laite
EDIT: This script is deprecated, due to my plugin 'lastfm_pcGet'.

Topic here: http://forum.gmusicbrowser.org/index.php?topic=419.0
« Last Edit: July 28, 2011, 20:29:50 by laite »

mgrubert

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
Re : Small script for importing last.fm playcounts (lastfm_laite)
« Reply #1 on: March 19, 2011, 00:27:55 »
I don't understand in wich folder I must extract your files.
I try in .config/gmusicbrowser but the plugin doesn't appear in gmb\plugin choices.
Could you help me ?

An old foobar2000 user.
« Last Edit: March 19, 2011, 00:29:52 by mgrubert »

laite

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
    • Gmusicbrowser-plugins by laite
I don't understand in wich folder I must extract your files.
I try in .config/gmusicbrowser but the plugin doesn't appear in gmb\plugin choices.
Could you help me ?

Sure. This is not 'plugin' as such, merely a small script, so it doesn't matter where you extract it. It uses existing plugin called "Now Playing" to get data from gmb (I tried to make instructions above a bit clearer, hope you get it working).
« Last Edit: March 19, 2011, 18:26:55 by laite »

mgrubert

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
Re : Small script for importing last.fm playcounts (lastfm_laite)
« Reply #3 on: March 20, 2011, 03:19:53 »
OK, thx, I will try it now !

Edit : no effect (no sync) !
« Last Edit: March 20, 2011, 03:43:36 by mgrubert »

laite

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
    • Gmusicbrowser-plugins by laite
Edit : no effect (no sync) !

Hm. Try running script manually from terminal:
1) make sure gmb is running
2) find some song you are certain has playcount at last.fm
3) find songs filepath (from right clicking track -> "song properties", it should show at top of the edit dialog)
4) open terminal and go to directory where you extracted script
5) run script with command:  python lastfm_laite.py "artist" "tracks title" "filepath"
(of course, you have to change these according to your selected track, make sure the spelling is correct)

It should look something like the screenshot attached. If not, please post everything script prints to terminal (or take a screenshot).
« Last Edit: March 20, 2011, 16:24:40 by laite »

mgrubert

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
Re : Small script for importing last.fm playcounts (lastfm_laite)
« Reply #5 on: March 21, 2011, 01:12:37 »
It's ok :
Code: [Select]
python lastfm_laite.py "Broken Bells" "The High Road" "/home/majorgrubert/Musique/B/Broken Bells/2010 - Broken Bells/01 - The High Road.mp3"
Sending 94 to perl ->
//home/majorgrubert/Musique/B/Broken Bells/2010 - Broken Bells/01 - The High Road.mp3
Playcount before: 29
? 1
And the new playcount is now 94  8)
But in GMB, it doesn't rule.

Perhaps a mistake here (I try with /home/ instead of ~/ with no effect) ?

laite

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
    • Gmusicbrowser-plugins by laite
Perhaps a mistake here (I try with /home/ instead of ~/ with no effect) ?

Yes, you need to add word 'python' before the path, so the whole line is formatted (without quotation marks): "python /home/USERNAME/.config/gmusicbrowser/lastfm_laite/lastfm_laite.py %a %t %f".

Also, I think you need to give the full path with /home/USERNAME etc. , not with ~.
« Last Edit: March 21, 2011, 11:04:32 by laite »

mgrubert

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
Re : Small script for importing last.fm playcounts (lastfm_laite)
« Reply #7 on: March 21, 2011, 11:29:01 »
Yeah ! It rocks ! Thx !
May be you know too how to make lastfm2gmb works ?
When I try "lastfm2gmb.pl -u mgrubert" or "lastfm2gmb -u mgrubert" (in my favorite directory, with gmb loaded) or "python lastfm2gmb.pl -u mgrubert" : look :


[email protected]:~/Bureau/Lien vers gmusicbrowser/bor-lastfm2gmb-b06d676/bin$ lastfm2gmb -u mgrubert
lastfm2gmb : commande introuvable
[email protected]:~/Bureau/Lien vers gmusicbrowser/bor-lastfm2gmb-b06d676/bin$ lastfm2gmb.pl -u mgrubert
lastfm2gmb.pl : commande introuvable
[email protected]:~/Bureau/Lien vers gmusicbrowser/bor-lastfm2gmb-b06d676/bin$ python lastfm2gmb.pl -u mgrubert
  File "lastfm2gmb.pl", line 10
    use strict;
             ^
SyntaxError: invalid syntax

laite

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
    • Gmusicbrowser-plugins by laite
Yeah ! It rocks ! Thx !
May be you know too how to make lastfm2gmb works ?
When I try "lastfm2gmb.pl -u mgrubert" or "lastfm2gmb -u mgrubert" (in my favorite directory, with gmb loaded) or "python lastfm2gmb.pl -u mgrubert" : look :

It's witten in Perl instead of python (two different programming languages), so perhaps you should try: "perl lastfm2gmb.pl -u mgrubert"

mgrubert

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
Re : Small script for importing last.fm playcounts (lastfm_laite)
« Reply #9 on: March 21, 2011, 11:34:48 »
You are the king !

Thx a lot !
« Last Edit: March 21, 2011, 11:42:19 by mgrubert »