# \[WS\] Last.fm

**URL:** https://community.mp3tag.de/t/ws-last-fm/5717
**Category:** Web Sources Scripts
**Created:** [November 9, 2007, 8:50am UTC](https://community.mp3tag.de/t/ws-last-fm/5717 "2007-11-09T08:50:56Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![anon40879270](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/8797f3/32.png) [@anon40879270](https://community.mp3tag.de/u/anon40879270)
#### Post date: [August 20, 2015, 7:36pm UTC](https://community.mp3tag.de/t/ws-last-fm/5717/22 "2015-08-20T19:36:32Z")

</div>

> [@dano](#):
>
> - Use first 3 (or more) artist top tags as genre[/i]

Mein von Dir angepasstes Script "Last.fm#Top Tags 3 Genres\_to\_FILETYPE" funktioniert nicht mehr. Hat last.fm etwas geändert? Auch "Import Artist picture as cover (big)" geht nicht mehr.

---

<div class="post-metadata">

### Author: ![billzkid](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/ec9cab/32.png) [@billzkid](https://community.mp3tag.de/u/billzkid)
#### Post date: [August 21, 2015, 5:28am UTC](https://community.mp3tag.de/t/ws-last-fm/5717/23 "2015-08-21T05:28:57Z")

</div>

Last.fm changed their site and their API wasn't working for a few days, but now it actually works it just doesn't match any artists.

Can someone more capable than me, check if they've chaned the API?

---

<div class="post-metadata">

### Author: ![anon40879270](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/8797f3/32.png) [@anon40879270](https://community.mp3tag.de/u/anon40879270)
#### Post date: [August 21, 2015, 8:32am UTC](https://community.mp3tag.de/t/ws-last-fm/5717/24 "2015-08-21T08:32:42Z")

</div>

Ich verstehe den letzten Satz so: Kann jemand, der fähiger ist als ich, überprüfen, ob die API geändert wurde?

---

<div class="post-metadata">

### Author: ![billzkid](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/ec9cab/32.png) [@billzkid](https://community.mp3tag.de/u/billzkid)
#### Post date: [August 21, 2015, 8:51am UTC](https://community.mp3tag.de/t/ws-last-fm/5717/25 "2015-08-21T08:51:06Z")

</div>

Yes 🙂

---

<div class="post-metadata">

### Author: ![heisubo](https://community.mp3tag.de/user_avatar/community.mp3tag.de/heisubo/32/218_2.png) [@heisubo](https://community.mp3tag.de/u/heisubo)
#### Post date: [August 23, 2015, 2:40pm UTC](https://community.mp3tag.de/t/ws-last-fm/5717/26 "2015-08-23T14:40:36Z")

</div>

> [@dano](#):
>
> - Use first 3 (or more) artist top tags as genre[/i]

Hallo Dano,  
das o. g. Script funktioniert seit einigen Tagen nicht mehr. Liegt es an mir oder wurde die API von LastFm geändert? Dein Script wurde über 4000mal heruntergeladen. Es müssten also viele User ein ähnliches Problem haben. Im Forum habe ich darauf keinen Hinweis gefunden. Lieber Dano, würdest Du Dein Script 'mal überprüfen?  
Gruß Susanne

---

<div class="post-metadata">

### Author: ![fuzzed](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/53a042/32.png) [@fuzzed](https://community.mp3tag.de/u/fuzzed)
#### Post date: [October 8, 2015, 7:29am UTC](https://community.mp3tag.de/t/ws-last-fm/5717/27 "2015-10-08T07:29:21Z")

</div>

First of all, thanks for making this script Dano I absolutely love it! Been using it forever now and made tagging so much better!

It is however still not working sadly ☹

Anyone have any idea how to get it working again, missing it very much.

Regards,

Fuzzed ![:music:](https://community.mp3tag.de/uploads/default/original/1X/2ba05d1ade5eb0d15fc173be6f717dbe63890a70.gif ":music:")

---

<div class="post-metadata">

### Author: ![anon40879270](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/8797f3/32.png) [@anon40879270](https://community.mp3tag.de/u/anon40879270)
#### Post date: [October 18, 2015, 10:53am UTC](https://community.mp3tag.de/t/ws-last-fm/5717/28 "2015-10-18T10:53:37Z")

</div>

> [@fuzzed](#):
>
> ... thanks for making this script Dano I absolutely love it! ...

Ich möchte mich nochmal in Erinnerung bringen mit meiner Frage nach einer neuen Version lastfm.zip. Ist es so, dass lediglich die Schnittstelle von lastfm einseitig geändert wurde oder dass überhaupt kein Zugriff auf die lastfm-Datenbank möglich ist. Kann jemals mit einem neuen [Script](https://community.mp3tag.de/t/5717/1)_Use first 3 (or more) artist top tags as genre_ gerechnet werden?

---

<div class="post-metadata">

### Author: ![Woody](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/w/ac91a4/32.png) [@Woody](https://community.mp3tag.de/u/Woody)
#### Post date: [August 15, 2016, 5:13pm UTC](https://community.mp3tag.de/t/ws-last-fm/5717/29 "2016-08-15T17:13:55Z")

</div>

> [@mbaa3](#):
>
> Kann jemals mit einem neuen [Script](https://community.mp3tag.de/t/5717/1)_Use first 3 (or more) artist top tags as genre_ gerechnet werden?

Für [Picard](https://picard.musicbrainz.org) gibt es ein [Plugin](https://github.com/fdemmer/Picard-Last.fm.ng-Plugin), das drei Genres unterstützt und intern mit der last.fm API v2.0 arbeitet. [Download](https://github.com/fdemmer/Picard-Last.fm.ng-Plugin/releases) (Letztes Update: v0.14 vom 25. Nov. 2015)

Angenehmer Seiteneffekt: Man umgeht die [Probleme mit dem MusicBrainz Web Source Script](https://community.mp3tag.de/t/3591/89)

Da ich auch weiterhin das [Web Source Script für Metal Archives](https://community.mp3tag.de/t/5923/1) nutzen will bzw. muss, weil es kein MA Plugin für Picard zu geben scheint, ist es zumindest für mich ein sowohl-als-auch: Erst Picard, dann mp3tag - leider

---

<div class="post-metadata">

### Author: ![bongo110](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/9fc29f/32.png) [@bongo110](https://community.mp3tag.de/u/bongo110)
#### Post date: [November 7, 2016, 7:50am UTC](https://community.mp3tag.de/t/ws-last-fm/5717/30 "2016-11-07T07:50:50Z")

</div>

Hello, uisng mp3tag 2.79 and wants to update also the genre tag with last.fm.  
Unfortunaltely last.fm script does not work any longer.  
Any update is appreciated.

---

<div class="post-metadata">

### Author: ![sadsack5000](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/a587f6/32.png) [@sadsack5000](https://community.mp3tag.de/u/sadsack5000)
#### Post date: [November 17, 2016, 1:28am UTC](https://community.mp3tag.de/t/ws-last-fm/5717/31 "2016-11-17T01:28:57Z")

</div>

Confirmed, running v2.9 and last.fm source dead here also  
Please update

---

<div class="post-metadata">

### Author: ![fuzzed](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/53a042/32.png) [@fuzzed](https://community.mp3tag.de/u/fuzzed)
#### Post date: [February 12, 2017, 4:21pm UTC](https://community.mp3tag.de/t/ws-last-fm/5717/32 "2017-02-12T16:21:13Z")

</div>

Hey mates, someone explained to me how to fix the script, I only applied it to the 'Last.fm#Top Tags 3 Genres.src' script but it should work similar for the others (1 genre, artist pic, etc.) Open it with Notepad++ or something similar to edit and save.

Improved: Last.fm#Top Tags 3 Genres.src

```
# Mp3tag (2.38 or higher) Parsing for Last.fm by dano
# Save it in your Mp3tag data directory, 
# e.g. C:\Documents and Settings\*username*\Application Data\Mp3tag\data\sources
#
#	DO NOT COPY/MODIFY AND REDISTRIBUTE THIS WITHOUT PERMISSION
#
# Get the first 3 Top Tags as Genre to categorize your music
#
[Name]=Last.fm TopTags
[BasedOn]=www.last.fm
[AlbumUrl]=http://ws.audioscrobbler.com/2.0/?method=artist.gettoptags&artist=%s&api_key=YOUR_API_KEY
[WordSeperator]=+
[SearchBy]=$replace(%artist%,/,'%'252F,&,'%'2526)
[Encoding]=url-utf-8

[ParserScriptAlbum]=...
# ###################################################################
# A L B U M
# ###################################################################
#debug "on" "C:\debug_Last.fm-Artist-TopTags_B.html" "20"

joinuntil "</toptags>"

regexpreplace "(?<=<name>)(\l)" "\u$1"
regexpreplace "\s(\l)" " \u$1"
regexpreplace "-(\l)" "-\u$1"

outputto "Genre"

findinline "<name>"
sayuntil "</name>"
findinline "</tag>" 1 1
if "<tag"
    do  
        say ", "
        findinline "<name>"
        sayuntil "</name>"
        
        findinline "</tag>" 1 1
    while "<tag" 1 # Change second parameter to determine the amount of style tags 1=3 Genres, 2=4 Genres,...
endif

```

Line 11 was changed, the only thing you need to do is insert your personal API key where it says 'YOUR\_API\_KEY' on line 11. You can register or login to Last.fm and obtain one here: [http://www.last.fm/api/account/create](http://www.last.fm/api/account/create)

Only Contact email and Application name are required, and can be filled out with whatever you like. You do not need to access the provided email account to verify anything. Click Submit and copy/paste the API Key over YOUR\_API\_KEY in the line above

Good luck with it! It worked for me, it should for you. Am a happy man today.

Explanation by person that helped me:

> [@](#):
>
> Incidentally, this was a no-brainer for me. I had to resolve the exact same issue with the O\*\*\*\*\* userscript I adopted several years ago, as the original author had abandoned it and it was still using the no longer supported 1.0 API calls for Last.fm. M\*\*\*\*\*\*\* figured out why the API calls were no longer working and directed me to the correct 2.0 calls to replace them with, and also determined that the original API Key which the original script author hardcoded into the script ten years ago had been disabled by Last.fm as well - so with 2.0 calls and a new key everything resumed working normally (hence I assumed updating the API call URL and adding a working key would likely restore your code to working order.) So I updated the script to force each user to obtain and enter their own key, so it wouldn't fail for everyone if a single key died down the road, and everyone knows how to replace it if their own key stops working.

---

<div class="post-metadata">

### Author: ![ouisltagger](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ouisltagger/32/242_2.png) [@ouisltagger](https://community.mp3tag.de/u/ouisltagger)
#### Post date: [March 17, 2017, 7:58pm UTC](https://community.mp3tag.de/t/ws-last-fm/5717/33 "2017-03-17T19:58:48Z")

</div>

> [@fuzzed](#):
>
> Hey mates, someone explained to me how to fix the script, I only applied it to the 'Last.fm#Top Tags 3 Genres.src' script but it should work similar for the others (1 genre, artist pic, etc.)...

Thanks so much, been waiting for this for a LONG time! I edited it to do just the ONE top tag by deleting the last couple of lines:

```
findinline "</tag>" 1 1
if "<tag"
do
say ", "
findinline "<name>"
sayuntil "</name>"

findinline "</tag>" 1 1
while "<tag" 1 # Change second parameter to determine the amount of style tags 1=3 Genres, 2=4 Genres,...
endif

```

A change that would be super helpful would be if it could do a selection of multiple artists in one go in mp3tag, rather than just one artist at a time. (If multiple artists are selected, I'm sure you know, it only applies the genre pulled from the first artist it finds) Any chance that would be a possibility?

---

<div class="post-metadata">

### Author: ![rama](https://community.mp3tag.de/user_avatar/community.mp3tag.de/rama/32/10166_2.png) [@rama](https://community.mp3tag.de/u/rama)
#### Post date: [June 24, 2017, 2:34am UTC](https://community.mp3tag.de/t/ws-last-fm/5717/34 "2017-06-24T02:34:47Z")

</div>

QUOTE (ouisltagger @ Mar 17 2017, 22:58) \<{POST\_SNAPBACK}\>

Thanks so much, been waiting for this for a LONG time! I edited it to do just the ONE top tag by deleting the last couple of lines:

```
findinline "</tag>" 1 1
if "<tag"
do
say ", "
findinline "<name>"
sayuntil "</name>"

findinline "</tag>" 1 1
while "<tag" 1 # Change second parameter to determine the amount of style tags 1=3 Genres, 2=4 Genres,...
endif

```

A change that would be super helpful would be if it could do a selection of multiple artists in one go in mp3tag, rather than just one artist at a time. (If multiple artists are selected, I'm sure you know, it only applies the genre pulled from the first artist it finds) Any chance that would be a possibility?

  
hi  
i got always this error , can i fix it?  
 ![](http://i.imgur.com/6TSSUdX.png)  
thanks

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [June 24, 2017, 5:19am UTC](https://community.mp3tag.de/t/ws-last-fm/5717/35 "2017-06-24T05:19:07Z")

</div>

Check whether mp3tag has access to the internet at all or whether it is blocked e.g. by the firewall:  
Use function Help\>Check for new version.  
If you do not get a message box then MP3tag is blocked.

---

<div class="post-metadata">

### Author: ![rama](https://community.mp3tag.de/user_avatar/community.mp3tag.de/rama/32/10166_2.png) [@rama](https://community.mp3tag.de/u/rama)
#### Post date: [June 25, 2017, 12:31pm UTC](https://community.mp3tag.de/t/ws-last-fm/5717/36 "2017-06-25T12:31:11Z")

</div>

hi  
i have checked it works , i can connect to the net  
i use now the script @ post 1 [#1 post](https://community.mp3tag.de/t/5717/1)  
thanks

---

<div class="post-metadata">

### Author: ![rama](https://community.mp3tag.de/user_avatar/community.mp3tag.de/rama/32/10166_2.png) [@rama](https://community.mp3tag.de/u/rama)
#### Post date: [December 31, 2017, 9:26am UTC](https://community.mp3tag.de/t/ws-last-fm/5717/37 "2017-12-31T09:26:51Z")

</div>

> [@ohrenkino](#):
>
> Check whether mp3tag has access to the internet at all or whether it is blocked e.g. by the firewall:  
> Use function Help\>Check for new version.  
> If you do not get a message box then MP3tag is blocked.

hi  
is there a way to change the "\\" with ";"  
thanks

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [January 4, 2018, 9:16am UTC](https://community.mp3tag.de/t/ws-last-fm/5717/38 "2018-01-04T09:16:07Z")

</div>

> [@rama](#):
>
> hi  
> is there a way to change the "\\" with ";"  
> thanks

The \\ looks to me like the indicator for a multi-value field.  
You can merge several fields of the same type to just one with an action of the type  
Merge duplicate fields [https://docs.mp3tag.de/actions/merge-duplicate-fields](https://docs.mp3tag.de/actions/merge-duplicate-fields)  
There you can also set the separator.

---

<div class="post-metadata">

### Author: ![rama](https://community.mp3tag.de/user_avatar/community.mp3tag.de/rama/32/10166_2.png) [@rama](https://community.mp3tag.de/u/rama)
#### Post date: [January 4, 2018, 9:55am UTC](https://community.mp3tag.de/t/ws-last-fm/5717/39 "2018-01-04T09:55:40Z")

</div>

> [@ohrenkino](#):
>
> The \\ looks to me like the indicator for a multi-value field.  
> You can merge several fields of the same type to just one with an action of the type  
> Merge duplicate fields [https://docs.mp3tag.de/actions/merge-duplicate-fields](https://docs.mp3tag.de/actions/merge-duplicate-fields)  
> There you can also set the separator.

hi  
i mean the script add many keywords separated by \\ , i would like to change the script to add many keywords separated by ;  
thanks  
happy new year in late 😉

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [January 4, 2018, 9:58am UTC](https://community.mp3tag.de/t/ws-last-fm/5717/40 "2018-01-04T09:58:13Z")

</div>

> [@rama](#):
>
> hi  
> i mean the script add many keywords separated by \\ , i would like to change the script to add many keywords separated by ;  
> thanks  
> happy new year in late 😉

The scripts are plain text, so you can edit them as you like.  
If you feel uncomfortable with the scripting language, you could use the action as an alternative.

---

<div class="post-metadata">

### Author: ![h4de5](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/h/5daacb/32.png) [@h4de5](https://community.mp3tag.de/u/h4de5)
#### Post date: [August 8, 2018, 10:52pm UTC](https://community.mp3tag.de/t/ws-last-fm/5717/41 "2018-08-08T22:52:31Z")

</div>

I adapted the script from dano, so it can be used to get correct title, artist. album, cover and genre. it does work with the current last.fm API 2.0 - you still need to create an API account as described before.  
also I could not find a way, to make the parser "fool proof" - which means, if last.fm does not have a genre set, the script will throw an error:

> <https://gist.github.com/h4de5/4425d31e525e362110d88d850f07c9d6>

best regards

[Previous page](https://community.mp3tag.de/t/ws-last-fm/5717.md?page=1)

[Next page](https://community.mp3tag.de/t/ws-last-fm/5717.md?page=3)
