22 Responses to “Changing Last.fm username”


  1. Gravatar Icon 1 Bernardo

    Hi, I found the link to the scripts http://github.com/ibz/lastfmtools but I have no idea how to use this stuff, not being a programmer (or knowing anything at all about code). Could you elaborate a bit more on how I run the code (parameters, etc) and what you mean by the formatting? Thanks!

  2. Gravatar Icon 2 Karol

    Nice, thanks.

    I used lastfm_backup.py initially.

    Put the contents of the script into a file, let’s say ~/lastfm_backup.py.

    Give executable permissions:

    chmod 700 ~/lastfm_backup.py

    To run it issue:

    ~/lastfm_backup.py username &> ~/lastfm_backup.log

    You will need python and python-lxml bindings installed (sudo apt-get install python python-lxml).

    Assuming your recent tracks are not set to private, you should get a list of your scrobbles in the ~/lastfm_backup.log file.

    The output of this command is something like this:

    Jean-Michel Jarre	Oxygene (Part 4)	2009-11-26T08:14:48Z
    Jean-Michel Jarre	Second Rendez-Vouz Part 1	2009-11-26T08:17:48Z
    Jean-Michel Jarre	September 14	2009-11-26T08:20:48Z
    Jean-Michel Jarre	Blah Blah Cafe	2009-11-26T08:23:48Z

    To submit it using some sort of online scrobbler you need to convert it to the .scrobbler.log format which is:

    Header part (first three lines):

    #AUDIOSCROBBLER/1.1
    #TZ/[UNKNOWN|UTC]
    #CLIENT/<IDENTIFICATION STRING>

    and then one scrobble per line with fields separated by tabs:

     - artist name
     - album name (optional)
     - track name
     - track position on album (optional)
     - song duration in seconds
     - rating (L if listened at least 50% or S if skipped)
     - unix timestamp when song started playing
     - MusicBrainz Track ID (optional)
    

    according to the standard (http://www.audioscrobbler.net/wiki/Portable_Player_Logging).

    So using some sort of text editor (or spreadsheet if more convenient) you have to create a file structure resembling this one:

    #AUDIOSCROBBLER/1.1
    #TZ/[UNKNOWN|UTC]
    #CLIENT/My portable player
    Jean-Michel Jarre		Oxygene (Part 1)		180	L	0
    Jean-Michel Jarre		Oxygene (Part 2)		180	L	0
    Jean-Michel Jarre		Oxygene (Part 3)		180	L	0
    Jean-Michel Jarre		Oxygene (Part 4)		180	L	0
    Jean-Michel Jarre		Oxygene (Part 5)		180	L	0

    (The formatting gets messed up here in the comment – there are in fact double tabs for empty fields (check the source of this page to get it in raw format)).

    Then rescrobble it using the aforementioned tools.

    I see in the repository you’ve mentioned there’s a lastfm_bootstrap.py script, which should theoretically do all this in a more elegant manner, but I didn’t try it. From what I remember bootstrapping was not meant to be supported for 3rd-party tools, so I think either way this would be some undocumented way of using the API, and will probably cease to function in the future.

    If you’re still stuck at some point, drop me a line here – maybe we’ll be able to sort it out.

  3. Gravatar Icon 3 Bernardo

    Hey, once again thanks for the help. Do you seriously have to enter everything manually, or is there a method for automation? Because… uh… I have 15’000+ lines to go through O.o

  4. Gravatar Icon 4 Karol

    Try importing the backup file to a spreadsheet application (Excel/Calc). This way it’s easy to operate on all rows at the same time (you only need genuine artist and track name data from the backup). Then export to a text file and, if needed, try search & replace (field separators).

  5. Gravatar Icon 5 Bernardo

    Awesome! I got it to work (I’m guessing dap-scrob takes a couple hours to get through everything?). When I saved the file after search-replacing the quotes in gedit, it crashed the program – thank god I have VIM installed too. I owe you big time, thank you so much for all your help – I would never have been able to migrate everything without your help, and now I have one unified username across all the sites I visit.

    Thanks again!

  6. Gravatar Icon 6 Karol

    Hey, nice to hear you got it sorted out.

    dap-scrob can be a bit troublesome with that much data, but IMHO it’s easiest to use – if it doesn’t work, you can try resetting the stats and using some other scrobbler. I had a couple of dozen tracks which were probably submitted more than once (the overall stats did not fully match), but I thought it was still better than nothing.

  7. Gravatar Icon 7 Bernardo

    Turned out it was that the collection of all my music was longer than the account was old – so I set it to scrobble at 30s intervals. I may have lost about a sixth of my scrobbles, but it was still worth it. I wish last.fm would give an official way to grab your scrobbles from another account.

  8. Gravatar Icon 8 tenko

    dziendobry~~

    ciesze sie, ze po dniu babrania sie w tagach na last fm i internecie tagi skonczylam i znalazlam juz nawet sposob jak zrobic to co bym chciala…

    sprobowalam zrobic tak jak napisales, tzn wpisac te komendy w cmd.exe (czy nie w to?) ale nie dziala, winda sie stawia. jak odpalic ten plik? forgive my ignorance, html opanowalam (jakos) ale tu i na lekko zaawansowanej obsludze kompa sie konczy >.> co gdzie trzeba wpisac zeby ten plik odpalic?

  9. Gravatar Icon 9 tenko

    ah. dotarlo do mnie tez, ze ty pythonem trzeba. tylko ze ja mam siodma winde i zadna z dwoch promowanych na oficjalnej stronie pythona sie nie chce nawet zaczac instalowac, grozba ani prosba, py scripter sie zainstalowal, ale nie wczytuje zadnych bibliotek i nie dziala.

    najwyzej zawola sie najblizszego kolege zaznajomionego z linuksem.. ale serio, na windzie 7 to nie zadziala?
    molgbys mi chociaz podeslac ta wygenerowana liste piosenek? (mejla masz, username na last to bouzenjishitsu) musze sie nia najpierw pobawic zanim wrzuce zpowrotem, zamierzam popoprawiac literowki tu i owdzie..
    rozumiem, ze zeby wrzucic to zpowrotem i tak potrzebuje rozgryzc jak zainstalowac pythona, zeby otworzyc ten drugi plik py co to laduje zpowrotem? czy przez itunes po prostu mozna?

  10. Gravatar Icon 10 tenko

    ok ok udalo mi sie zainstalowac pythona, ale caly czas mowi mi ze nie umiem pisac =.= line syntax error, przepisuje dokladnie to co napisales (min, probowalam tez wpisywac adres pliku).
    co jest nie tak, jak to zrobic?

  11. Gravatar Icon 11 Karol

    Podsyłam Ci backup scrobbli na maila. Można to przerobić do formatu .scrobbler.log i wgrać przez jakiś scrobbler – jest tego trochę do wyboru.

    Teoretycznie lepszy byłby skrypt lastfm_bootstrap.py – czyli pierwszy import jak za pomocą iTunes/odtwarzacza MP3. Ale wymaga poradzenia sobie z pythonem. Poza tym nie testowałem tej metody i nie wiem, czy w ogóle działa.

  12. Gravatar Icon 12 tenko

    super, dzieki :D to tym drugim sposobem bede sie bawic pozniej, jak uzyskam uwage kolegow bieglych w te klocki :)

  13. Gravatar Icon 13 Karol

    OK, powodzenia.

  14. Gravatar Icon 14 Karol

    As a side note here. For Windows users it seems that Last.fm Scrobble Mapper should facilitate the transfer. Grabs all scrobles and exports them into Windows Media Player or iTunes format. Seems promising (at least from description). More information about Last.fm Scrobble Mapper.

    And by the way – it seems the problem is more common than I initially thought:
    Last.fm “Change the username” group ;-)
    Topic at getsatisfaction.com

    Last.fm should probably do something about it.

  15. Gravatar Icon 15 sealskej

    Hey!
    I have edited script and it generates .scrobbler.log now. It isn’t necessary to redirect output. Just look for .scrobbler.log file. Enjoy!

    http://dl.dropbox.com/u/560732/lastfm_backup.zip

  16. Gravatar Icon 16 Kelvin

    When I run lastfm_backup.py, there will be a cmd line that display
    “WARNING: urlgrabber not available. Will not use keepalive.
    Usage: ~\lastfm_backup.py username”

    How can I solve this problem?
    I can’t get any output file :(

  17. Gravatar Icon 17 Karol

    You could try installing urlgrabber, but it’s not a fatal error, so that’s probably not the case.

    Are you sure you invoke the command with a proper username? You should be seeing some output directly in the console. You can redirect stdout to a file like this:

    ~/lastfm_backup.py username &> ~/lastfm_backup.log

    If it’s still not working then – I don’t know. Maybe the data format changed somehow. I’m not keeping tabs on this, so I’m not certain this method is still valid.

  18. Gravatar Icon 18 Kelvin

    Thanks for the helping, Karol!
    I can get the log file right now. However, I can’t upload the .scrobbler.log file to last.fm via all of the methods in Rockbox. Even though I submit the log file, my profile still not have any change.

    I have try to use lastfm_bootstrap.py script. The script is usable, however, it cannot help me to upload entire log file to my last.fm account.

    Are there any alternative ways to let me upload the log file to last.fm account?

  19. Gravatar Icon 19 tenko

    @kelvin – sorry to butt in, but i had the same problem and in the end i didn’t manage to successfully upload the log back to last.fm.

    i ran out of patience but there is in fact an other way around that might work – uploading via winamp and itunes. there is a script for “downloading” all your scrobbles into itunes’ and winamp’s library to update the played tracks play count, and there is also a function in last.fm where audioscrobbler app is asking you “whether you want to upload yout itunes/winamp’s library playcounts to last.fm” while setting up a new account.

    though it has been my experience this does not grab the whole played history, for me it always choked halfway though.

    try though! and then say whether you found any working method here.

    in the meantime last.fm screwed my scrobbles history via some database error and i have some 10.000+ odd scrobbles out of my listened history (it doubled random listenings from 2006 and 2007) and it really starts to throw me off.

  20. Gravatar Icon 20 Kelvin

    I can transfer the listening record to new account by using Last.fm Scrobble Mapper! Although the the Last.fm Scrobble Mapper cannot download the whole listening record from my old account, I think it’s better than nothing.

    Thanks a lot Tenko!!! :D
    I can “change” my Last.fm username now!

  21. Gravatar Icon 21 phil

    Hello.

    Please, explain how to run this script on windows

    I cannot install lxml.html package, and other required packages.

    please, help

  22. Gravatar Icon 22 feliz

    can i pay someone to do this for me? i want to have a different username but i don’t have ANY knowledge regarding these codes, htmls, whatever…

Leave a Reply




Subscribe without commenting