[WS] VGMdb (extended)

Hello,

I am running the latest script (Version 2.4.5-20240901) and no matter what URL I use I cannot get the final track to map.
Example, a 24 track album will only return the tags for the first 23 tracks.
Attached Is a picture.
Reference URL: https://vgmdb.net/album/3092

Using MP3tag for Mac OS

Hi everyone,

I’m trying to edit my VGMdb script for use with MP3Tag, and I need some help tailoring it to my requirements. Here's what I’m trying to achieve:

  1. I want to extract only the English tags (e.g., titles, album names, artists) from the VGMdb data.
  2. I need the extracted tags to match the following MP3Tag fields:
  • Title: Track title (English)
  • Artist: Composer/Artist (English)
  • Album: Album/Soundtrack name (English)
  • Year: Release year
  • Genre: Always set to "Soundtrack"
  • Comment: Optional (blank unless there are additional notes)
  • Album Artist: Overall artist of the album (English)
  • Composer: Primary composer (English)
  • Discnumber: Disc number (if applicable)
  • Directory: The file/folder path
  1. I’m not sure how to properly edit the script to ensure these fields are populated correctly.

Could someone guide me on how to update the script, or share a solution to extract and map these tags properly?

I’m attaching an example screenshot of my MP3Tag setup and my current script for reference. Any advice would be greatly appreciated!

Hey, I don't have a Mac to test this but it works fine on Windows and Linux:

Hi, take a look at lines 3605 and following. This is the mapping part of the script. If you want to change the "main" language to english you probably only need to change

  • lines 3694 to 3705 for the english track title and
  • lines 3709 till 3720 for the english album title.

I'm not sure what you mean by "Composer/Artist (English)"... VGMDB knows a few fields regarding what you could consider the "main artist" of an album. Currently the script uses the "Vocals" credit over the "Performer" credit over the "Music" credit. If you want to change that you need to edit lines 3729 to 3740.

Having said that, I would highly recommend not changing the script and instead using the very handy "Action groups" function of Mp3tag.

1 Like

Kind of a reminder for myself: VGMdb plans to add an official API in 2025.

1 Like

Hello,

I seem to be encountering the same result as the original poster.
When I run the latest script (Version 2.4.5-20240901), I seem to always be missing tags for the last track. I'm using Mp3tag app on a macOS Sequoia. I wonder if it is a Mac specific issue?

I think this is because the parser on macOS is implemented more strictly than the one from the Windows version. Specifically, it requires the different multi-value fields like Tracks to end with a trailing pipe symbol |, e.g., Title 1|Title 2|Title 3|Title 4|. This also affects all other fields that are using this structure, e.g., track numbers and disc numbers.

I had a look at the script and have to admit, that it's too complex for an easy fix by myself. I've made a note to my internal wish list to check if I can make the parser on macOS more tolerant. My preference would be to not include more hacks and/or workarounds, though.

2 Likes

@Florian Thanks for the input! I've tried "fixing" this by just forcing a pipe symbol at the end of each multi-value track field... It doesn't seem to break anything on Windows at least :wink:

@Sheldonsuckz @Synk Can you test if the new version fixes it? I don't have access to a MacOS machine.

Version 2.4.6-20250103

  • Fixed an error leading to the last track of an album being not displayed on MacOS

VGMdb_by_URL.src (128.3 KB)

2 Likes

Hi @GiFuJo, I did a test using your latest version (2.4.6-20250103) and confirming that the tags for the last track are now showing when using the MacOS version of the app! Thank you very much!

One separate thing I noticed is that if there is more than one Disc, the Track # doesn't reset back to '1' for each Disc. So if the last Track # in Disc 1 is '12', the Track # for the first track of Disc 2 is '13' as opposed to '1'.
Example: https://vgmdb.net/album/46

Sorry, I assume this was probably brought up or discussed previously in other threads and it's a known limitation?

Thanks for testing!

@Florian Maybe you can chime in here: My scraper actually scrapes the track numbers like this

01|02|03|04|05|06|07|08|09|10|11|12|01|02|03|04|05|06|07|08|09|10|11|12|13|

These values are stored inside custom fields:

  • VGMDB_TRACK_TITLE_JAP
  • VGMDB_TRACK_TITLE_ROM
  • VGMDB_TRACK_TITLE_ENG

I then use the following lines to write the track numbers (and titles) to the correct id3 fields:

# TRACKS (TRACKNUMBER + TITLE) : VGMDB_TRACK_TITLE_ROM > VGMDB_TRACK_TITLE_ENG > VGMDB_TRACK_TITLE_JAP

OutputTo "TRACKS"
IfOutput "VGMDB_TRACK_TITLE_ROM"
  SayOutput "VGMDB_TRACK_TITLE_ROM"
Else
  IfOutput "VGMDB_TRACK_TITLE_ENG"
    SayOutput "VGMDB_TRACK_TITLE_ENG"
  Else
    IfOutput "VGMDB_TRACK_TITLE_JAP"
      SayOutput "VGMDB_TRACK_TITLE_JAP"
    EndIf
  EndIf
EndIf

But this does not seem to be the correct way to do it, because while the track title is correctly said, the track number is just counted alongside the track title. So in the end the tracks are written like 1..25 instead of 1..12 and 1..13.

Edit: Which, now that I look at it, makes complete sense, since I don't even reference the custom fields with the corret numbers there ...

Thank you for the quick update! It works fine on both Windows and macOS.

I think it still misses the trailing pipe symbol for the fields VGMDB_TRACK_NUMBER_ROM, VGMDB_TRACK_NUMBER_ENG, and VGMDB_TRACK_NUMBER_JAP.

To then use these values for the track number — instead of letting Mp3tag create track numbers via a simple index sequence — you need to output this to TRACK (not TRACKS, which contains the titles).

OutputTo "TRACK"
IfOutput "VGMDB_TRACK_NUMBER_ROM"
  SayOutput "VGMDB_TRACK_NUMBER_ROM"
Else
  IfOutput "VGMDB_TRACK_NUMBER_ENG"
    SayOutput "VGMDB_TRACK_NUMBER_ENG"
  Else
    IfOutput "VGMDB_TRACK_NUMBER_JAP"
      SayOutput "VGMDB_TRACK_NUMBER_JAP"
    EndIf
  EndIf
EndIf

Yeah, I fixed this for the new version.

This works great :smiley:

While looking into this I noticed something else: TOTALTRACKS currently uses the number of tracks of the last disc. Since this is pretty much always wrong for multi disc albums I've disabled the default mapping to the id3 field. I'll try fixing this in a future version, but it's quite complicated to implement.

Version 2.4.7-20250104

  • Fine tuning for the last fix
  • Track numbers are now numbered by disc not total
  • Disabled the default mapping to TOTALTRACKS since it is not accurate on multi disc albums

VGMdb_by_URL.src (129.6 KB)

1 Like

Thanks @GiFuJo, each version is a great improvement!

Upon closer inspection using Version 2.4.6-20250103 or 2.4.7-20250104 on the MacOS version of the app, I didn't notice this at first but I see that the Disc Number for the final track repeats the Disc numbers. If there are multiple Discs, then it occurs on the final track of the last Disc. The number of times the disc number repeats seems to be based on the amount of tracks in each disc.

Example: https://vgmdb.net/album/46
Disc 2, Track #13 has a Disc Number of "1|1|1|1|1|1|1|1|1|1|1|1|2|2|2|2|2|2|2|2|2|2|2|2|2".

Screenshot attached:

It's an easy manual fix on my end, but wanted to mention in case this also occurs on the Windows version.

Thanks for testing!

Should be fixed with the following release:

Version 2.4.8-20250105

  • Fixed an error where the disc numbers would not be properly assigned on MacOS

VGMdb_by_URL.src (129.9 KB)

5 Likes

Version 2.5.0-20250215

  • Code cleanup

VGMdb_by_URL.src (130.4 KB)

1 Like

Hello,
I fall upon your script but I got a completely blank metadata and track fields.
I'm on Windows and the album is https://vgmdb.net/album/26536
is there something I'm doing wrong (didn't use Mp3Tag a lot)

Hi there,

thanks for the report. I didn't know that the credits block could be missing entirely on VGMdb, so this album throws an error, because it expects to find at least the credits block.

Should be fixed in this version:

Version 2.5.1-20250225

  • Fixed an error if credits are missing entirely on VGMdb

VGMdb_by_URL.src (130.6 KB)

Please do report back if that solves the problem for you.


@Florian While checking out the error I found that I often use this kind of parser command:

FindLine "class=\"albumtitle\"" 1 1

That's probably wrong even though it doesn't throw an error, because FindLine doesn't accept a second number argument, right? Is this third argument just silently ignored?

1 Like

Yes, Source (before the change mentioned below was made)

There is a FindInLine with a second parameter:

Explanation for S and n

1 Like

Thanks, that's how I read it, too.

In that case the documentation seems to be incomplete, because FindLine does in fact accept the second numeric parameter and behaves like FindInLine. If I remove the second parameter FindLine errors out if no match is found.

Nice find! I've updated the documentation and added

If the 3rd parameter is set to 1, no error is produced if S is not found.

2 Likes