IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Preliminary Musicbrainz support, web sources script
willmcelwain
post Feb 18 2005, 01:49
Post #1


Member


Group: Full Members
Posts: 28
Joined: 18-February 05
Member No.: 1564
Mp3tag Version: 2.46c



In the Web Sources Archive thread, I've added a beta Musicbrainz script. It seems to work on most albums, but there are some exceptions. I'm a big fan of Musicbrainz and think they have the most accurate database out there (better than AMG), so I'm glad this web sources scripting was so easy to work with. Try it out and post how it works (or doesn't work) for you.

-Will
Go to the top of the page
 
+Quote Post
willmcelwain
post Feb 18 2005, 22:59
Post #2


Member


Group: Full Members
Posts: 28
Joined: 18-February 05
Member No.: 1564
Mp3tag Version: 2.46c



Another question...I was just searching Musicbrainz for "Requiem For A Dream" (soundtrack), and it didn't work because there wasn't any cover art for that album on the webpage. In the script, is there any way to skip over a section when findline fails? Like if it can't find the line where the cover.jpg should be, is there a way for the script to continue parsing the rest of the album info (tracks and such)?
Go to the top of the page
 
+Quote Post
Florian
post Feb 19 2005, 00:20
Post #3


Developer


Group: Admin
Posts: 7703
Joined: 12-December 01
From: Germany, Dresden
Member No.: 203
Mp3tag Version: 2.61d



QUOTE (willmcelwain @ Feb 18 2005, 10:59 PM)
Another question...I was just searching Musicbrainz for "Requiem For A Dream" (soundtrack), and it didn't work because there wasn't any cover art for that album on the webpage. In the script, is there any way to skip over a section when findline fails? Like if it can't find the line where the cover.jpg should be, is there a way for the script to continue parsing the rest of the album info (tracks and such)?
*

You can use
CODE
# coverurl
outputto "coverurl"
findline "src=\"http://images.amazon.com/" 1 1
if "   src"
    findinline "src=\"http://images.amazon.com/"
    say "http://images.amazon.com/"
    sayuntil "\""
else
    gotoline 1
endif

for the Cover URL. findline find the first line containing the string specified and the 1 as third parameters ignores the error, when no line was found. Please note, that the cursors position is at the end of the file in this case.

CODE
# year
findline "Edit releases" 1 1
outputto "year"
findinline "<td"
ifnot " "
    findinline ">"
    sayuntil "-"
endif
will also fix an error when no release was specified on the album page.

I'm also working on a solution, to query albums where the web source redirects directly to the album page.

Best regards,
~ Florian


--------------------
♫ If you like using Mp3tag please donate to support further development.

Go to the top of the page
 
+Quote Post
Florian
post Mar 3 2005, 20:32
Post #4


Developer


Group: Admin
Posts: 7703
Joined: 12-December 01
From: Germany, Dresden
Member No.: 203
Mp3tag Version: 2.61d



I've added a modified web source to the archive which also allows to query albums where the web source redirects directly to the album page smile.gif

You'll need the current Development Build to use this web source.

Best regards,
~ Florian


--------------------
♫ If you like using Mp3tag please donate to support further development.

Go to the top of the page
 
+Quote Post
willmcelwain
post Mar 3 2005, 23:50
Post #5


Member


Group: Full Members
Posts: 28
Joined: 18-February 05
Member No.: 1564
Mp3tag Version: 2.46c



Awesome, works great.

I'm still having problems with Mp3tag not translating HTML entities (like &amp;, &#39;, etc.). Is this a bug? Or is there some code I can add to the web sources script or some action script I can use? It's most noticeable with Musicbrainz because they seem to encode almost all non-alphanumeric characters. Try these albums to see what I'm talking about: Le Tigre - This Island, Iron & Wine - Our Endless Numbered Days, U2 - The Joshua Tree. I'm also getting a weird character in the artist field for Sigur Rós - Ba Ba Ti Ki Di Do with Musicbrainz. Just thought I'd give you the heads up. Keep up the good work.

Will
Go to the top of the page
 
+Quote Post
Florian
post Mar 4 2005, 13:25
Post #6


Developer


Group: Admin
Posts: 7703
Joined: 12-December 01
From: Germany, Dresden
Member No.: 203
Mp3tag Version: 2.61d



QUOTE (willmcelwain @ Mar 3 2005, 11:50 PM)
Awesome, works great.

I'm still having problems with Mp3tag not translating HTML entities (like &amp;, ', etc.). Is this a bug? Or is there some code I can add to the web sources script or some action script I can use? It's most noticeable with Musicbrainz because they seem to encode almost all non-alphanumeric characters. Try these albums to see what I'm talking about: Le Tigre - This Island, Iron & Wine - Our Endless Numbered Days, U2 - The Joshua Tree. I'm also getting a weird character in the artist field for Sigur Rós - Ba Ba Ti Ki Di Do with Musicbrainz. Just thought I'd give you the heads up. Keep up the good work.

Will
*

I don't know, if I'll add HTML entities detection and replace it within the web source. This is mainly because I don't know how to replace all (also unknown entities) at once.

But you could create a replace action set in the meantime and replace those entities via an action after using the web source feature. I know this is an additional step and a built-in solution would be much nicer, but I don't have an idea how to translate entities like &#231 ; by now.

Best regards,
~ Florian


--------------------
♫ If you like using Mp3tag please donate to support further development.

Go to the top of the page
 
+Quote Post
willmcelwain
post Mar 5 2005, 04:33
Post #7


Member


Group: Full Members
Posts: 28
Joined: 18-February 05
Member No.: 1564
Mp3tag Version: 2.46c



There's a good list of all the HTML 4.0 entities here: http://www.w3schools.com/html/html_entitiesref.asp

I whipped up some quick standard actions (attached) to replace the most common entities (', ", &, <, >, <non-breaking space>, ©), and it works well enough for now. Do you think you could add the functionality to run actions within the web sources dialogs (the "Adjust Tag-information" one at least)? That would save some time.

Also, I noticed the Musicbrainz script wasn't grabbing the year for some reason (on pretty much any album I tried), so I fixed it by doing another findline command before the findinline command (and adding some more text to search for). Also, debugging was on, so I turned it off. I've attached the fixed script below.

Will
Attached File(s)
Attached File  Standard.mta ( 883bytes ) Number of downloads: 290
Attached File  musicbrainz.src ( 2.92K ) Number of downloads: 320
 
Go to the top of the page
 
+Quote Post
dano
post Mar 5 2005, 09:58
Post #8


Moderator


Group: Moderators
Posts: 5680
Joined: 4-September 03
From: Germany
Member No.: 201
Mp3tag Version: 2.61d



nice work willmcelwain, but the year comes up with 2 <td> strings at the end


--------------------
Go to the top of the page
 
+Quote Post
Florian
post Mar 5 2005, 10:10
Post #9


Developer


Group: Admin
Posts: 7703
Joined: 12-December 01
From: Germany, Dresden
Member No.: 203
Mp3tag Version: 2.61d



QUOTE (dano @ Mar 5 2005, 09:58 AM)
nice work willmcelwain, but the year comes up with 2 <td> strings at the end
*

I've noticed that too and fixed the version from the Web Source Archive smile.gif

Thanks!


--------------------
♫ If you like using Mp3tag please donate to support further development.

Go to the top of the page
 
+Quote Post
Florian
post Mar 7 2005, 14:20
Post #10


Developer


Group: Admin
Posts: 7703
Joined: 12-December 01
From: Germany, Dresden
Member No.: 203
Mp3tag Version: 2.61d



The current version automatically resolves HTML entities now and fixes some weird characters which were caused by not decoding UTF-8 encoded data.


--------------------
♫ If you like using Mp3tag please donate to support further development.

Go to the top of the page
 
+Quote Post
willmcelwain
post Mar 13 2005, 03:47
Post #11


Member


Group: Full Members
Posts: 28
Joined: 18-February 05
Member No.: 1564
Mp3tag Version: 2.46c



I've been renaming a bunch of my albums recently (thanks to the new HTML entities and UTF-8 bug fixes), and have a couple more feature requests.

1) Is there a way to automatically rename the working directory, for example to something like "%artist% - %year% - %album%" or something? If not, can you add that functionality (in Options)? Or maybe add a field in the Actions dialog like _WORKINGDIR or something? Also, if you do add this feature, can you also set the renamed directory as the one to start from when clicking on "Change Directory..."?

2) On the left side of the main window where it specifies Folder, would it be possible to add 2 entries to the drop-down list? Could you add both the previous and the next subfolder of the parent directory? For example, say I'm working in the directory "D:\mp3s\albums\Radiohead - OK Computer". I'd like the drop-down list to also contain the items "D:\mp3s\albums\Radiohead - Amnesiac" and "D:\mp3s\albums\Radiohead - The Bends". That way, I could quickly jump to the next (or previous) directory instead of going through the "Change Directory..." dialog. Or maybe there could also be an option to tell Mp3tag how many previous/next subdirs to have in the list, instead of just one of each.

3) Is there a way you can enable the sorting of tracks with the other web sources, similar to how it's done with freedb? It'd be helpful when you have an album with no track numbers in the ID3 tags or filenames, which default to being sorted by name.

4) Can you make it so Mp3tag loads the web sources scripts dynamically, so that when you make a small change to the script, you don't have to exit Mp3tag and restart it for the changes to take affect?

Also, in the Musicbrainz script, the year was sometimes grabbed in the form of YYYY-MM-DD (like 2003-11-23), and since ID3 tags can't hold that many characters, I modified the script (at the very end) to only grab the 4-digit year. I also added functionality to grab info for Various Artists albums (sountracks and whatnot). As a workaround (since the web sources framework doesn't really support multiple artists), I stored the track info as "%artist% / %title%", then wrote an action script to split up each pairing into their respective fields. It's a hack, but it seems to work. Both the updated Musicbrainz script and Various Artists action can be downloaded below.

Thanks!
-Will

This post has been edited by willmcelwain: Mar 13 2005, 04:09
Attached File(s)
Attached File  Various_Artists.mta ( 133bytes ) Number of downloads: 332
Attached File  musicbrainz.src ( 3.34K ) Number of downloads: 397
 
Go to the top of the page
 
+Quote Post
willmcelwain
post Mar 26 2005, 01:43
Post #12


Member


Group: Full Members
Posts: 28
Joined: 18-February 05
Member No.: 1564
Mp3tag Version: 2.46c



Any thoughts on these suggestions Florian?

-Will
Go to the top of the page
 
+Quote Post

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: 1st August 2014 - 10:50