Wer mp3tag zum taggen seiner Musik oder Hörbücher nimmt, hatte sicherlich schon einmal den Wunsch, direkt auf die Online-Datenbank von iTunes zurückgreifen zu wollen. Dies ist relativ einfach möglich. Hierzu muss in Windows unter %appdata%\Mp3tag\data\sources die Datei iTunes.src mit folgendem Inhalt erstellt werden:

########################################################
#      iTunes Web Sources Script for Mp3Tag            #
#                                                      #
#version 1.1.2                                         #
#created by pone in May 2012 & modified by Björn       #
########################################################


########################################################
#          SEARCH BY DIALOG                            #
########################################################
[Name]=iTunes
[BasedOn]=http://itunes.apple.com/de
[IndexUrl]=http://itunes.apple.com/de/search?term=%s&entity=album&limit=100
[AlbumUrl]=http://itunes.apple.com/de/lookup?id=
[WordSeperator]=+
[IndexFormat]=%_preview%|%_url%|%Artist%|%Album%|%Tracks%|%Type%|%Copyright%|
[SearchBy]=%artist% %album%
[Encoding]=utf-8


########################################################
#          LIST OF SEARCH RESULTS DIALOG               #
########################################################
[ParserScriptIndex]=...
findline "wrapperType\""

do
    joinuntil "}"     
    replace "\\\"" "\""
    replace "?uo=4" ""

    # PREVIEW
    sayregexp "(?<=\"collectionViewUrl\":\").+?(?=\")" ", " "}"
    say "|"

    # URL
    sayregexp "(?<=\"collectionId\":)\d+?(?=,)" ", " "}"
    say "&entity=song&limit=200"
    say "|"

    # ARTIST
    sayregexp "(?<=\"artistName\":\")[^\"]{1,75}(?=.)" ", " "}"
    say "|"

    # ALBUM
    sayregexp "(?<=\"collectionName\":\").+?(?=\")" ", " "}"
    say "|"

    # TRACKS
    sayregexp "(?<=\"trackCount\":)\d+?(?=,)" ", " "}"
    say "|"

    # TYPE
    sayregexp "(?<=\"collectionType\":\").+?(?=\")" ", " "}"
    say "|"

    # COPYRIGHT
    sayregexp "(?<=\"copyright\":\").+?(?=\")" ", " "}"
    say "|"

    saynewline
    findline "wrapperType\"" 2 1
while "{\"wrapperType" 201



########################################################
#          ADJUST TAG INFORMATION DIALOG               #
########################################################
[ParserScriptAlbum]=...

findline "wrapperType\""
joinuntil "}"

outputto "COVERURL"
sayregexp "(?<=\"artworkUrl100\":\").+?(?=\")" ", " "}"

outputto "ALBUMARTIST"
sayregexp "(?<=\"artistName\":\").+?(?=\")" ", " "}"

outputto "ALBUM"
sayregexp "(?<=\"collectionName\":\").+?(?=\")" ", " "}"

outputto "YEAR"
sayregexp "(?<=\"copyright\":\")\d\d\d\d(?=.)" ", " "}"

regexpreplace "(\d\d\d\d),?" "<<<year$1>>>"
findinline "\"copyright\":\"" 1 1
ifnot "<<<year"
    gotochar 1
    sayregexp "(?<=\"releaseDate\":\"<<<year)\d\d\d\d(?=>>>)" ", " "}"
else
    gotochar 1
endif

outputto "PUBLISHER"
regexpreplace "<<<year\d*>>>" ""
regexpreplace " +" " "
sayregexp "(?<=\"copyright\":\").+?(?=\")" ", " "}"


# TRACK LOOP
findline "wrapperType\"" 2 1
do
    joinuntil "}"
    replace "\\\"" "\""

    outputto "TRACKS"
    sayregexp "(?<=\"trackCensoredName\":\").+?(?=\")" ", " "}"
    #sayregexp "(?<=\"trackName\":\").+?(?=\")" ", " "}"
    say "|"

    outputto "ARTIST"
    sayregexp "(?<=\"artistName\":\").+?(?=\")" ", " "}"
    say "|"

    outputto "GENRE"
    sayregexp "(?<=\"primaryGenreName\":\").+?(?=\")" ", " "}"
    say "|"

    outputto "_LENGTH"
    sayregexp "(?<=\"trackTimeMillis\":)\d+?(?=\D)" ", " "}"
    say "|"

    findline "wrapperType\"" 2 1
while "{\"wrapperType"

Kommentare

Kommentare durch Disqus