I am about to complete a larger web source script, but there are a couple of things which i do not know or not have a solution for. So i thought it might be a good idea to ask others for help and/or document things i learned in the last few days. I will also add some additional information below on undocumented or probably deprecated keywords. Please add your corrections, additional documentation or your own findings through replies.
Questions:
- Is there a "supported" way to get information from the ParserScriptIndex block to the ParserScriptAlbum block? I tried to set output buffers in the ParserScriptIndex block with OutputTo "XYZ" Say "BlaBla", but this does not work, the buffers are lost and do not exist during ParserScriptAlbum execution.
- Is there a way to access existing tag fields of the selected file on which the web source is executed? The only place with read access to these fields seems to be the [SearchBy] line, is that correct?
- Is there a way to automatically (download and) embed a cover? I have seen other scripts using an output buffer named coverurl. Does mp3tag embed the image or the url? What happens if the url is using the file:/// protocol?
- Is there a way to "clear" or delete an existing tag? I tried to use set "tagname" which should according to the online help reset the contents of tagname. But the empty buffer is not propagated out of the web source script. So, for example, if my file has set the DISCNUMBER tag and my websource is indicating that it should not have a DISCNUMBER, i can not erase or delete the tag from the websource, right? Instead, i need to take a two-step approach: Set a temp tag whose presence or contents i have to check from an action invoked after running the websource. The action then deletes the tag in questions (and the temp tag too, of course.) Is there a better solution?
- Language specific tags, how to write more than one? There are at least two language specific tags in id3. USLT (Unsynced lyrics) and COMM (Comment). The spec states that there may exist multiple USLT tags, but only one per given language. Same for COMM. So it is - in theory - possible for an mp3 file to contain a comment marked as english (ENG) and one marked as german (deu). This is important as some devices display only comments (or lyrics) if they are in a specific language. For example iTunes only displays english lyrics and comments, windows xp displays only comments that match the system language. mp3tag web sources do _not_ allow to specifiy the language. Instead, mp3tag takes the language value it writes to the tag from its own language files (mp3tag/lang/*.lng). The language is specified in _M_STR_ID3V2LANG. So, it seems that there is no way to write a german and a english comment from a websource, right? Furthermore, for the tag panel, things behave differently. COMM is mostly the same (language is taken from the lng-file and can not be changed once mp3tag is running). USLT tags however get their initial language value from the language file, *but* if one invokes the extended tag dialog, the language is not only displayed, it can even be changed. I would really appreciate a consistent way to create multiple COMM and USLT tags with different languages from within an action or a web source.
Some things probably not commonly known:
- debugwriteinput This undocumented command, which is used in some other web sources, saves the unprocessed received response to the Index and the Album requests to a file. Use it similar to the "debug" command in the ParserScriptIndex and the ParserScriptAlbum block. The single mandatory parameter specifies the file name. Example: debugwriteinput "C:\test\juno_co_uk_A.htm"
- %_preview%/CurrentPreview In addition to the %_url% a web source script might specify that it will provide a distinct URL for previews (used when invoking the preview button). In the [IndexFormat] line, the pattern %_preview% determines where the web source will provide the preview url to mp3tag. Access to the actual preview url from within the ParserScriptIndex and the ParserScriptAlbum block is possible through the output buffer "CurrentPreview".
- More undocumented websource keywords?
There seem to be some additional commands but I do not have enough time for more experiments. Maybe someone can share insights on sayas, incoutput, decoutput, extern, onerror and savedata?
Here is what I found out until now:
- Savedata "filename" seems to be an alias of debugwriteinput "filename".
- decoutput takes the name of the active output buffer, removes the last character and creates a new output buffer with the shortened name.
- incoutput "suffix" takes the name of the current output buffer, appends the single mandatory parameter to the name and creates a new output buffer with the combined name.
- sayas "arg1" "arg2" takes two arguments. Not sure what it is expected to do.
BTW: i really do like mp3tag.
-u302320