Skip to content

Instantly share code, notes, and snippets.

@lpchaim
Forked from PBXg33k/VocaDB.src
Last active November 5, 2021 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lpchaim/c719845c59a3c470d2b2cc9031c24071 to your computer and use it in GitHub Desktop.
Save lpchaim/c719845c59a3c470d2b2cc9031c24071 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
#
# ###################################################################
[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" "c:\\tmp\\vocadb.json" "5"
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" "c:\\tmp\\vocadb_single.json" "5"
json_select_object "items"
# Album
outputto "ALBUM"
json_select "name"
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 "TRACKS"
json_select "name"
sayrest
say "|"
json_select_object "song"
outputto "_LENGTH"
json_select "lengthSeconds"
sayrest
say "|"
outputto "Artist"
json_select "artistString"
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
@lpchaim
Copy link
Author

lpchaim commented Feb 21, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment