Skip to content

Instantly share code, notes, and snippets.

@PBXg33k
Last active March 21, 2024 09:16
Show Gist options
  • Save PBXg33k/7b80a86d53b922f0873a to your computer and use it in GitHub Desktop.
Save PBXg33k/7b80a86d53b922f0873a 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
#
#
# 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
#
# ###################################################################
[Name]=VGMdb - Search by Album
[BasedOn]=vgmdb.net
[IndexUrl]=http://vgmdb.net/search?q=%s
[AlbumUrl]=http://vgmdb.net/album/
[WordSeperator]=+
[IndexFormat]=%Catalog%|%_url%|%Album%|%Year%
[SearchBy]=%album%
[Encoding]=url-utf-8
[ParserScriptIndex]=...
# ###################################################################
# I N D E X
# ###################################################################
#debug "on" "C:\\tmp\\debug_vgmdb_A.htm" "10"
#debugwriteinput "C:\\tmp\\vgmdb_search by album.htm"
findline "<tr rel='rel_" 1 1
ifnot "<tr rel"
say "|"
sayoutput "CurrentURL"
say "|"
say "|"
exit
endif
do
replace "|" "/"
findinline "span class=" #'catalog'>
findinline ">"
sayuntil "</span"
say "|"
# URL
findinline "http://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" "C:\\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>"
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>"
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>)[^<]+(?=</td>)" ""
# Arranged
findline "<b>Arranged by</b>"
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>Performed by</b>" 1 1
unspace
if "<tr><td"
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 "nff44455553333332_____-------" -1 1
endif
# Tracks
# findline "<b>Disc 2</b></span>"
findline "class=\"smallfont\"><span class=\"label\">"
do
outputto "Tracks"
moveline 1
findinline "width=\"100%\">"
sayuntil "</td>"
say "|"
outputto "_Length"
moveline 1
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")
@JoelGalaxy
Copy link

Thank you very much for this! I was going crazy trying to find a working script for vgmdb after the old ones stopped working! :P Thanks again.

@Jakoh
Copy link

Jakoh commented Jan 26, 2018

I'd like a little bit of help here if possible :)

I've put the file "VGMdb#Search by &Album" into source directory of mp3tag but i still can't see the option in mp3tag to grab data from vgmdb. Is there something i'm missing? Thank you :)

@arora388
Copy link

I'm having the same issue. Help would be greatly appreciated.

@hungvinh
Copy link

hungvinh commented Mar 5, 2018

Hey, I'm running into an error when trying to retrieve an album,

"Error connecting to server: vgmdb.net
Invalid URL"

Did I do something wrong or did vgmdb make some changes?

Edit: Nevermind, I just had to update mp3tag, I guess my version was outdated. Sorry! Hope this comment helps if anyone has the same issue.

@ShadowT3mplar
Copy link

@arora388 @Jakoh , Not sure if you two are still having issues, but if you downloaded the zip, the file inside is missing the extension so it only appears as a .file.

You need to change the file extension to .src like all of the others inside that folder.

image

@rocknard
Copy link

Doesn't work anymore.

@Tohusk
Copy link

Tohusk commented Nov 2, 2018

I can't thank you enough for this. You're an absolute god.

@axeldna
Copy link

axeldna commented Nov 20, 2018

Unfortunately, it's not working anymore.

@coglearner
Copy link

still works; just change everything that says 'http' to 'https'

@axeldna
Copy link

axeldna commented Mar 16, 2019

still works; just change everything that says 'http' to 'https'

Wonderful tip! Worked!

@master117
Copy link

Could you adhjust it so that instead of year containing just the year we can get iso format, like YYYY-MM-DD?

@PBXg33k
Copy link
Author

PBXg33k commented Jun 27, 2019

That's a pretty good idea, i'll look into it

@starkgate
Copy link

Looks like the script recently broke. Update to vgmdb perhaps?

@jiyunomegami
Copy link

I got it to work with the current site. It works well enough for my needs, but it might not be 100% the same as before.
It should work with Mp3Tag, but I can only test it with puddletag on Linux, not the actual Mp3Tag on Windows.
Get it here:
https://gist.github.com/jiyunomegami/3c190ba8af13252840ea70eea10afcd7

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