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

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

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

Re: Last.fm Playcount Import [MM3]

Post by AndréVonDrei » Sun Mar 01, 2009 5:38 am

Works like a charm. Thank you very much.
Just have to say: AutoRateAccurate, here I come...

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

Re: Last.fm Playcount Import [MM3]

Post by Psyker7 » Sun Mar 01, 2009 5:43 am

AndréVonDrei wrote:Works like a charm. Thank you very much.
Just have to say: AutoRateAccurate, here I come...
Glad to hear it!

And that's the exact reason I wrote the script to start with :D

cotp
Posts: 46
Joined: Fri May 11, 2007 7:53 am
Location: France

Re: Last.fm Playcount Import [MM3]

Post by cotp » Sun Mar 01, 2009 6:58 am

Hello everyone,

I can't seem to make the script work, I am getting an error message (tried 1.7 and 1.8 ) here:

Image

Hope you can try and help me. Is it because my usename contains some "-" caracters ? Or is it another problem ?

Cotp

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

Re: Last.fm Playcount Import [MM3]

Post by Psyker7 » Sun Mar 01, 2009 7:04 am

cotp wrote:Hello everyone,

I can't seem to make the script work, I am getting an error message (tried 1.7 and 1.8 ) here:

Image

Hope you can try and help me. Is it because my usename contains some "-" caracters ? Or is it another problem ?

Cotp
Mind PM'ing me your last.fm username then?
It's a little strange that error, because that function should exist as long as you have windows installed...

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

Re: Last.fm Playcount Import [MM3]

Post by Psyker7 » Sun Mar 01, 2009 7:08 am

Peke wrote: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.
Thanks, ironic thing is I'm already using a URL correction function found in one of Tknojnky's scripts, allegedly written by psyxnova and trixmoto :D

Code: Select all

Function fixurl(sRawURL)
	' Original psyxonova improved by trixmoto
Sadly the issue here wasn't with badly encoded URLs, but rather with badly encoded XML strings, caused by a combination of badly tagged music originally (which happens) and last.fm not sanity checking scrobbles / XML output for invalid ASCII characters.

Funkafonik
Posts: 58
Joined: Fri Feb 13, 2009 12:33 pm

Re: Last.fm Playcount Import [MM3]

Post by Funkafonik » Sun Mar 01, 2009 10:25 am

That's great that the script now updates the LastPlayed field!

Only thing though is I've since updated the playcounts of my favorite bands and albums by hand in MM and I don't wanna risk running this script to get the LastPlayed and have all my work overwritten. Is there a way to ONLY update the LastPlayed and not the playcounts?

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

Re: Last.fm Playcount Import [MM3]

Post by AndréVonDrei » Sun Mar 01, 2009 11:25 am

Funkafonik wrote:That's great that the script now updates the LastPlayed field!

Only thing though is I've since updated the playcounts of my favorite bands and albums by hand in MM and I don't wanna risk running this script to get the LastPlayed and have all my work overwritten. Is there a way to ONLY update the LastPlayed and not the playcounts?
If you only want to update the LastPlayed, it might be a good idea to check out Bex's AddRemove PlayStat script. Combine those two scripts, and you propably get what you are looking for.

Funkafonik
Posts: 58
Joined: Fri Feb 13, 2009 12:33 pm

Re: Last.fm Playcount Import [MM3]

Post by Funkafonik » Sun Mar 01, 2009 11:34 am

AndréVonDrei wrote:
If you only want to update the LastPlayed, it might be a good idea to check out Bex's AddRemove PlayStat script. Combine those two scripts, and you propably get what you are looking for.
Really? That's what I use to change the playcounts, how can I update the LastPlayed from Last.FM with it?

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

Re: Last.fm Playcount Import [MM3]

Post by Psyker7 » Sun Mar 01, 2009 2:51 pm

Funkafonik wrote:That's great that the script now updates the LastPlayed field!

Only thing though is I've since updated the playcounts of my favorite bands and albums by hand in MM and I don't wanna risk running this script to get the LastPlayed and have all my work overwritten. Is there a way to ONLY update the LastPlayed and not the playcounts?
This script does not currently update the last played time so not sure what's happening there :p
With all the other scripts out there to do so and all the crap with play histories and stuff I thought it might be best to leave it out of this one. If enogih people do want it I'll take another look though, understand it's not likely to be particuarly accurate as it will only know what week a song was last played during.

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

Re: Last.fm Playcount Import [MM3]

Post by Psyker7 » Sun Mar 01, 2009 7:37 pm

' Changes: 1.9
' - Fix: Last.FM usernames not parsing correctly if containing special chars

What I get for copy pasting other peoples code, the function name is actually supposed to be "Hex" not "DecToHex"
Go figure.

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

cotp
Posts: 46
Joined: Fri May 11, 2007 7:53 am
Location: France

Re: Last.fm Playcount Import [MM3]

Post by cotp » Mon Mar 02, 2009 7:08 am

Psyker7 wrote:' Changes: 1.9
' - Fix: Last.FM usernames not parsing correctly if containing special chars

What I get for copy pasting other peoples code, the function name is actually supposed to be "Hex" not "DecToHex"
Go figure.

http://psykar.com/scripts/LastFmImport.mmip
Thanks for the fix Psyker7. Worked well :)

Now when I use Tagging Inconsistencies 3.9.4 (2009-01-10), it says More Playcount than in MM internal history (try it)... Something missing ?

Cotp

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

Re: Last.fm Playcount Import [MM3]

Post by Psyker7 » Mon Mar 02, 2009 11:09 pm

cotp wrote:
Now when I use Tagging Inconsistencies 3.9.4 (2009-01-10), it says More Playcount than in MM internal history (try it)... Something missing ?

Cotp
Due to the fact that Tagging inconsistancies and the Playstat editor exist, I'm leaving internal history plays and last played time alone for the moment, mainly due to the fact that you cannot accurately get the exact played time of a track from last.fm if it's more than a month ago.
If this isn't an issue for people I can start looking into it, but it's likely to take a while, as I'll have to compare current histories in MM vs. weekly histories on last.fm and what to do if we can't reconcile them etc.

Any ideas on how you would like this to work are welcome!

Unfoldingdrama
Posts: 15
Joined: Fri Nov 09, 2007 10:11 pm

Re: Last.fm Playcount Import [MM3]

Post by Unfoldingdrama » Fri Mar 06, 2009 12:57 pm

Hi,

Your script looks excellent, however I'm unable to get it to fully execute. When downloading the weekly charts I receive an error on week 93.

"You have an error: An invalid character was found in text content."

This is then followed by a series of runtime errors that Media Monkey throws up. My Last.fm username is the same as my username on this board.

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

Re: Last.fm Playcount Import [MM3]

Post by Psyker7 » Tue Mar 10, 2009 7:36 am

Unfoldingdrama wrote:Hi,

Your script looks excellent, however I'm unable to get it to fully execute. When downloading the weekly charts I receive an error on week 93.

"You have an error: An invalid character was found in text content."

This is then followed by a series of runtime errors that Media Monkey throws up. My Last.fm username is the same as my username on this board.
Fixed, sorry it took so long.

Does anyone know a definitive list of invalid XML characters? I can't seem to find one anywhere :|

' Changes: 1.10
' - Fix: More invalid xml characters checked

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

Unfoldingdrama
Posts: 15
Joined: Fri Nov 09, 2007 10:11 pm

Re: Last.fm Playcount Import [MM3]

Post by Unfoldingdrama » Tue Mar 10, 2009 8:50 am

No need to apologize, It's your own time, sweat and tears. I am eternally grateful for this though. It works perfectly and I have been able to retrieve a lot of playcounts for files that became corrupted when I reorganised my library over a year ago.

The plugin works perfectly and I just wanted to say thank you for all the work you put into it.

Post Reply