Skip to content

Instantly share code, notes, and snippets.

@Onurtag
Forked from lpchaim/VocaDB.src
Last active January 19, 2022 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Onurtag/ff8cc12498c4cda9bf2626d8e2ce5092 to your computer and use it in GitHub Desktop.
Save Onurtag/ff8cc12498c4cda9bf2626d8e2ce5092 to your computer and use it in GitHub Desktop.
MP3Tag - VocaDB Tag Source
# ###################################################################
# Mp3tag Tag Source for VocaDB
#
# Search by ALBUM
#
# This file should be stored in your tag sources sources directory
# %APPDATA%\Mp3tag\data\sources
# and requires Mp3tag v2.64 or above.
# [2015-08-31] v1.00
#
# [2021-11-05] v1.10
# - now adds DISCNUMBER and TRACK fields for albums with multiple discs
# [2021-11-08] v1.13
# - now adds JAPANESETITLE and JAPANESEALBUM tags using the defaultName fields (usually in Japanese)
#
# ###################################################################
[Name]=VocaDB
[BasedOn]=vocadb.net
[IndexUrl]=https://vocadb.net/api/albums?fields=AdditionalNames,Tags,Tracks,Names,MainPicture&nameMatchMode=Auto&maxResults=50&preferAccurateMatches=true&getTotalCount=true&lang=Romaji&query=%s
[AlbumUrl]=https://vocadb.net/api/albums/
[WordSeparator]=%20
[IndexFormat]=%Artist%|%Album%|%Release_Date%|%Catalog_Number%|%_preview%|%_url%|%tracks%
[SearchBy]=%album%
[UserAgent]=1
[Encoding]=url-utf-8
[ParserScriptIndex]=...
# ###################################################################
# I N D E X
# ###################################################################
# debug "on" "D:\\KeepThisEmpty\\vocadb.json" "5"
# DebugWriteInput "D:\\KeepThisEmpty\\debug_input_vocadb.json"
json "ON"
json_select "totalCount"
ifnot "0"
json_foreach "items"
# Artist
json_select "artistString"
#sayregexp ".+?(?= -.*)"
sayrest
say "|"
# Album
json_select "defaultName"
#sayregexp "(?<= - ).*"
sayrest
say "|"
# ReleaseDate
json_select_object "releaseDate"
json_select "formatted"
sayrest
say "|"
json_unselect_object
# Catalog_Number
json_select "catalogNumber"
sayrest
say "|"
# Preview
say "https://www.vocadb.net/Al/"
json_select "id"
sayrest
say "|"
# URL
json_select "id"
sayrest
say "?fields=Tracks,Names&lang=Romaji"
say "|"
# Tracks
json_foreach "tracks"
set "t_tracks"
json_select "trackNumber"
outputto "t_tracks"
json_foreach_end
outputto "Output"
sayrest
saynewline
json_foreach_end
endif
[ParserScriptAlbum]=...
# ###################################################################
# A L B U M
# ###################################################################
json "ON"
# debug "on" "D:\\KeepThisEmpty\\vocadb_single.json" "5"
# DebugWriteInput "D:\\KeepThisEmpty\\debug_input_vocadb_single.json"
json_select_object "items"
# Album
outputto "ALBUM"
json_select "name"
sayrest
# Default Album Name (JP) into JAPANESEALBUM tag
outputto "JAPANESEALBUM"
json_select "defaultName"
sayrest
# VocaDB_ID
outputto "VOCADB_ID"
json_select "id"
sayrest
# Coverurl
outputto "coverurl"
json_select "id"
say "https://vocadb.net/Album/CoverPicture/"
sayrest
# Catalog Number
outputto "CATALOGID"
json_select "catalogNumber"
#json_select_many "labels" "catno" ", "
sayrest
# Publisher
outputto "PUBLISHER"
json_select_many "labels" "name" ", "
sayrest
# Media Type
outputto "MEDIATYPE"
json_select "discType"
sayrest
# Year
outputto "YEAR"
json_select_object "releaseDate"
json_select "year"
sayrest
json_unselect_object
outputto "ALBUMARTIST"
json_select "artistString"
sayrest
# Names and sortnames
json_foreach "names"
json_select "language"
if "English"
outputto "ALBUMSORT"
json_select "value"
sayrest
endif
json_foreach_end
# Tracks
json_foreach "tracks"
outputto "DISCNUMBER"
json_select "discNumber"
sayrest
say "|"
outputto "TRACK"
json_select "trackNumber"
sayrest
say "|"
outputto "TRACKS"
json_select "name"
sayrest
say "|"
json_select_object "song"
outputto "_LENGTH"
json_select "lengthSeconds"
sayrest
say "|"
outputto "Artist"
json_select "artistString"
sayrest
say "|"
# Default Title (JP) into JAPANESETITLE tag
outputto "JAPANESETITLE"
json_select "defaultName"
sayrest
say "|"
json_unselect_object
json_foreach_end
set "tmp_join"
###
# VocaDB specific tags
###
# Release event
outputto "VOCADB_RELEASE_EVENT"
json_select "releaseEvent"
sayrest
json_unselect_object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment