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

Download and get help for different MediaMonkey for Windows 4 Addons.

モデレータ: Peke, Gurus

Psyker7
記事: 255
登録日時: 土 3 03, 2007 8:00 am

Re: Last.fm Playcount Import [MM3]

投稿記事 by Psyker7 »

Sammy20 さんが書きました:Hey great script.

Just wondering if the getting the Last Played date from last.fm into Mediamonkey is at all possible?
Havn't really had the time to look at this recently. I think I mentioned previously that some people have specifically requested for this *not* to be added :P
It's going to be a bit complicated as last.fm won't actually save the last played date, just the *week* it was last played in, so there will be some guestimation involved.
Owyn さんが書きました:Thanks for the script. I used it to import play counts for a rebuilt database. Only real problem was where last.fm had "auto-corrected" artist names. No real solution, the auto-correct only applies to recent plays, not track history and no way to rename/correct artist names in last.fm.

One word of warning, I had a podcast update (about 70 subscriptions) trigger in the middle of running this script (106 weeks, 35,000 tracks, about 10,000 play counts updated). Both your script and podcast updates are SQL intensive. Resulted in some munged podcast episodes. Recommend turning off podcast updates in options before running the script.

I re-ran the script after reviewing results and correcting some tag info. Updated just the changes. Nice.
Glad to hear it worked for ya :D
Personally I disabled the auto-correct on last.fm - but I'm not sure if it actually affects results or not to be honest - as it doesn't apply to track history, which is what this script looks up.
Funkafonik
記事: 58
登録日時: 金 2 13, 2009 12:33 pm

Re: Last.fm Playcount Import [MM3]

投稿記事 by Funkafonik »

Psyker7 さんが書きました:
Sammy20 さんが書きました:Hey great script.

Just wondering if the getting the Last Played date from last.fm into Mediamonkey is at all possible?
Havn't really had the time to look at this recently. I think I mentioned previously that some people have specifically requested for this *not* to be added :P
It's going to be a bit complicated as last.fm won't actually save the last played date, just the *week* it was last played in, so there will be some guestimation involved.
The Track History shows the last played date/time of every track you have ever scrobbled on your profile. I know this script uses the weekly charts but if that new feature was to work, it'd have to use the Track History (http://www.last.fm/user/Funkafonik/tracks). I don't know how hard it'd be, but if updating one's complete mp3 library from the Track History would be too long and tedious, maybe to add an option on the mouse right-click menu to only update the last played date/time of selected tracks? Like only updating an album or artist at a time... I think I'd actually prefer it this way, better control than updating a 20k library in one shot.
Psyker7
記事: 255
登録日時: 土 3 03, 2007 8:00 am

Re: Last.fm Playcount Import [MM3]

投稿記事 by Psyker7 »

Funkafonik さんが書きました:
Psyker7 さんが書きました:
Sammy20 さんが書きました:Hey great script.

Just wondering if the getting the Last Played date from last.fm into Mediamonkey is at all possible?
Havn't really had the time to look at this recently. I think I mentioned previously that some people have specifically requested for this *not* to be added :P
It's going to be a bit complicated as last.fm won't actually save the last played date, just the *week* it was last played in, so there will be some guestimation involved.
The Track History shows the last played date/time of every track you have ever scrobbled on your profile. I know this script uses the weekly charts but if that new feature was to work, it'd have to use the Track History (http://www.last.fm/user/Funkafonik/tracks). I don't know how hard it'd be, but if updating one's complete mp3 library from the Track History would be too long and tedious, maybe to add an option on the mouse right-click menu to only update the last played date/time of selected tracks? Like only updating an album or artist at a time... I think I'd actually prefer it this way, better control than updating a 20k library in one shot.
The time consuming bit here would actually be the xml downloading.... downloading your entire play history from last.fm is going to take a VERY LONG TIME :P

Actually... and this is odd, the API doesn't seem to have a way to pull down the entire play history anyway, only the weekly playcounts (which is what I use already)
Psyker7
記事: 255
登録日時: 土 3 03, 2007 8:00 am

Re: Last.fm Playcount Import [MM3]

投稿記事 by Psyker7 »

Well, you all asked for it:

' Changes: 2.0
' - Added support for updating last played times - these will be up to a week out though

It will prompt you with an ugly window to update lastplayed times as well (yes/no)
Seems to work OK for my database, will only update if the timestamp it finds from last.fm is newer than the existing one, and has to assume that tracks where played at 12am on the first day of the week (limitation of the last.fm API)

Let me know how it goes! I'll take a look into getting a better Confirmation box, I havn't really done much in the way of GUI programming.

Download:
http://psykar.com/scripts/LastFmImport.mmip
treponem
記事: 52
登録日時: 土 1 12, 2008 9:54 am

Re: Last.fm Playcount Import [MM3]

投稿記事 by treponem »

I'm getting also errors here,the script stops at week #86.
It says: "You have an error: Ein XML-Dokument muss ein Element der obersten Ebene enthalten." (a xml-document must have a top level element).

The problem seems to be this url:

http://ws.audioscrobbler.com/2.0/?metho ... 1226232000

Is this a problem from last.fm? Can I fix it?
最後に編集したユーザー treponem [ 木 7 16, 2009 3:43 pm ], 累計 1 回
hhggrr
記事: 15
登録日時: 木 8 24, 2006 5:33 pm

Re: Last.fm Playcount Import [MM3]

投稿記事 by hhggrr »

Getting the same error "XML document must have a top level element"
bbuchi
記事: 58
登録日時: 月 1 16, 2006 4:12 am

Re: Last.fm Playcount Import [MM3]

投稿記事 by bbuchi »

works fine by me.

thanks Bernd

(XP, SP3, MM3.1)
画像
Psyker7
記事: 255
登録日時: 土 3 03, 2007 8:00 am

Re: Last.fm Playcount Import [MM3]

投稿記事 by Psyker7 »

treponem さんが書きました:I'm getting also errors here,the script stops at week #86.
It says: "You have an error: Ein XML-Dokument muss ein Element der obersten Ebene enthalten." (a xml-document must have a top level element).

The problem seems to be this url:

http://ws.audioscrobbler.com/2.0/?metho ... 1226232000

Is this a problem from last.fm? Can I fix it?
Seems as though this page now loads correctly, try again and let me know :)

I would really hate having to code around this one... you would lose a weeks worth of data for every page which doesn't load.
treponem
記事: 52
登録日時: 土 1 12, 2008 9:54 am

Re: Last.fm Playcount Import [MM3]

投稿記事 by treponem »

Thanks Psyker7, the page loaded and the script did the work perfectly. :D
Jos

Re: Last.fm Playcount Import [MM3]

投稿記事 by Jos »

I'm also getting this "a xml-document must have a top level element" error. The problem is with week #26, the script worked perfect until now.
My last.fm username is: josvleeuwen

Is it fixable?

I really hope so, I completely depend on this script to generate my playlists.
Desertway
記事: 42
登録日時: 金 9 18, 2009 2:22 pm

Re: Last.fm Playcount Import [MM3]

投稿記事 by Desertway »

Thanks so much for this script. I have a new MM library, but a well used last.fm account. Using this script plus AutoRateAccurate let me jump right into the game instead of starting from "0". It also allows me to keep my home and work playcounts and ratings in sync. Grazi!
thegoldenvision
記事: 20
登録日時: 火 3 11, 2008 5:31 am

Re: Last.fm Playcount Import [MM3]

投稿記事 by thegoldenvision »

There seems to be an issue with the script importing duplicate playcount. I have recently rebuilt my library and used the script to import the playcounts from my Last.fm account, however, some tracks have a duplicate playcount against them if they appear on multiple albums in the library.
Example:
Foo Fighters - Monkey Wrench appears in the library on the albums The Singles (1995-2008) and The Colour and The Shape. The script has issued a playcount of 109 and a last played date of 16/08/2009 to both tracks.
Psyker7
記事: 255
登録日時: 土 3 03, 2007 8:00 am

Re: Last.fm Playcount Import [MM3]

投稿記事 by Psyker7 »

Jos さんが書きました:I'm also getting this "a xml-document must have a top level element" error. The problem is with week #26, the script worked perfect until now.
My last.fm username is: josvleeuwen

Is it fixable?

I really hope so, I completely depend on this script to generate my playlists.
Again this looks like it was a last.fm error, try again now!
thegoldenvision さんが書きました:There seems to be an issue with the script importing duplicate playcount. I have recently rebuilt my library and used the script to import the playcounts from my Last.fm account, however, some tracks have a duplicate playcount against them if they appear on multiple albums in the library.
Example:
Foo Fighters - Monkey Wrench appears in the library on the albums The Singles (1995-2008) and The Colour and The Shape. The script has issued a playcount of 109 and a last played date of 16/08/2009 to both tracks.
Unfortunately there is no easy way around this. I figured it was better to update tracks from all albums rather than none. Last.fm's feeds don't display which album an individual track you played was from, rather something like this:

コード: 全て選択

<track rank="1">
<artist mbid="ad61e25e-5516-41e1-b60d-744e8220986e">Shiny Toy Guns</artist>
<name>Ghost Town</name>
<mbid/>
<playcount>3</playcount>
<url>www.last.fm/music/Shiny+Toy+Guns/_/Ghost+Town</url>
</track>
Funkafonik
記事: 58
登録日時: 金 2 13, 2009 12:33 pm

Re: Last.fm Playcount Import [MM3]

投稿記事 by Funkafonik »

I've just noticed that in the last update on Last.FM, they have updated their API to add "user.getRecentTracks", allowing to fetch all our listening history to the same level of detail as is available on our profile.

http://www.last.fm/api/show?service=278

This would make this script more precise for the Last Played dates and also playcounts, since the weekly charts don't update if you delete some tracks from your history afterwards.
Psyker7
記事: 255
登録日時: 土 3 03, 2007 8:00 am

Re: Last.fm Playcount Import [MM3]

投稿記事 by Psyker7 »

Great spotting!
I'll get onto this tonight sometime, shouldn't be too difficult.
返信する