View Full Version : code to access AMG website from girder 4
mhwlng
June 7th, 2005, 02:48 PM
via a link in my sig., you can get a .lua file to help access the AMG,Rolling Stone & last.fm website from Girder 4/5.
put it in luascript\marcel and call like :
require "marcel\\AMG"
local AMGDATA = {}
AMGDATA = Marcel.AMG.GetAMG("Alison Krauss","test")
if (AMGDATA ~= nil) then
print (AMGDATA.Biography);
end
(see below for a more elaborate example)
functionality :
* returns artist biography
* writes all artist related images to disk (AMG+Rolling Stone+last.fm)
* returns table with all 'main albums' for the artist : title, release year, amg pick, rating (-1=not rated)
* returns table for selected album with : album cover, review, release year, genre, amg pick, rating, track list (name, track#, amg pick)
* returns table with similar artists from Jinzora and Last.FM
* get album cover from Amazon
The main requirement is a 112 hex-character 'token' that identifies your (free) AMG account.
So you must have an account and auto-logon set up!!!
Your token string will automatically be read from the AMG cookie stored in your internet explorer cache....
for the amazon stuff to work, you need to request an access key id at http://aws.amazon.com (http://aws.amazon.com/) (create an account)
then you need to create a [string] key in the registry :
Code:
HKEY_LOCAL_MACHINE\SOFTWARE\Promixis\Girder\4\Amaz onAccessKeyID
and enter the key...
Note that the AMG website is pretty slow, so you need a lot of patience...
Don't think that girder has crashed. it's just busy....
you need the most recent build of G4
Marcel
birty
June 7th, 2005, 04:13 PM
if the process is slow then it should be run in a seperate thread rather than locking up the main girder thread
mhwlng
June 8th, 2005, 03:06 PM
added functionality to get all artist images and write them to disk
I then display those images in NR via the embedded web browser :
(see end of this thread)
http://www.promixis.com/phpBB2/viewtopic.php?t=10022
Marcel
mhwlng
June 9th, 2005, 03:20 PM
The next step is to link this with JRMC.
luacom/MCIO is used to connect to JRMC and retrieve the artist list.
more info about MCIO here (G3) :
http://www.promixis.com/phpBB2/viewtopic.php?t=11520
require "marcel\\JRMC"
require "marcel\\AMG"
local Artist_objects = {}
Artist_objects = Marcel.JRMC.GetArtistList()
for i = 1, table.getn (Artist_objects) do
print (Artist_objects[i].title);
local AMGDATA = {}
AMGDATA = Marcel.AMG.GetAMG(Artist_objects[i].title,"")
end
JRMC.LUA is also available for download at address in my sig.
functionality :
* returns table with : artist names
* returns table with albums for selected artist : title,year,genre,complete album,review,bios
* function to write to any field for all tracks in an album
* function to write to year field for all tracks in an album
* function to write to album art field for all tracks in an album
* function to get all tracks in a smartlist
Marcel
mhwlng
June 13th, 2005, 03:47 PM
code updated to read album review and artist biography from AMG for all albums in JRMC that don't have one and then write it to all tracks in that album....
(AMG artist images are also written to disk)
require "marcel\\JRMC"
require "marcel\\AMG"
local Artist_objects = {}
Artist_objects = Marcel.JRMC.GetArtistList()
for i = 1, table.getn (Artist_objects) do
print (Artist_objects[i].name);
local Album_objects = {}
Album_objects = Marcel.JRMC.GetAlbumList(Artist_objects[i].name)
for j = 1, table.getn (Album_objects) do
print (" "..Album_objects[j].title);
local AMGDATA = {}
AMGDATA = Marcel.AMG.GetAMG(Artist_objects[i].name,Album_objects[j].title)
if (AMGDATA ~= nil) then
if (string.len(AMGDATA.AlbumReview)>100) then
print (AMGDATA.AlbumReview);
Marcel.JRMC.WriteAlbumTag (Artist_objects[i].name,Album_objects[j].title,"Review",AMGDATA.AlbumReview)
end
if (string.len(AMGDATA.Biography)>100) then
print (AMGDATA.Biography);
Marcel.JRMC.WriteAlbumTag (Artist_objects[i].name,Album_objects[j].title,"Bios",AMGDATA.Biography)
end
end
end
end
Marcel
mhwlng
June 15th, 2005, 01:36 PM
added album genre, album release year and album cover....
Marcel
mhwlng
June 16th, 2005, 02:34 PM
updated code to return a table with all the 'main albums'+years for the selected artist
mhwlng
July 6th, 2005, 11:35 AM
In the latest A23, win.InternetGetCookie has been changed for some reason ????
(I can't find any documentation, but it looks like cookie and err are reversed and final ';' is removed from the cookie string. jump in, Mike C, if I'm wrong)
Updated AMG.lua to fix this...
Marcel
Promixis
July 6th, 2005, 11:46 AM
Hm, I didn't INTENTIONALLY change anything :D
are you sure? I haven't touched that code since we first worked on it.
mhwlng
July 6th, 2005, 12:13 PM
are you sure?
well, apparently not...
The order of cookie and err hasn't changed, as I thought previously...
I don't know where the semicolon went, but it is probably that the cookie data is written slightly different by the amg webserver
my mistake, Sorry
Marcel
mhwlng
May 17th, 2006, 05:41 AM
updated for the latest release of AMG...
also added a function to get artist images from
http://www.rollingstone.com
these are nicer images than the ones on AMG....
(note that for some artists, there are > 300 images available)
I create a slideshow in NetRemote with these images for the artist of the currently playing track......
an example of the slideshow is at the end of the movie from :
http://www.promixis.com/forums/showthread.php?t=14221
Marcel
mhwlng
May 19th, 2006, 12:12 PM
added functions to get table with similar artists from
http://www.last.fm (formerly audioscrobbler)
and
http://www.jinzora.org
you don't need an account to use these functions...
aa =Marcel.AMG.GetLastFmSimilarArtists("Fun Lovin' Criminals");
bb =Marcel.AMG.GetJinzoraSimilarArtists("Fun Lovin' Criminals");
Marcel
mhwlng
June 3rd, 2006, 05:07 AM
see at the bottom of this thread, for an example on how to integrate last.fm data with NetRemote :
http://www.promixis.com/forums/showthread.php?t=14221
Marcel
mhwlng
June 3rd, 2006, 09:47 AM
updated both .lua files
added
* Marcel.JRMC.WriteAlbumImage to write the album image to all files in an album
* Marcel.JRMC.GetPlaylist which returns all files in a playlist
exposed:
* Marcel.AMG.WritePicture which writes an image from a url to disk
if you define a JRMC smartlist like :
Albums Imported Today
[date imported]=<1d ~nodup=[Artist],[Album]
then you can use the following code to add AMG/Rolling Stone data (review,bio,year,genre,cover art,artist pictures) to newly imported tracks :
require "marcel\\JRMC"
require "marcel\\AMG"
local Track_objects = {}
Track_objects = Marcel.JRMC.GetPlaylist("Albums Imported Today")
for i = 1, table.getn (Track_objects) do
print (Track_objects[i].artist.."-"..Track_objects[i].album);
local AMGDATA = {}
AMGDATA = Marcel.AMG.GetAMG(Track_objects[i].artist,Track_objects[i].album)
if (AMGDATA ~= nil) then
if (string.len(AMGDATA.AlbumReview)>100) then
print (AMGDATA.AlbumReview);
Marcel.JRMC.WriteAlbumTag (Track_objects[i].artist,Track_objects[i].album,"Review",AMGDATA.AlbumReview)
end
if (string.len(AMGDATA.Biography)>100) then
print (AMGDATA.Biography);
Marcel.JRMC.WriteAlbumTag (Track_objects[i].artist,Track_objects[i].album,"Bios",AMGDATA.Biography)
end
if (AMGDATA.Year~=nil) and (AMGDATA.Year>1900) then
print (AMGDATA.Year);
Marcel.JRMC.WriteAlbumYear(Track_objects[i].artist,Track_objects[i].album,AMGDATA.Year)
end
if (AMGDATA.Genre~=nil) and (string.len(AMGDATA.Genre)>2) then
print (AMGDATA.Genre);
Marcel.JRMC.WriteAlbumTag (Track_objects[i].artist,Track_objects[i].album,"Genre",AMGDATA.Genre)
end
if (string.len(AMGDATA.AlbumPhotoURL)>10) then
print (AMGDATA.AlbumPhotoURL);
Marcel.AMG.WritePicture(AMGDATA.AlbumPhotoURL,Trac k_objects[i].artist.."\\"..Track_objects[i].album.."\\".."folder.jpg (file://\\)",true);
Marcel.JRMC.WriteAlbumImage(Track_objects[i].artist,Track_objects[i].album,Track_objects[i].artist.."\\"..Track_objects[i].album.."\\".."folder.jpg (file://\\)",true);
end
end
Marcel.AMG.GetRollingStoneArtistPictures(Track_obj ects[i].artist);
end
mhwlng
June 3rd, 2006, 01:13 PM
another update....
* 'tweaked' the AMG code (in certain situations it returned the wrong data)
* added Marcel.JRMC.WriteAlbumYear to write the year.
* added Marcel.AMG.GetAmazonAlbumPhotoURL to get the album image from Amazon (via the amazon web service.)
This album image is a lot bigger than the one on AMG...
note that for this to work, you need to request an access key id at http://aws.amazon.com (http://aws.amazon.com/) (create an account)
then you need to create a [string] key in the registry :
HKEY_LOCAL_MACHINE\SOFTWARE\Promixis\Girder\4\Amaz onAccessKeyID
and enter the key...
That way I don't have to give you mine, and you don't need to modify the lua file...
you can use it something like this :
require "marcel\\JRMC"
require "marcel\\AMG"
local Track_objects = {}
Track_objects = Marcel.JRMC.GetPlaylist("Albums Imported Today")
for i = 1, table.getn (Track_objects) do
print (Track_objects[i].artist.."-"..Track_objects[i].album);
local url = Marcel.AMG.GetAmazonAlbumPhotoURL(Track_objects[i].artist,Track_objects[i].album)
if (string.len(url)>10) then
print (url);
Marcel.AMG.WritePicture(url,Track_objects[i].artist.."\\"..Track_objects[i].album.."\\".."folder.jpg",true (file://%22..track_objects[i].album..%22//%22..%22folder.jpg%22,true));
Marcel.JRMC.WriteAlbumImage(Track_objects[i].artist,Track_objects[i].album,Track_objects[i].artist.."\\"..Track_objects[i].album.."\\".."folder.jpg",true (file://%22..track_objects[i].album..%22//%22..%22folder.jpg%22,true));
end
end
theguywiththefunnyhair
August 8th, 2006, 03:18 AM
Hi Marcel,
Is it possible to make it an option to write the retrieved data (Bio + Review) to a .txt file in the album folder instead of writing it to tags? I have checksums for all files and changing the tags will mess up the checksums.
Cheers
Dan
mhwlng
August 8th, 2006, 03:23 AM
You can easily do that yourself...
you have the data in a string, so just write the contents of that string to a file instead of using WriteAlbumTag
Marcel
theguywiththefunnyhair
August 8th, 2006, 03:39 AM
You can easily do that yourself...
Marcel
I'll give it a go
:)
jmp
August 12th, 2006, 10:40 PM
Marcel,
I was looking at your JRMC.lua script - very cool, but I can't get it to run. I have Media Center 11 installed, but keep getting "Unable to connect to Media Center Inside Out Server". Is there something special I need to install to get MCIOServer? Is there any documentation on the API? I can't find anything on J. River's web site and would like to add a couple features to what you have, if I can get it to work.
Also, it does not look like anything calls the MCConnectComDirect function. I tried using that instead, but got errors on the JRMCRunning command and gave up.
Thanks for any help you can give!
Jeff
mhwlng
August 13th, 2006, 01:59 AM
you get mcio here (It's not made by jriver) :
(http://meedio.com/myhtpc/pub/JRiver's%20MC9%20Plugin/myHTPC%20JRMC%20Plugin.zip)
run the mcio.exe file to install it and forget about the other files , they are for a different program...
the api is here :
http://www.jrmediacenter.com/DevZone/MJAutomation.html
Marcel
jmp
August 13th, 2006, 04:10 PM
Awesome! I added the MCIO and it is working great. I can't believe how fast it is. I was able to use the Automation SDK to add the commands I needed - but having your code as an example was exactly what I needed to get started.
Once I get the control system up and running, I want to start digging into the Amazon web service you're using for album art - that looks pretty cool to.
Thanks for the code and the help!
Jeff
jmp
August 13th, 2006, 09:06 PM
I spoke too soon. I have everything working perfectly as long as I call it from the interactive console
in girder. As soon as I use the GIP callback, I get the "Unable to connect to Media Center Inside Out Server"
error again. I've tried a bunch of different confirgurations, but just can't get it to work.
This is a very condensed version of what I'm doing:
require "JRMC"
function IRcallback(data, code)
if (code == 1) then
local Artist_objects = {}
Artist_objects = Marcel.JRMC.GetArtistList()
for i = 1, table.getn (Artist_objects) do
print (Artist_objects[i].name);
end
end
return
end
c = gip.Open('192.168.1.101', 4999) -- Serial port on GlobalCache
res = c:Callback(2, '\r', 1000, IRcallback)
If I call IRcallback('x', 1) interactively it works perfectly, but if GIP triggers the callback, the MCIO connect fails.
Any ideas???? I'm so close! Thanks!!
Jeff
Promixis
August 13th, 2006, 10:33 PM
Jeff, the callback is coming in on a different thread. COM requires all calls to a COM object happen from the same thread. so, you can circumvent this using gir.RunCodeOnMainThread (function) in your callback.
Agonostis
August 14th, 2006, 07:59 AM
Hi Marcel/JMP
What exactly does MCIO do? I have created my own interface in VS2005 that connects to JRMC through its COM object, and I don't believe I use/need MCIO.
Is it something specific to girder?
Promixis
August 14th, 2006, 08:12 AM
Hi Marcel/JMP
What exactly does MCIO do? I have created my own interface in VS2005 that connects to JRMC through its COM object, and I don't believe I use/need MCIO.
Is it something specific to girder?
For some reason, you can only connect to JRMC via luacom if it is the only application using the COM interface. For those using the Mediabridge you must use MCIO so G4 can connect.
jmp
August 14th, 2006, 11:43 PM
Mike,
Thanks! The RunCodeOnMainThread took care of it. I figured it had to be something along those lines. I found it in the API doc, but I can't figure out how to pass argument(s) to the function. Right now I'm setting a global variable in the callback and then using RunCodeOnMainThread to fire the function, but it feels sloppy. Since it is called asynchronously it makes sense that you can't get data back from the called function, but it seems like you should be able to pass data to the function in the main thread.
Jeff
Rob H
August 15th, 2006, 04:22 AM
You can use a closure to do this, ie an anonymous function with bindings to local variables.
Suppose you wanted to send some information to NetRemote using NetRemote.SetVariable('MyVar', value). You could do this as follows :-
gir.RunCodeOnMainThread(function() NetRemote.SetVariable('MyVar', value) end)
This will work as long as 'value' is a local variable in the function that calls gir.RunCodeOnMainThread.
theguywiththefunnyhair
November 5th, 2006, 03:17 PM
Hi Marcel,
I have your AMG.lua working with girder on my system, its a neat tool but i am wondering if it is possible to somehow get the rest of the info (bio or review) when the page is a long one and the whole document is accessed via the "read more" link?
I guess if this was easy you would have already done it, but still i have to ask.
:)
Dan
ok on second look i see the info is already there. nice one!!
theguywiththefunnyhair
November 5th, 2006, 11:55 PM
if i want girder to query AMG on a new thread everytime i call it should i just call the function something like this?
artist = "artist"
album = "album"
function getAMGinf(art,alb)
local AMGDATA = {}
AMGDATA = Marcel.AMG.GetAMG(art,alb)
end
getinf = thread:newthread(getAMGinf(artist,album))
and if i do it that way what will happen if i call it again while its still running? and also how can i give the thread a set amount of time to complete or abort or does the AMG function itself have a set timeout?
thanks
Dan
Rob H
November 6th, 2006, 02:10 AM
That won't work - try this
getinf = thread:newthread(getAMGinf, {artist, album})
Marcel will have to answer the timeout questions.
theguywiththefunnyhair
November 6th, 2006, 03:40 AM
Hi Rob,
thanks (again) for looking at this, i tried you suggested but it didnt work, it gave me the error
[string "teststuff.gml:\New\Scripting"]:10: calling `newthread' on bad self (function expected, got table)
stack traceback:
[C]: in function `newthread'
[string "teststuff.gml:\New\Scripting"]:10: in main chunk
i also tried it the other way and it sort of worked. it successfully called the function (i dont know if it was running on an independant thread) but then when the Marcel.AMG.GetAMG() function completed it tried to do something else and returned the same error i posted above.
Any ideas?
Dan
ahhh... found the problem, thanks anyway ;)
mhwlng
November 6th, 2006, 10:10 AM
if it is possible to somehow get the rest of the info (bio or review) when the page is a long one and the whole document is accessed via the "read more" link?
ok on second look i see the info is already there. nice one!!
I have noticed that on a few artists with really really long bios (I only noticed if for bob dylan) you still get the read more problem.
I will look at that issue when I get back from travelling...
Marcel
theguywiththefunnyhair
November 11th, 2006, 03:12 AM
Hey Marcel,
Just wanted to say thanks for this script! Its the sort of thing you dont think you need, but then once you've used it you wonder how you got by without it,
Cheers
Dan
PS. Hope you enjoy your travel, what country are you in?
mhwlng
November 11th, 2006, 03:15 AM
PS. Hope you enjoy your travel, what country are you in?
I was working in northern Turkey (Not, where the tourists go :) )
I'm now home for the weekend and next week I'm off again (to the U.K)....
I'll try to look at the 'very long Bio problem', before I leave...
Marcel
theguywiththefunnyhair
November 11th, 2006, 07:32 AM
Marcel,
I wouldnt worry about the Bio too much, i honestly think its not a problem, I was originally viewing the value of the bio in girders variable inspector and when i saw the "..." i thought that was the in text, when i printed it i realised it's complete.
I just checked Bob Dylan and although it is extremely long, its all there.
I wonder though, is it possible to get the AMG rating with the albums and to also flag the AMG top picks?
Cheers
Dan
mhwlng
November 11th, 2006, 11:17 AM
I just checked Bob Dylan and although it is extremely long, its all there.
I can't reproduce the bio 'problem' myself anymore, either :confused:
anyway... moving on...
I added :
* amg pick + rating to : album list + selected album
* if album = "", it now skips some stuff...
* you can now tell GetAMG to not get the artist pictures,biography and/or album list, which will make it faster if you are not interested in all the data...
e.g.
AMGDATA = Marcel.AMG.GetAMG("Bob Dylan","",false,false,true)
if (AMGDATA ~= nil) then
table.print (AMGDATA);
end
Marcel
theguywiththefunnyhair
November 12th, 2006, 01:34 AM
Hi Marcel,
Thanks heaps for making those changes, i think its great to have a (semi objective) indicator of the qualitiy of the album included with the artists album history.
I thought it might be also nice to have another function, to get and return a track listing of an album selected from AlbumList, again including the top picks.
Would this be possible?
Are you still off to the UK this week? I hear the weather over there can be a little grim.
Cheers
Dan
mhwlng
November 12th, 2006, 03:43 AM
Ok,
I Added the track list for the selected album (name, track#, amg pick)
What are you doing, with all this stuff ?
Me, I just run above code manually every time I add some albums to my collection (I didn't bother putting the code in a thread).
p.s. I see you're from Sydney. I was there a couple of weeks ago :) ...
Marcel
theguywiththefunnyhair
November 12th, 2006, 05:09 AM
Marcel,
thanks again, you really work fast!
I want to make all of the original data (discography, review, biography) available offline for tunes on the road, and then make it available in NR using Robs ListManager class as part of the additional album/artist info. The feature you just added will be available in NR only when connected to the net, to add more depth to the artist info.
Next time your coming to Sydney please let me know, i would love to make sure you see the sights!
Cheers
Dan
theguywiththefunnyhair
November 12th, 2006, 06:55 AM
Hi Marcel,
I have just been using your latest version of AMG.Lua, i've been trying out the new switches (ie: true,false,false) and im not sure the last one is working, i am testing the function with
--Marcel.AMG.GetAMG(artist,album,getartistpictures,g etbiography,getalbumlist)
require "added\\AMG"
AMGDATA = {}
local info = {Foobar.Artist, Foobar.Album}
AMGDATA[info[1]..info[2]] = Marcel.AMG.GetAMG(info[1],info[2], true, false, false)
-- AMGDATA[info[1]..info[2]] = Marcel.AMG.GetAMG(info[1],info[2], false, true, false)
-- AMGDATA[info[1]..info[2]] = Marcel.AMG.GetAMG(info[1],info[2], false, false, true)
and it looks like the album list and associated data is always returned.
Also, i was kind of planning to make a specific request for the Track listing, passing it the Album and Artist info by selecting any of the entries in the AlbumList table, would it be possible to add 1 more switch that just gets trackinfo and review?
thanks
Dan
I just looked at the code again and realised thats a silly request, the switches are fine as is
mhwlng
November 12th, 2006, 07:00 AM
and it looks like the album list and associated data is always returned.
correct, if album is not "" then it needs to get the album list info
and it looks like the album list and associated data is always returned.
correct, if you enter an album, then it needs to get this info as well..
would it be possible to add 1 more switch that just gets trackinfo and review?
that is not possible...
if you just want the tracklist/review for a single album, then you will always get the album list as well (not returning this data, won't make it any faster)...
Marcel
theguywiththefunnyhair
November 12th, 2006, 02:33 PM
ahh.. of course. that makes sense, thanks!
theguywiththefunnyhair
November 14th, 2006, 02:07 AM
Hi marcel,
Im getting an error logging in to lastfm, is it working for you?
Dan
theguywiththefunnyhair
November 16th, 2006, 05:34 AM
Hi again,
I think they just changed something on AMG, your function no longer returns the tracklisting, it was working a minute ago. Looks like they may have added a clickthrough to a track review, i dont recall seeing that there before.... if that is what's changed is it possible to add that in to the tracklist table?
Cheers
Dan
Ok... im not sure what the story is but its a new day and thats all that changed, the tracklist is working just fine again. But i wonder can we get that track review? :) i was thinking adding the 'R' flag to the tracklist table then having another function passing the Artist, Album and Track would not slow the other functions down. You will have a better of how feasible this is.
mhwlng
November 18th, 2006, 10:15 AM
Im getting an error logging in to lastfm, is it working for you?
nope...
I had to change :
local url = "http://ws.audioscrobbler.com/1.0/artist/"..artist.."/similar.xml (http://ws.audioscrobbler.com/1.0/artist/)";
local LISTHTML,HTTPERROR = socket.http.request(url);
if ((HTTPERROR == 200) and (LISTHTML ~= nil)) then
to :
local url = "http://ws.audioscrobbler.com/1.0/artist/"..artist.."/similar.xml (http://ws.audioscrobbler.com/1.0/artist/)";
local LISTHTML,HTTPERROR = win.URLDownloadToMemory(url)
if (LISTHTML ~= nil) then
no idea why this is needed all of a sudden ??? (maybe it's related to one of the recent xp security patches or something ??)
re: track review.
do you really need this ? it will make things a lot slower again and if you just need a single review, you still need to get through the same slow steps that give you the track list....
(you can't cache the track review url in the track list for later use, because it could change in every session)
Marcel
theguywiththefunnyhair
November 20th, 2006, 02:28 AM
re: track review.
do you really need this ? it will make things a lot slower again and if you just need a single review, you still need to get through the same slow steps that give you the track list....
(you can't cache the track review url in the track list for later use, because it could change in every session)
I guess i dont really need it, and i definantly wouldnt want to slow things down, i was thinking of doing it on a seperate thread... but i will get back to you on that one.
I am having trouble with this tracklisting again, sometimes it just doesnt retrieve it, it works fine for ages then stops working for a while the mysteriously just starts again. I dont have any real understanding of how your code works so i cant even start to imagine what goes wrong.
On a better note, i have spent some time writing an 'expansion' for your code, its just different way of using it really. I have checksums for all my audio files so regular changes to the tags are not an option, so i created a script that uses your function to build a database (of text files) on the hard disc. Its intended to be run everytime the track changes and it first checks the HDD to see if it has the data and if not it gets it and stores it, if it does have the data already it reads it from the HDD, if the data on the HDD is more than a week old it then checks for updated files and if it gets one writes it.
The script is nearly finished, when it is im keen to show it to you. :)
Cheers
Dan
mhwlng
November 20th, 2006, 02:32 AM
I am having trouble with this tracklisting again
Is this for a specific artist ?
When you have this problem, do you still get the album cover/genre/year ?
Do you see errors in the console ?
Marcel
theguywiththefunnyhair
November 20th, 2006, 02:38 AM
Its not for a specific artist and no errors are in the console, all other data is being returned
theguywiththefunnyhair
November 20th, 2006, 02:42 AM
Hold the phone!
Maybe it is for specific artists, i just tried Mad Season - Above and cant get one but then tried Moby - Play and got one, then i tried Mad season again and again it failed.
mhwlng
November 20th, 2006, 03:25 AM
ok...
updated amg.lua
If you find any more artist/albums with this problem, let me know.
Marcel
theguywiththefunnyhair
November 21st, 2006, 01:29 AM
Hey Marcel,
Can you checkout Aphrodite - Aphrodite please. It doesnt return the tracklist, review or the 'top pick' flag but it does give bio, genre and rating info.
Thanks
Dan
mhwlng
November 21st, 2006, 03:20 AM
the problem was that there are two albums with the word Aphrodite in it..
1) Aphrodite Presents Full Force
2) Aphrodite
It found the first one, which doesn't have any track info...
I now added an exactalbummatch flag to GetAMG.
Set it to true and it will find the second one only....
Marcel
theguywiththefunnyhair
November 30th, 2006, 10:34 PM
Hi Marcel,
Can you have a look at, Dave Mathews Band - Under the Table and Dreaming.
Its not a big deal but it has a bunch of tracks to pad out the ghost track, they are untitled but your code returns the composer name for the track name. I was thinking it would be better if it returned something like "Untitled" or maybe just "".
What do you think?
Dan
mhwlng
December 1st, 2006, 11:28 AM
Hi Dan,
Can you have a look at, Dave Mathews Band - Under the Table and Dreaming.
I'm currently travelling,
I'll take care of it when I get home, end of next week...
Marcel
mhwlng
December 9th, 2006, 03:38 AM
ok,
I updated the code to handle unnamed tracks properly...
Marcel
theguywiththefunnyhair
December 9th, 2006, 06:20 PM
Thanks Marcel,
Quick question, what do the two numbers that come with the Similar artist title refer to?
Cheers
Dan
mhwlng
December 10th, 2006, 02:15 AM
I actually don't know
---------------------------
the jinzora similar artists list contains 2 numbers
I think the 'c' number indicates how good the match is (i.e. 1.00 = your artist) I don't know what the 'p' means.
I just return the first 25 artists, but you can increase that number if required..
p.s. I am not sure if this list is ever refreshed anymore...
I believe that the list was compiled in the past from what tracks people shared via some p2p programs...
----------------------------------
I use the last.fm similar artists myself
It returns 100 similar artists with a lot of useful info :
["image"] = "http://static.last.fm/proposedimages/sidebar/6/1307/316695.jpg",
["name"] = "The White Stripes",
["streamable"] = "1",
["url"] = "http://www.last.fm/music/The+White+Stripes",
["image_small"] = "http://static.last.fm/proposedimages/thumbnail/6/1307/316695.jpg",
["match"] = "47",
streamable tells me that I can listen to some 30 second samples of the artist's music on the 'url' web page ...
match is also some measure on how similar this artist is...
image/image_small are artist images in 2 sizes..
at the end of this movie
http://mhwlng.dyndns.dk/NR/nrmovie2.zip (40Mb)
discussed here :
http://www.promixis.com/forums/showthread.php?t=14221
you can see how I use the last.fm data..
Marcel
mhwlng
July 8th, 2007, 04:06 AM
updated amg.lua
because amg made some changes (a while ago, I only noticed it today) that broke the biography
Marcel
mhwlng
July 28th, 2007, 12:33 PM
updated amg.lua
added function, to get artist images from last.fm
function Marcel.AMG.GetLastFMArtistPictures(artist)
Marcel
theguywiththefunnyhair
September 8th, 2007, 12:45 AM
Hi Marcel,
Is this still working for you? I've run into trouble and i wonder if maybe its not just me...
Cheers
Dan
mhwlng
September 8th, 2007, 02:06 AM
AMG has introduced some weird loadbalancing system.
if you enter
http://www.allmusic.com
it redirects to something like
http://wm04.allmusic.com/
for now, just change the URL in the lua file, to the one that you see on the screen .
I'm still trying to figure out the best way to handle this automatically..
Marcel
mhwlng
October 28th, 2007, 05:25 AM
updated amg.lua
fixed a problem with album review and last.fm similar artists
Marcel
mhwlng
January 13th, 2008, 06:47 AM
updated AMG.lua
GetLastFMArtistPictures was broken, by some changes on the last.fm site.
now, it also handles multiple pages of images and png files...
note that the images are renumbered on last.fm. So, if you're not careful you'll end up with a bunch of duplicates...
Marcel
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.