Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Where to get Artist's country? (Read 2672 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Where to get Artist's country?

Does someone know where I could get the country ISO code (or the country and I will do the conversion myself) for a given track/artist?
Have taken a look at picard, but they only give the release country (of the album). Last.fm SMP scripts and similar give many info but not the country (and I would prefer to not create a scrapper from scratch). I would strongly prefer a method which allows to save the data to tags, otherwise I could live with saving data to json via SMP scripts. In any case I want the data available offline.

I'm currently working on a UI panel, where the artist is placed on a mercator map given some lat/long. I have all working but the metadata part. At some point I will make it interactive, to create autoplaylist according to the place selected, etc.
X

Re: Where to get Artist's country?

Reply #1
Dunno about genre-universal sources. If you have a lot of bands listed at the Metal Archives, there is an Mp3tag script - but you won't find Emmylou there, and I don't know about how to automate it.

Re: Where to get Artist's country?

Reply #2
RateYourMusic has reliably sourced country data for origin and current location. I don't know about automatic queries. An API was planned for the future.

Re: Where to get Artist's country?

Reply #3
Discogs>Artist>Profile - The artist's country is not always present, but it often it is, and so is the date of birth, as well.
Quis custodiet ipsos custodes?  ;~)

Re: Where to get Artist's country?

Reply #4
Last.fm SMP scripts and similar give many info but not the country (and I would prefer to not create a scrapper from scratch). I would strongly prefer a method which allows to save the data to tags

Last I checked WilB's Biography script gets Last.fm artist location (multi-value) and can write it to tags. From the docs -

Quote
Locale Last.fm writes "Founded In" (groups) or "Born In" (artists) as read from last.fm bio (supports language variants). The tag is multivalue for maximum flexibility. %locale last.fm% or $meta(locale last.fm) should display as written in the biography

$meta(locale last.fm,0) // returns first value, usually town/city, e.g. The Beatles -> Liverpool; Madonna -> Bay City

$meta(locale last.fm,$sub($meta_num(locale last.fm),1)) // returns last value, usually country, e.g. United Kingdom or United States

Re: Where to get Artist's country?

Reply #5
Dunno about genre-universal sources. If you have a lot of bands listed at the Metal Archives, there is an Mp3tag script - but you won't find Emmylou there, and I don't know about how to automate it.
As far as I see there is no country tag there, I could add it to the script but seeing it only finds a sub group of possible genres better to use other thing.

Quote
RateYourMusic has reliably sourced country data for origin and current location. I don't know about automatic queries. An API was planned for the future.
Quote
Discogs>Artist>Profile - The artist's country is not always present, but it often it is, and so is the date of birth, as well.
Could be useful at some point, but I would need to create a scrapper myself...

Last.fm SMP scripts and similar give many info but not the country (and I would prefer to not create a scrapper from scratch). I would strongly prefer a method which allows to save the data to tags

Last I checked WilB's Biography script gets Last.fm artist location (multi-value) and can write it to tags. From the docs -

Quote
Locale Last.fm writes "Founded In" (groups) or "Born In" (artists) as read from last.fm bio (supports language variants). The tag is multivalue for maximum flexibility. %locale last.fm% or $meta(locale last.fm) should display as written in the biography

$meta(locale last.fm,0) // returns first value, usually town/city, e.g. The Beatles -> Liverpool; Madonna -> Bay City

$meta(locale last.fm,$sub($meta_num(locale last.fm),1)) // returns last value, usually country, e.g. United Kingdom or United States

Have taken a look at it and you are right although there is a problem. As far as I have checked, to write the tags you have to do shift/r_button/write tags to selected track/proceed

But Tags are only written if the data has been already downloaded. Is there a way to download the data for the entire library? (without using the "preview" plugin, scheduler plugin or creating a smp script myself)
The idea is not only making it work for me but other users will need to get the tag following the same steps.

Apart from that works perfectly now:
X
X



 

Re: Where to get Artist's country?

Reply #8
If the files are tagged with MBIDs, with the musicbrainz.org API you could get the country and iso code if available.
Eg
http://musicbrainz.org/ws/2/artist/5b11f4ce-a62d-471e-81fc-a69a8278c7da?fmt=json


Current statistics
https://musicbrainz.org/statistics/countries

You would have to script the process though.
I will take a look at that. Thanks!
Already solved the iso code conversion using a table lookup via scripts anyway, but it's nice to get that value directly on tags too.

I thought about musicbrainz.org at first, but only had experience with some basic plugin editing to get data from acoustID.org so I abandoned the idea. Your comment has made me recheck the plugin list and just saw the  'Album Artist Website' plugin which essentially contains all the code -within picard- to get an arbitrary tag from musicbrainz server for a given artist, so I will fork it and use it to get the country code and maybe other tags. I found that solution specially interesting, since then it can be shared and used easily by others too.

As already mentioned, WilB's Biography s works too, with the limitation of tagging being only available after last.fm data has been already downloaded. So my plan is to use both. Using WilB's Biography variables as fallback when tags are not found on files (if he adds my suggestion) .