Last.fm Playcount Import (2010-03-28) [MM3/4]

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

AndreVonDrei

Re: Last.fm Playcount Import [MM3]

Post by AndreVonDrei » Thu Feb 26, 2009 12:15 pm

Having the same problem: "An invalid character was found in text content".
Guessing it has something to do with songs/albums/artists with special letters such as æ,ø and å.

bigcooper
Posts: 2
Joined: Tue Feb 24, 2009 5:16 pm

Re: Last.fm Playcount Import [MM3]

Post by bigcooper » Thu Feb 26, 2009 4:04 pm

Thanks @Psyker7 for the very fast fix!
Works (almost) perfect now.
Except regarding the problem with special characters e.g. 'Я' in "KoЯn" (hangs there). Every other character in the tags of my collection seems to work. (in my case also special German and French characters ... @AndreVonDrei: even Icelandic (æ) )

Now I only had to fix some tags that have been autocorrected by last.fm, to get (almost) all my playcounts.
With this, AutoRateAccurate can finally do its job accurately.

Oh, and Artist names are still handled case-sensitive. But wasn't a problem to change the few names that didn't match.

It's a pity that apparently tracks under 30 seconds don't get scrobbled.
But that has nothing to do with this script.

Psyker7
Posts: 255
Joined: Sat Mar 03, 2007 8:00 am

Re: Last.fm Playcount Import [MM3]

Post by Psyker7 » Thu Feb 26, 2009 5:03 pm

Oh, and Artist names are still handled case-sensitive. But wasn't a problem to change the few names that didn't match.
AFAIK queries on the database *are* case insensitive, I did as much testing on this as I could, and couldn't find any examples that would not work with artist case. If you have a specific example with your username let me know! (tag on track, and tag as in last.fm and your username)
It's a pity that apparently tracks under 30 seconds don't get scrobbled.
But that has nothing to do with this script.
What song less than 30 seconds could you possibly care about that much? :P

Taking a look at the character issue now.

AndreVonDrei

Re: Last.fm Playcount Import [MM3]

Post by AndreVonDrei » Thu Feb 26, 2009 5:57 pm

Doesn't have any Я's in my library, so it's quite strange that it comes to a halt at week 51 (out of 118).
Are there any other special characters that might do the same thing?
Keep up the good work Psyker

Psyker7
Posts: 255
Joined: Sat Mar 03, 2007 8:00 am

Re: Last.fm Playcount Import [MM3]

Post by Psyker7 » Thu Feb 26, 2009 6:04 pm

I've tracked down the issue - which is actually a last.fm xml export issue:
http://ws.audioscrobbler.com/2.0/?metho ... 1137326401
being an example.

In this case the offending character is apparently a smart quote, still working on how to extract the invalid characters from the string though - and I'm not sure what characters *are* invalid atm - got another thread going so hopefully someone more knowledgeable than me can help out :D

polywaffle
Posts: 13
Joined: Fri Oct 24, 2008 3:33 am

Re: Last.fm Playcount Import [MM3]

Post by polywaffle » Thu Feb 26, 2009 8:44 pm

Hi, This is the script ive been waiting for ever since i discovered last.fm :] however I am having a problem, it gets to about chart 21 of 178 then i get an error saying "an invalid character was found in text content" Is this something wrong with the script, or one of my tags?

My last.fm username is polywaffle, let me know if theres a log file or more info i can give. thanks.

Edit: Whoops, shoulda read the other posts first

Psyker7
Posts: 255
Joined: Sat Mar 03, 2007 8:00 am

Re: Last.fm Playcount Import [MM3]

Post by Psyker7 » Fri Feb 27, 2009 12:39 am

It's ugly and I hate it, but!

' Changes: 1.7
' - Fix: Invalid apostrophes stripped, sadly this will make things less accurate
' but will reduce error messages for the moment

I am not sure if this means that all tracks with apostrophes will no longer update or what, but it is a problem with last.fm's feeds which I cannot fix. For some reason they decided that the asci character # 25 is an apostrophe, when quite clearly it is NOTHING.

It *may* work to replace it with the *correct* character for a single quote, let me know if you want to try this (obviously none of my songs have this issue or I would have found it sooner!)

Worth noting, previous versions are avaliable at
http://psykar.com/scripts/

AndreVonDrei

Re: Last.fm Playcount Import [MM3]

Post by AndreVonDrei » Fri Feb 27, 2009 5:45 am

Hate to break it to you, but it still doesn't work.
Must be some characters that act the same way as the apostrophes.
My last.fm username is Andefrondrei, and the problem comes in week 51

polywaffle
Posts: 13
Joined: Fri Oct 24, 2008 3:33 am

Re: Last.fm Playcount Import [MM3]

Post by polywaffle » Fri Feb 27, 2009 6:24 am

Works awesome for me now, thanks! I have been waiting so long for a program/script to do this. Im suprised Last.Fm dont have a tool of their own to update local playcounts..

errOr

Re: Last.fm Playcount Import [MM3]

Post by errOr » Fri Feb 27, 2009 5:32 pm

It gives me an Error #5: Microsoft VBscript Runtime Error now.
The problematic line seems to be Line 251, Column 6 @ LastFmImport.vbs according to the error.

:(

Psyker7
Posts: 255
Joined: Sat Mar 03, 2007 8:00 am

Re: Last.fm Playcount Import [MM3]

Post by Psyker7 » Fri Feb 27, 2009 10:58 pm

AndreVonDrei wrote:Hate to break it to you, but it still doesn't work.
Must be some characters that act the same way as the apostrophes.
My last.fm username is Andefrondrei, and the problem comes in week 51
Username incorrect I'm afraid. I tried the same last.fm username as your MM username, but that only had 15 weeks of data, and worked fine.
errOr wrote: It gives me an Error #5: Microsoft VBscript Runtime Error now.
The problematic line seems to be Line 251, Column 6 @ LastFmImport.vbs according to the error.
Might want to try reinstalling and running again, I was able to do your own username fine.
If it still errors, turn logging on in the script and send me the debug file (PM me if you need help)

AndréVonDrei
Posts: 15
Joined: Fri Feb 27, 2009 10:57 am

Re: Last.fm Playcount Import [MM3]

Post by AndréVonDrei » Sat Feb 28, 2009 2:21 am

Typo in username, never good.
http://www.last.fm/user/AndreFronDrei. See if you manage to extract past week 51
Have been waiting to for a script like this since I lost a database around a year ago.

Psyker7
Posts: 255
Joined: Sat Mar 03, 2007 8:00 am

Re: Last.fm Playcount Import [MM3]

Post by Psyker7 » Sat Feb 28, 2009 6:05 pm

AndréVonDrei wrote:Typo in username, never good.
http://www.last.fm/user/AndreFronDrei. See if you manage to extract past week 51
Have been waiting to for a script like this since I lost a database around a year ago.
Well the issue is at some point you scrobbled some rediculously tagged track called:

Code: Select all

Night [Bonus Track];TP1;;;Kanye West;TAL;;;Graduation;TRK;;;14/15;TPA;;;1/1;TYE;;;2007;TCO;;
;Hip Hop/Rap;COM;;;engiTunPGAP;0;;TEN;;;iTunes v7.3.2;COM;;h;engiTunNORM; 000005C9 00000640 00004B85 00004E2F 00011CE5 00008E24 00007DE9 000082BE 0000C6FA 00005724;COM;;‚;engiTunSMPB; 00000000 00000210 00000A8C 00000000007D7E64 00000000 005D34FE 00000000 00000000 00000000 00000000 00000000 00000000;COM;;@;engiTunes_CDDB_IDs;15+1BFB8EF12FBB43C7C9AEE5319E437B8C+9833006;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Graduation
Nice track title, luckily it allowed me to find hopefully all the ascii character codes which are not valid XML :P

Update soon!

Psyker7
Posts: 255
Joined: Sat Mar 03, 2007 8:00 am

Re: Last.fm Playcount Import [MM3]

Post by Psyker7 » Sat Feb 28, 2009 7:12 pm

Hopefully all done!
Working with both SinDenial and AndreFronDrei and should also fix the issues people had with updating artists such as KoRn (with the backwards R) - the updating was going fine, but the logfile created was erroring out.

Let me know if there are more errors! (no doubt there will be :P )

' Changes: 1.8
' - Fix: Invalid ASCII characters stripped (hopefully - let me know if you find more!)
' Thanks to SinDenial and AndréVonDrei for testing!
' - More graceful error messages (for some, let me know if you get anything cryptic)
' - Check for invalid characters when writing update file - some seem to cause errors
' when the actual update went fine - needs improvment

'ToDo:
'* Smarter checking of files to update
'* Update LastPlayed time as well (if none exists)
'* Fix the update file writing to account for strange characters

http://psykar.com/scripts/LastFmImport.mmip

Peke
Posts: 12216
Joined: Tue Jun 10, 2003 7:21 pm
Location: Serbia
Contact:

Re: Last.fm Playcount Import [MM3]

Post by Peke » Sat Feb 28, 2009 9:30 pm

Few clarifications:
1. 30 Seconds Submissions http://www.last.fm/api/submissions#subs last.fm ignores (even in some cases bans) any client ID that scrobbles tracks shorter than 30 seconds. That was noted when we applied for player/software Submission ID

2. Psyker7 Ask Trixmoto , Big_Berny, Bex or search their scripts to implement correct FormatURL Function top avoid future Unicode -> URL issues. Last.fm support URL format is like IE (at least that one work the best) using "%??" format for invalid chars.
Best regards,
Pavle
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
How to add SCREENSHOTS to forum

Post Reply