IPB

Welcome Guest ( Log In | Register )

32 Pages V  « < 18 19 20 21 22 > »   
Reply to this topicStart new topic
[Not my release] Biography view
romor
post Jul 14 2012, 10:38
Post #476





Group: Members
Posts: 673
Joined: 16-January 09
Member No.: 65630



None of those commands produce an error here.

For you first command: For some reason, allmusic returns empty result for that album: http://www.allmusic.com/search/album/No%20Age%20%5BSST%5D
Excluding "[sst]" from album name returns correct review text

For your second command: If you correct your artist name (tip: look for it in the album link you provided) review text should show


--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post
godrick
post Jul 14 2012, 23:10
Post #477





Group: Members
Posts: 307
Joined: 31-December 10
Member No.: 86948



mjm716, I generally get poor results from allmusic searches whenever I have parentheses or brackets in an album name, so per Romor's suggestions in post #422, I replace the following in the latest script to eliminate everything within and including trailing parentheses in what is used by the script without altering my files' tag fields. If you have brackets or leading parentheses in your album names, you can expand on concept by altering the second new line below:

Replace:
URL = "http://www.allmusic.com/search/albums/" & LCase(Replace(ARG(1), " ", "+"))

With:
If InStr(ARG(1),"(")>0 Then
ALBUM = Trim(Mid(ARG(1),1,InStr(ARG(1),"(")-1))
Else
ALBUM = ARG(1)
End If
URL = "http://www.allmusic.com/search/albums/" & LCase(Replace(ALBUM, " ", "+"))

This post has been edited by godrick: Jul 14 2012, 23:13
Go to the top of the page
+Quote Post
doniwko
post Aug 11 2012, 14:58
Post #478





Group: Members
Posts: 2
Joined: 11-August 12
Member No.: 102211





Can you please tell why, when playing the album in *.flac, cover is not stored in a folder ? Biography of it is loaded, but it remains only an empty folder with the name of the album in folder album instead of the cover

This post has been edited by doniwko: Aug 11 2012, 15:04
Go to the top of the page
+Quote Post
romor
post Aug 18 2012, 17:25
Post #479





Group: Members
Posts: 673
Joined: 16-January 09
Member No.: 65630



New script for showing stream track info: view download

Initially I was doing script for shoutcast streams with 7.html trick, but after testing later it turned out it was unnecessary because soon as stream track changes, biography view is notified about the change (dynamic artist and title), but I leave function commented at bottom as reference.
So basically it is now showing selected last.fm info for provided artist and title, when such info may be desired and unknown, as while listening streams
It also "exposes" MBIDs: artist_mbid, album_mbid and track_mbid, so can be tweaked trivially further

Usage: cscript //nologo foo_shout.vbs "%artist%" "%title%"

Example showing all info (artist short bio and album tracklisting can be disabled):


This post has been edited by romor: Aug 18 2012, 18:04


--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post
Daeron
post Aug 18 2012, 18:42
Post #480





Group: Members
Posts: 394
Joined: 9-October 08
Member No.: 59818



QUOTE (doniwko @ Aug 11 2012, 08:58) *
Can you please tell why, when playing the album in *.flac, cover is not stored in a folder ? Biography of it is loaded, but it remains only an empty folder with the name of the album in folder album instead of the cover

What if you do not use brackets? If %album% is empty it probably won't be queried anyway, so it's pointless to have those. If that doesn't help what if you use a static filename? Try these:

CODE
$replace(%path%,%filename_ext%,%album%)
$replace(%path%,%filename_ext%,cover)
Go to the top of the page
+Quote Post
romor
post Oct 8 2012, 19:14
Post #481





Group: Members
Posts: 673
Joined: 16-January 09
Member No.: 65630



just a note that allmusic script is updated due to minor changes on their site


--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post
godrick
post Oct 8 2012, 20:47
Post #482





Group: Members
Posts: 307
Joined: 31-December 10
Member No.: 86948



Works great - thanks for catching this and updating so quickly! I've learned a lot from the elegant approach you took with your May version, and the few changes needed to keep up with allmusic's latest changes certainly shows the flexibility of your script.
Go to the top of the page
+Quote Post
romor
post Oct 8 2012, 21:01
Post #483





Group: Members
Posts: 673
Joined: 16-January 09
Member No.: 65630



Thanks godrick smile.gif

Changes were really minor, unlike their previous revamp
And their portals (rovi) look really nice, functional too, I doubt they'll do major change in near future


--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post
SaintAckbar
post Oct 16 2012, 03:07
Post #484





Group: Members
Posts: 3
Joined: 28-September 12
Member No.: 103521



I am, quite honestly, fairly confused about how to set-up the 3 tabs under the last.fm section of Biography so that I can download album art.
I've put some stuff in, and album art seems to be downloading into a folder in my Foobar2000 folder, but I'm not entirely sure if I'm doing this correctly.
Here are the 3 tabs under last.fm for me.







I'm also curious as to whether the album art that is downloaded will transfer over to my iPod when synced.

Any help or advice would be appreciated.

EDIT: It seems that it's only downloading album art for albums I've visited. Is there any way to make it search through all my albums by itself?

This post has been edited by SaintAckbar: Oct 16 2012, 03:11
Go to the top of the page
+Quote Post
romor
post Oct 17 2012, 10:28
Post #485





Group: Members
Posts: 673
Joined: 16-January 09
Member No.: 65630



QUOTE (romor @ Oct 8 2012, 20:14) *
just a note that allmusic script is updated due to minor changes on their site

sorry for poor update
updated again, hopefully better this time


--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post
marc2003
post Oct 17 2012, 11:02
Post #486





Group: Members
Posts: 4464
Joined: 27-January 05
From: England
Member No.: 19379



^that is definitely much better. thanks.
Go to the top of the page
+Quote Post
romor
post Oct 17 2012, 11:16
Post #487





Group: Members
Posts: 673
Joined: 16-January 09
Member No.: 65630



Eh marc2003, you are fast smile.gif
I noticed later that exit loops improve performance and additionally updated again (30min ago)
Nothing critical thou wink.gif


--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post
romor
post Oct 18 2012, 00:43
Post #488





Group: Members
Posts: 673
Joined: 16-January 09
Member No.: 65630



I updated allmusic script yet again, this time to add new feature while rest stays simple as was

I added caching, as Biography View caching mechanism works just for built-in last.fm service, and dislike the idea of re-requesting while using HTML DOM object, for several reasons
New version caches data in XML file (optional), located in folder where script is called from, with this kind of scheme:

CODE
<Items>
    <Item
        Id="xs:string [md5(artist & album)]"
        ArtistId="xs:string [Rovi Music ID]"
        AlbumId="xs:string [Rovi Music ID]">
        <!-- artist // album -->
            <bio> xs:string </bio>
            <review> xs:string </review>
    </Item>
</Items>

Actual simple DTD, to validate upon possible problem is here (thou who will need it?): http://db.tt/8vpR4pKJ

Artist biography caching is tied to album combination, for obvious reasons, and for other obvious reason artist and album titles are stored in XML comment and identified by md5 hash


--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post
godrick
post Oct 18 2012, 17:55
Post #489





Group: Members
Posts: 307
Joined: 31-December 10
Member No.: 86948



Romor, my powers of observation failed me in not seeing with the script update last week that my biography panel was failing over to last.fm results rather than displaying allmusic results. I still think this is great work even if I can't determine at times when it's working or not! smile.gif

Since I have a few mods to the basic script, I typically edit my script to add the changes and run it via a cmd window to get better feedback than available in the panel as I make changes, and once working in the cmd window, I try it in the panel and it works and I'm done. That process normally works well, except this time - I get different results from the same script running in the cmd window than with the panel!

More specifically, I never could get the unaltered version just before the caching change (which I named "17.vbs") to work. It bombs with the error message
" 17.vbs(12, 5) Microsoft VBScript runtime error: Object required: 'content' "

Lines 11 and 12, respectively of the script are:
Set content = HTM.getElementById("content")
Set rows = content.getElementsByTagName("tr")

...which seem fine. I tweaked them anyway to try to get beyond this error but just got other errors. I finally gave up and just ran it in the panel, and the panel does not error on this - it works just fine in the panel. I haven't tried the version with the caching capability, but given the nature of that change I don't expect any impact on this mystery.

I've never encountered a situation before where this (or any other) script works in either the cmd window or the panel, but not the other. I'm running Windows 7 32bit. Since the script works in the panel that's all that really matters, but if there is any explanation for this so I can rely on the cmd window results in the future, any explanation or advice is appreciated.

This post has been edited by godrick: Oct 18 2012, 18:00
Go to the top of the page
+Quote Post
romor
post Oct 18 2012, 19:27
Post #490





Group: Members
Posts: 673
Joined: 16-January 09
Member No.: 65630



If command lines are same you should get same output

Try to dump HTM object output: "WScript.Echo HTM.body.innerHTML" before setting content and maybe deduce the problem
In any case, if script got to that point, you should have html with id="content" inside

If you have more questions, feel free to PM me


--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post
godrick
post Oct 19 2012, 01:23
Post #491





Group: Members
Posts: 307
Joined: 31-December 10
Member No.: 86948



Thanks for the tip - it was indeed erroring because there was nothing in HTM via the cmd window. A reboot seemed to solve it - very strange, but just glad the script continues to work great in the panel.

One of the mods I add is no longer effective given the website changes. With the previous website design, search results were paged, and I could search beyond the first page with a simple change. I have a number of albums that have common names ("Greatest Hits") for artists not as common (James Taylor), such that the searched album was typically 7 or 8 pages deep in the results. Thus, if searching the first page of results was unsuccessful, my modded script conducted another search of several more pages by appending /all/10 or another multiple of 10 to the original search string. I enclosed the core search code lines within a very simple loop:

If album_link = "" Then
For n = 10 To 200 Step 10
URL = "http://www.allmusic.com/search/albums/" & LCase(Replace((ARG(1), " ", "+")) & "/all/" & n
(rest of core search portion of script)
End If

...but this no longer works because of Rovi's scroll-triggered addition of search results without reloading the page. Certainly not a big deal and definitely not worth anything beyond a minimal effort, but if there is a similarly clever and almost painless way to expose additional search results, I'd like to do it. I googled "screen scraping" and jQuery, but nothing popped out at me that I could recognize as appropriate. Any tips, references or better googling keywords appreciated!

This post has been edited by godrick: Oct 19 2012, 01:26
Go to the top of the page
+Quote Post
romor
post Oct 19 2012, 03:21
Post #492





Group: Members
Posts: 673
Joined: 16-January 09
Member No.: 65630



godrick, use this instead:

CODE
URL = "http://www.allmusic.com/search/ajax_results/albums/" & LCase(Replace((ARG(1), " ", "+")) & "/all/" & n





--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post
godrick
post Oct 19 2012, 17:16
Post #493





Group: Members
Posts: 307
Joined: 31-December 10
Member No.: 86948



Romor, thanks for the tip. That code line returned a web page of search results that is the same as the results returned by the URL of a normal search, and ignores the "/all/" & n portion, so every time the loop iterates, I get a search page of the same first 20 results.

So unless there is a another mod to the search string to ask for more results, it seems the only way to get more results is to virtually trigger the scroll down function in some way. Upon a more careful look at the source page for a search I conduct via the browser, when a user manually scrolls down the source page does indeed update to contain the additional search results.

What I tried: I created a new version of Function Request (URL), which I call Function Request2 (URL), and just before
CODE
Request = HTTP.responseText
I added
CODE
HTTP.SendKeys "{PGDN}"
to try to simulate what a user would do. The script bombed with the error "Object doesn't support this property or method: 'HTTP.Sendkeys'"

My experimenting showed that SendKeys doesn't error out when I attempt this:
CODE
Set objShell=CreateObject("WScript.Shell")
objShell.SendKeys "{PGUP}"


It feels like I'm close for better or worse. I can't tell if I'm sending the command incorrectly, need a different command, haven't and perhaps can't ensure that focus is maintained on the desired object, or if this just isn't possible given the nature of the object I'm trying to control.

Falstaff, I saw that you were trying to use SendKey here, so if you succeeded and have any advice for good or bad on this, it's appreciated.

Go to the top of the page
+Quote Post
romor
post Oct 19 2012, 17:54
Post #494





Group: Members
Posts: 673
Joined: 16-January 09
Member No.: 65630



QUOTE (godrick @ Oct 19 2012, 18:16) *
Romor, thanks for the tip. That code line returned a web page of search results that is the same as the results returned by the URL of a normal search, and ignores the "/all/" & n portion, so every time the loop iterates, I get a search page of the same first 20 results.

Really?

http://www.allmusic.com/search/ajax_result...test+hits/all/0
http://www.allmusic.com/search/ajax_result...est+hits/all/20
http://www.allmusic.com/search/ajax_result...est+hits/all/40


--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post
godrick
post Oct 19 2012, 18:59
Post #495





Group: Members
Posts: 307
Joined: 31-December 10
Member No.: 86948



aha! Such a simple check that I didn't do - I just relied on what was echoing in my cmd window - thanks! It tells me that I've got a problem in my secondary search loop, and in addition to that all I was doing was echoing the results of the first search when I thought I was seeing search results of the secondary search.

I can figure it out from here, or if I can't, I don't deserve to further inflict my inability on anyone else to get it done. Thanks again!
Go to the top of the page
+Quote Post
romor
post Oct 19 2012, 23:30
Post #496





Group: Members
Posts: 673
Joined: 16-January 09
Member No.: 65630



Apologies to users of allmusic script, but I made another update which may be of interest

While trying to improve performance, as I was feeling that something must be wrong when it takes 4-5 seconds to retrieve the data while similar scheme in other scripting language is executed in less then second, I falsely suspected Htmlfile object and tried to remove it with regex.
Luckily I did the timings, and problem was pointing to Request function and it turned out that using "Msxml2.ServerXMLHTTP" was offender, which I corrected, and now script is back on track - result in second or two

Why is recommended "Msxml2.ServerXMLHTTP" slower then "Msxml2.XMLHTTP" I don't know, but here is a link: http://msdn.microsoft.com/en-us/library/wi...p/ms762278.aspx


--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post
Decalicatan_Deca...
post Oct 20 2012, 08:44
Post #497





Group: Members
Posts: 81
Joined: 14-January 10
From: France
Member No.: 77118



@ romor,

Thanks for your scripts.
I have a very "noob-ish" question blush.gif but is it possible to execute your script if foo_allmusic.vbs is in "C:\Users\...\AppData\Roaming\foobar2000\" folder instead of in "C:\Program Files (x86)\foobar2000" ?


--------------------
Decalicatan Decalicatan
Go to the top of the page
+Quote Post
romor
post Oct 20 2012, 16:07
Post #498





Group: Members
Posts: 673
Joined: 16-January 09
Member No.: 65630



If it's not in your foobar folder, then just enter full path to it:

cscript //nologo "C:\Users\...\AppData\Roaming\foobar2000\foo_allmusic.vbs" "%album artist%" "%album%" review


--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post
PeteG
post Oct 23 2012, 02:50
Post #499





Group: Members
Posts: 56
Joined: 10-June 12
From: Denmark
Member No.: 100577



@romor
@godrick

Sadly, I have had some trouble with marc2003's allmusic script suite (WSH Panel Mod) recently and decided to give your solution a try.
And ... this is indeed convincing stuff! romor, you've got a new member in your fan club!
And thanks to godrick for having asked the right questions over time, especially about accented letters. Without your inspiring dialogs with romor I would probably have been lost beer.gif .
Initially I made a local copy of those AMG biographies and reviews that matches the rhythmic part of my Media Library:
Cache = 1 was left untouched in the latest installment of foo_allmusic.vbs.
A simple foobar2000 filter - %tracknumber% IS 01 AND %discnumber% IS 1 - produced a playlist with 4,300 items.
The Preview component was activated (Preview Length = 15 seconds, a lesser value is probably okay, but better safe than sorry).
Some 18-19 hours (!) later the harvesting was done, yielding a single 20 MB XML file. And all was pure joy!
Except of course all those times where I disagree with AMG's (inconsistent) naming of artists and albums resulting in nothing ...
E.g.: I have 27 Magma albums (the French zeuhl outfit). AMG has 11 reviews. Only a few landed in my basket.
In the case of the 'Ẁurdah Ītah' album (AMG gives it two names: 'Wurdah Ītah/Tristan et Iseult' resp. 'Wurdah Ītah') I may have found a primitive solution. If the solution is feasible, I'll send another post. It might be of some use in other situations.

I have a few questions. If they are stupid just ignore them, I'm a foobar2000, vbs, and xml newbie - and expect to be the laughing stock from time to time.

1. Why is it necessary to use UTF-16 in the Server settings (UTF-8 isn't good, and ANSI is worse), when your script generates UTF-8?

CODE
If Not oFS.FileExists("romor\foo_allmusic.xml") Then
      oXml.loadXML "<?xml version='1.0' encoding='UTF-8'?><Items></Items>"
      oXml.save "romor\foo_allmusic.xml"
    Else

I use this

CODE
cscript //U //Nologo romor\foo_allmusic.vbs "%album artist%" "%album%" bio|review

The //U option only tells cscript to "Use Unicode for redirected I/O from the console" as far as I can tell, not the encoding type.
Or is the answer to my question blowin' in the cyberspace?

2. I suppose my little lump of gold - the 20 MB all_music.xml file - is more or less static?
The cache never expires. If AMG makes a change in an artist bio (or, more unlikely, in a review) it won't be downloaded. New artists and/or albums in my collection will of course get an entry in the file, when AMG has produced some text.
romor, is it beyond the scope of your very compact and streamlined script to make some sort of date check and make an AMG lookup accordingly? I imagine something like this:

CODE
<!ELEMENT Items (Item+)>
<!ELEMENT Item ((review?, bio?) | (bio?, review?))>
<!ATTLIST Item
    Id CDATA #REQUIRED
    DateId CDATA #REQUIRED
    ArtistId CDATA #REQUIRED
    AlbumId CDATA #REQUIRED
>
<!ELEMENT review (#PCDATA)>
<!ELEMENT bio (#PCDATA)>

If I load an artist in fb2k with an excisting AMG bio in the xml file, the script performs a check: if DateId is expired then make a request to AMG. Or is this either gibberish or impossible? The evident alternative for me is of course to perform a harvest like the above say every 90 days, that's not a problem at all.

3. If I interpret the script correctly the whole xml file is loaded into memory - and stays there - at the first request?

CODE
oXml.loadXML "<?xml version='1.0' encoding='UTF-8'?><Items></Items>"

I have not encountered any performance issues, that's very, very nice! Even on and old Vista PC with 3Ŋ cylinders. In the actual implementation there is some inevitable redundancy. I have over 50 albums with Frank Zappa. All the reviews has the biography appended to them in the file; I suppose this is a contributing factor to the short load times in the Bio View panel or is it without relevance?

This post has been edited by PeteG: Oct 23 2012, 03:13
Go to the top of the page
+Quote Post
romor
post Oct 23 2012, 03:56
Post #500





Group: Members
Posts: 673
Joined: 16-January 09
Member No.: 65630



Glad to have you PeteG smile.gif

QUOTE (PeteG @ Oct 23 2012, 03:50) *
I may have found a primitive solution. If the solution is feasible, I'll send another post. It might be of some use in other situations.

What is it?

1. Yes //U option outputs UTF-16 encoded stream which UTF-8 option can't catch. Use default if you don't care about accents or your code page provides support. Even if data in XML cache is stored as UTF-8 you output UTF-16 with //U option

2. That is good idea. I don't know if they change reviewes thou, but as datetime is easy in vbs, maybe I'll add it.

3. File is loaded async by default, by XML parser. Snippet you quoted just adds contents to new cache file, if it doesn't exist.

There are many artists with same names, and pairing artist with album solves couple of problems in one turn
Also you could aggregate cache file from command line wink.gif


--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post

32 Pages V  « < 18 19 20 21 22 > » 
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 16th September 2014 - 21:56