Skip to content

Instantly share code, notes, and snippets.

@jiyunomegami
Forked from PBXg33k/VGMdb#Search by &Album
Last active July 7, 2022 21:12
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jiyunomegami/3c190ba8af13252840ea70eea10afcd7 to your computer and use it in GitHub Desktop.
Save jiyunomegami/3c190ba8af13252840ea70eea10afcd7 to your computer and use it in GitHub Desktop.
MP3Tag - VGMdb source file
# ###################################################################
# Mp3tag (v2.39+) parsing for VGMdb.net, created by dano on 2010-01-20
# Updated and maintained by PBX_g33k starting from 2015-09-01
# Changes for the current (2020) vgmdb site by jiyunomegami
#
#
# This file should be in your sources directory
# On Windows XP it's
# C:\Documents and Settings\*username*\Application Data\Mp3tag\data\sources
#
# Changelog:
# [2015-09-01]
# - FIX: Coverurl fixed
# [2020-12-12]
# - Changes for the current vgmdb site
# [2020-12-15]
# - Use Label instead of Organizations - 2020/12/13 site changes
# [2020-12-16]
# - Remove Publisher and Writer, Output Composer as Artist - 2020/12/13 site changes
#
# ###################################################################
[Name]=VGMdb - Search by Album
[BasedOn]=vgmdb.net
[IndexUrl]=https://vgmdb.net/search?q=%s
[AlbumUrl]=https://vgmdb.net/album/
[WordSeperator]=+
[IndexFormat]=%Catalog%|%_url%|%Album%|%Year%
[SearchBy]=%album%
[Encoding]=url-utf-8
[ParserScriptIndex]=...
# ###################################################################
# I N D E X
# ###################################################################
#debug "on" "/tmp/debug_vgmdb_A.htm" "10"
#debugwriteinput "/tmp/vgmdb_searchbyalbum.htm"
findline "<tr rel='rel_" 1 1
ifnot "<tr rel"
say "|"
sayoutput "CurrentURL"
say "|"
say "|"
endif
do
replace "|" "/"
findinline "span class=\"catalog"
findinline ">"
sayuntil "</span"
say "|"
# URL
findinline "https://vgmdb.net/album/"
sayuntil "\""
say "|"
# Album
findinline "class=\"albumtitle\""
findinline "\">"
sayuntil "</span>"
say "|"
# Year
findinline "</tr>"
movechar -1
findinline "\"" -1
findinline ">"
sayuntil "</"
saynewline
moveline 1 1
unspace
while "<tr rel='rel_" 999
[ParserScriptAlbum]=...
# ###################################################################
# A L B U M
# ###################################################################
#debug "on" "/tmp/debug_vgmdb_B.htm" "10"
#debugwriteinput "C:\\tmp\\VGMdb_B.htm"
# Album
outputto "Album"
findline "class=\"albumtitle"
replace "|" "$verticalBar()"
findinline "class=\"albumtitle"
findinline ">"
sayuntil "</span"
# Coverurl
outputto "coverurl"
findline "id=\"coverart\""
findinline "style=\"background-image: url("
if "'"
movechar 1
sayuntil "'"
else
findinline "../"
sayuntil "\""
endif
# set "coverurl"
# Catalog
outputto "Catalog"
findline "<b>Catalog Number</b>"
joinuntil "</tr>"
findinline "<td width=\"100%\">"
ifnot "N/A"
if "<span id="
findinline "#\">"
sayuntil "</a>"
else
regexpreplace "<a[^>]+>" ""
replace "</a>" ""
findinline "<td width=\"100%\">"
sayuntil "</td>"
endif
endif
# Release Date
outputto "Year"
findline "<b>Release Date</b>"
moveline 1
sayregexp "(?<=<td>)\d{4} *(?=</td>)" ""
if "<td><a "
findinline "title=\"View albums released on"
sayregexp "\d{4}(?=\" href)" "" "</a>"
endif
# Publish Format
outputto "Format"
findline "<b>Publish Format</b>"
joinuntil "</tr>"
findinline "<td>"
sayuntil "</td>"
# Media Format
outputto "Mediatype"
findline "<b>Media Format</b>"
joinuntil "</tr>"
findinline "<td>"
sayuntil "</td>"
# Classification (Genre)
outputto "Genre"
findline "<b>Classification</b>"
joinuntil "</tr>"
findinline "<td>"
sayuntil "</td>"
# Publisher
#findline "<b>Published by</b>"
#findline "<b>Organizations</b>"
#findline "<b>Label</b>"
#outputto "Publisher"
#moveline 1
#regexpreplace "<span style=\"display:none\"><em> */ *</em></span>" ""
#regexpreplace "<span title=\"[^\"]*\" class=\"artistname\" lang=\"en\" style=\"display:inline\">([^<]+)</span>" "$1"
#regexpreplace "<span title=\"[^\"]*\" class=\"artistname\" lang=\"ja\" style=\"display:none\">.+?</span>" ""
#regexpreplace "<span class=\"productname\" lang=\"en\" style=\"display:inline\">([^<]+)</span>" "$1"
#regexpreplace "<span class=\"productname\" lang=\"[-\w]+\" style=\"display:none\">([^<]+)</span>" ""
#regexpreplace "<a[^>]+>" ""
#replace "</a>" ""
#sayregexp "(?<=<td>)[^<]+(?=</td>)" ""
# Composer
#findline "<b>Composed by</b>"
findline "<span title=\"Composer\""
outputto "Composer"
#moveline 1
regexpreplace "<span style=\"display:none\"><em> */ *</em></span>" ""
regexpreplace "<span title=\"[^\"]*\" class=\"artistname\" lang=\"en\" style=\"display:inline\">([^<]+)</span>" "$1"
regexpreplace "<span title=\"[^\"]*\" class=\"artistname\" lang=\"ja\" style=\"display:none\">.+?</span>" ""
regexpreplace "<a[^>]+>" ""
replace "</a>" ""
sayregexp "(?<=<td width=\"100%\">)[^<]+(?=</td>)" ", "
outputto "Artist"
sayregexp "(?<=<td width=\"100%\">)[^<]+(?=</td>)" ", "
### # Arranged
### #findline "<b>Arranged by</b>"
### findline "<span title=\"Arranger\""
### outputto "Writer"
### #moveline 1
### regexpreplace "<span style=\"display:none\"><em> */ *</em></span>" ""
### regexpreplace "<span title=\"[^\"]*\" class=\"artistname\" lang=\"en\" style=\"display:inline\">([^<]+)</span>" "$1"
### regexpreplace "<span title=\"[^\"]*\" class=\"artistname\" lang=\"ja\" style=\"display:none\">.+?</span>" ""
### regexpreplace "<a[^>]+>" ""
### replace "</a>" ""
### sayregexp "(?<=<td>)[^<]+(?=</td>)" ""
###
###
### # Performed
### #findline "<b>Performer</b>" 1 1
### findline "<span title=\"Performer\""
### #unspace
### if "<span"
### outputto "Artist"
### #moveline 1
### regexpreplace "<span style=\"display:none\"><em> */ *</em></span>" ""
### regexpreplace "<span title=\"[^\"]*\" class=\"artistname\" lang=\"en\" style=\"display:inline\">([^<]+)</span>" "$1"
### regexpreplace "<span title=\"[^\"]*\" class=\"artistname\" lang=\"ja\" style=\"display:none\">.+?</span>" ""
### regexpreplace "<a[^>]+>" ""
### replace "</a>" ""
### sayregexp "(?<=<td>)[^<]+(?=</td>)" ""
### else
### findline "<span title=\"Composer\"" -1
### outputto "Artist"
### regexpreplace "<span style=\"display:none\"><em> */ *</em></span>" ""
### regexpreplace "<span title=\"[^\"]*\" class=\"artistname\" lang=\"en\" style=\"display:inline\">([^<]+)</span>" "$1"
### regexpreplace "<span title=\"[^\"]*\" class=\"artistname\" lang=\"ja\" style=\"display:none\">.+?</span>" ""
### regexpreplace "<a[^>]+>" ""
### replace "</a>" ""
### sayregexp "(?<=<td>)[^<]+(?=</td>)" ""
### endif
# Tracks
# findline "<b>Disc 2</b></span>"
#findline "class=\"smallfont\"><span class=\"label\">"
findline "id=\"tracklist\""
do
outputto "Tracks"
#moveline 1
outputto "Track"
#findline " class=\"smallfont\">"
findline "class=\"smallfont\"><span class=\"label\">" 1 1
sayregexp "(?<=<span class=\"label\">)[\d]+(?=</span>)" ""
say "|"
moveline 1
outputto "Title"
findline "width=\"100%\" colspan=\"2\">"
findinline "width=\"100%\" colspan=\"2\">"
moveline 1
#regexpreplace "^\s*" ""
unspace
regexpreplace "^\s*" ""
sayuntilml "</td>"
say "|"
outputto "Length"
moveline 1
findline " class=\"time\">"
sayregexp "(?<=<span class=\"time\">)[\d:]+(?=</span>)" ""
say "|"
findline "class=\"smallfont\"><span class=\"label\">" 1 1
while "<td "
# Notes
gotoline 1
outputto "Notes"
findline "<h3>Notes</h3>"
findline "class=\"smallfont\">"
regexpreplace "\s*<br ?\/?>\s*" "\r\n"
findinline "class=\"smallfont\">"
ifnot "<i class='label'>"
sayuntil "</div>"
endif
# VGMdb Album URL
outputto "VGMdb Album Url"
sayoutput "CurrentUrl"
# ... Customization ...
#set "genre" "Game"
# Fields that you want to remove
# (to remove a field write: set "field")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment