Hacking Mass-rename/folder creation for Nintendon't

VashTS

Beat it, son
Member
Joined
Mar 14, 2009
Messages
4,307
Trophies
1
Age
39
Location
Upstate NY
XP
3,736
Country
United States
I've had this from a member here quite a while ago. This is what I used to rename my GC isos.
 

Attachments

  • GameFolderRenamer.zip
    9.3 KB · Views: 606

Kazuma77

Well-Known Member
Member
Joined
May 11, 2008
Messages
1,035
Trophies
1
XP
889
Country
United States
Knowing the "error" that halted the app would have helped us determine what happened. Seems like you went to a lot of trouble to get this going. WIT took care of it all aside from a few multidisc games and that was a few minutes of fixing time. The ID's are kind of important too...if you are to download covers and such. They are not just to look at :)

Also, the scrubbing does happen on the copy command, that is correct. But with the switch it wont. I personally like to copy as opposed to move when I am dealing with 800GB of files though, and that switch was the way to do it without scrubbing them.

Unfortunately, I can't remember what it was. And I obviously have no need to try to do it again just to get the error. All I can remember is it said something right after it finished the scan and started processing the first file, then it halted the entire operation. It's a Redump set, so, it can't be a problem with the actual files.

USB Loader GX, Wiiflow, Postloader, Nintendont's own front end, and any other loader worth downloading is going to read the ID straight from the ISO. So, yes, having them in the folder name is completely cosmetic. Far more cosmetic than split FLAC tracks. Actually, there's nothing cosmetic about split FLAC tracks. Splitting a FLAC will actually destroy hidden track 1 audio if present, so they actually present a real threat to proper audio preservation. But you get what I mean. If you're using Foobar2000 and something like Facets, you're not complaining about properly ripped music in image format with the cue and artwork embedded, because you can see the tracks where you actually need to be able to. How the game appears on the Wii is completely up to the launcher's UI. The folder's name has zero impact. My covers downloaded just fine.

Also, it sounds like you went to more trouble than me if it took you a few minutes to fix the 2 disc files. The entire process I described took me less than 2 minutes to actually perform. I fully automated the "disc2" renaming, merging of folders by eliminating "Disc #" from the folder names, etc. I batch processed everything, 2 disc games included. I had to separate them into 3 folders temporarily to do that, but it was easy. Once I moved everything back together, the 2 disc games merged into the correct folders on their own. The only complicated thing was trying to describe the process in a way that everyone can understand it.

As for the batch file, it was something I already had for the purpose of downloading album art. You can't have multiple copies of folder.jpg in the same folder after all, so I use that to temporarily separate my albums into folders, then after AAD is done, I feed them back to CueTools and have it re-encode them back to the artist folder as image files with everything embedded, and delete the folders. Not the most direct approach, but I've got over 4000 albums (from over 400 artists), so embedding artwork manually is out of the question.

Regardless, we're splitting hairs over a terrible naming scheme. Clearly the people who come up with things like this and "program.rom" have never had to run recovery software on a drive -- the folder's name is not usually something you get the luxury of recovering after all.

I've found Advanced Renamer to be perfect for the task of renaming ISOs and moving them into folders. Simply set the options marked in the screenshot and you should be good to go! :)

Looks kind-of ghetto compared to Total Commander's mass rename tool ;) Still, any mass rename tool should get the job done. I would separate the multi-disc games so you can mass rename the "Disc 1" and "Disc 2" off of the folders, and mass rename the second discs to "disc2.iso" instead of "game.iso" as well. Then you can just move everything back to one folder and the two disc games will merge automatically. Saves you the trouble of renaming and merging them manually. But do whatever you find easier. The end result is all that matters.
 
Last edited by Kazuma77,

rogerx

New Member
Newbie
Joined
Nov 30, 2006
Messages
1
Trophies
0
XP
210
Country
United States
There is a utility called Wiimms ISO Tool that can deal with messing with Wii and GC ISO images. I was able to use it to add GameID names, create folders, and move the ISOs to the folders renamed as game.iso with a single command..... once I figured the %$^&@# thing out.

The command I used was: wit COPY *.iso "games\%G [%I]\game.iso"

Which basically means "Create a folder named "games", then inside that create a folder for each iso with it's filename(minus the iso extension at the end), a space, then the GameID in brackets, then copy that iso into that folder while renaming it "game.iso""... I could have just used MOVE instead of COPY but I wanted to have the source files in case something went wrong to try again.

I did have to go in manually and fix up the multidisk games as it would put each disk in it's own folder this way, but there was only a small handful of those, other than that it did the job.... at least, from what I can see of my directory structure it did the job, haven't gotten my new harddrive for these so I can test Nintendon't yet.

This was, indeed, the most useful post on the internet for organizing backups, so again, thank you!

I can confirm that there is a quicker way to move - without scrubbing/copying the .iso - by using this syntax:

Code:
wit MOVE --source ./ --DEST "games\%N [%I]\game.iso"

You can specify the source directory to be any specific directory (in this case, dot-slash is the current directory). I use %N in place of %G to pull the canonical game title from the database, and like you, I need to clean up multi-disc directories by hand. But it's MUCH faster that wit COPY.
 
  • Like
Reactions: Exidous

Germini

Member
Newcomer
Joined
Oct 13, 2007
Messages
23
Trophies
1
XP
373
Country
United States
I've created this little python script.
What It does:
  • Verifies iso file is a valid game from wiitdb database
  • Copies iso files from current directory and subdirectories to "games" folder. In a 1:1 way. No compression.
  • Assigns game title and gameid to destination folder
  • Reads disc number, renaming iso file to disc2, instead of game.iso
How to: place the script and wiitdb.txt in the folder where all your games are
Get wiitdb.txt from here
Any improvement would be appreciated : )

Code:
import os
import re
import shutil

total_games = 0
dir = "./"
dirs = os.listdir("./")
wiitdb = open("wiitdb.txt", "r")

for root, dirs, files in os.walk(dir):
    if 'games' in dirs:
        dirs.remove('games')
    for file in files:
        if file.endswith(".iso"):
            pathfile = os.path.join(root, file)
            print("Reading file: "+ pathfile)
            f = open(pathfile)
            f.seek(0)
            header = f.read(7)
            gameid = header[:6]
            disc_number = ord(header[-1:])
            disc_number += 1
            print("GameID: "+ gameid + " Disc: "+ str(disc_number))
            match = re.search(r'\w+', gameid)
            if match:
                if not os.path.exists(dir + "games"):
                    os.makedirs(dir+"games")
                with open("wiitdb.txt", encoding='utf-8') as wiitdb:
                    for line in wiitdb:
                       m= re.match(gameid+r" = ([\w\W\s]+)", line)
                       if m:
                            gamename = m.group(1)
                            if ":" in gamename:
                                gamename = gamename.replace(':', ' - ')
                            if "\n" in gamename:
                                gamename = gamename.replace ('\n', '')
                            print("Game title: "+gamename)
                            newgamepath = dir+"games"+"/"+gamename+" ["+gameid+"]"
                            if not os.path.exists(newgamepath):
                                os.makedirs(newgamepath)
                                print("Copying game...")
                                shutil.copy(pathfile, newgamepath + "/game.iso")
                                total_games += 1
                            if  not os.path.exists(newgamepath+"/disc"+ str(disc_number)+".iso") and disc_number > 1:
                                print("Copying game...")
                                shutil.copy(pathfile, newgamepath + "/disc"+ str(disc_number) +".iso")
                                total_games += 1
            else:
                print("GameID: Invalid!!")
            print("====================================")
print("Total games copied: " + str(total_games))
 

ca032769

INFOCOM Collector
Member
Joined
Jan 11, 2012
Messages
636
Trophies
1
Location
Riverside, CA
XP
1,888
Country
United States
I've created this little python script.
What It does:
  • Verifies iso file is a valid game from wiitdb database
  • Copies iso files from current directory and subdirectories to "games" folder. In a 1:1 way. No compression.
  • Assigns game title and gameid to destination folder
  • Reads disc number, renaming iso file to disc2, instead of game.iso
How to: place the script and wiitdb.txt in the folder where all your games are
Get wiitdb.txt from here
Any improvement would be appreciated : )

Code:
import os
import re
import shutil

total_games = 0
dir = "./"
dirs = os.listdir("./")
wiitdb = open("wiitdb.txt", "r")

for root, dirs, files in os.walk(dir):
    if 'games' in dirs:
        dirs.remove('games')
    for file in files:
        if file.endswith(".iso"):
            pathfile = os.path.join(root, file)
            print("Reading file: "+ pathfile)
            f = open(pathfile)
            f.seek(0)
            header = f.read(7)
            gameid = header[:6]
            disc_number = ord(header[-1:])
            disc_number += 1
            print("GameID: "+ gameid + " Disc: "+ str(disc_number))
            match = re.search(r'\w+', gameid)
            if match:
                if not os.path.exists(dir + "games"):
                    os.makedirs(dir+"games")
                with open("wiitdb.txt", encoding='utf-8') as wiitdb:
                    for line in wiitdb:
                       m= re.match(gameid+r" = ([\w\W\s]+)", line)
                       if m:
                            gamename = m.group(1)
                            if ":" in gamename:
                                gamename = gamename.replace(':', ' - ')
                            if "\n" in gamename:
                                gamename = gamename.replace ('\n', '')
                            print("Game title: "+gamename)
                            newgamepath = dir+"games"+"/"+gamename+" ["+gameid+"]"
                            if not os.path.exists(newgamepath):
                                os.makedirs(newgamepath)
                                print("Copying game...")
                                shutil.copy(pathfile, newgamepath + "/game.iso")
                                total_games += 1
                            if  not os.path.exists(newgamepath+"/disc"+ str(disc_number)+".iso") and disc_number > 1:
                                print("Copying game...")
                                shutil.copy(pathfile, newgamepath + "/disc"+ str(disc_number) +".iso")
                                total_games += 1
            else:
                print("GameID: Invalid!!")
            print("====================================")
print("Total games copied: " + str(total_games))

Sorry in advance, I'm not a programmer, how do I use this to rename my GC's?
 

Germini

Member
Newcomer
Joined
Oct 13, 2007
Messages
23
Trophies
1
XP
373
Country
United States
You must install python, then paste the code into a notepad and save it as script.py in the place where you have all your gamecube iso's, then execute it and wait :)
I could make it an executable file but would be like 30mb :s
 
Last edited by Germini,

ca032769

INFOCOM Collector
Member
Joined
Jan 11, 2012
Messages
636
Trophies
1
Location
Riverside, CA
XP
1,888
Country
United States
You must install python, then paste the code into a notepad and save it as script.py in the place where you have all your gamecube iso's, then execute it and wait :)
I could make it an executable file but would be like 30mb :s

If you did make it an executable file would I still need to install Python? If not, executable file requested please.
 

Prodeje79

New Member
Newbie
Joined
Sep 23, 2016
Messages
1
Trophies
0
XP
42
Country
United States
Long time lurker, just finally joined to like you post!

This worked great for me! I am basically converting from a Wii only flash drive to a 1TB hard drive with Wii and GC stuff.....

Next step is to edit USBLGx settings to work with Nintendont, figure out how to load all game covers to 1TB drive (instead of my SD card), and maybe add a run USBLoaderGX from home menu....

thanks again!

EDIT:
I had 3 games not work. It might be because : cannot be used in a folder name? not sure.
Maybe its the existing naming convention:
THE LEGEND OF ZELDA The Wind Waker for USA [GZLE01]
The Legend of Zelda - Four Swords FOR NINTENDO GAMECUBE [G4SE01]
ZELDA OCARINA MULTI PACK [D43J01]

I've created this little python script.
What It does:
  • Verifies iso file is a valid game from wiitdb database
  • Copies iso files from current directory and subdirectories to "games" folder. In a 1:1 way. No compression.
  • Assigns game title and gameid to destination folder
  • Reads disc number, renaming iso file to disc2, instead of game.iso
How to: place the script and wiitdb.txt in the folder where all your games are
Get wiitdb.txt from here
Any improvement would be appreciated : )

Code:
import os
import re
import shutil

total_games = 0
dir = "./"
dirs = os.listdir("./")
wiitdb = open("wiitdb.txt", "r")

for root, dirs, files in os.walk(dir):
    if 'games' in dirs:
        dirs.remove('games')
    for file in files:
        if file.endswith(".iso"):
            pathfile = os.path.join(root, file)
            print("Reading file: "+ pathfile)
            f = open(pathfile)
            f.seek(0)
            header = f.read(7)
            gameid = header[:6]
            disc_number = ord(header[-1:])
            disc_number += 1
            print("GameID: "+ gameid + " Disc: "+ str(disc_number))
            match = re.search(r'\w+', gameid)
            if match:
                if not os.path.exists(dir + "games"):
                    os.makedirs(dir+"games")
                with open("wiitdb.txt", encoding='utf-8') as wiitdb:
                    for line in wiitdb:
                       m= re.match(gameid+r" = ([\w\W\s]+)", line)
                       if m:
                            gamename = m.group(1)
                            if ":" in gamename:
                                gamename = gamename.replace(':', ' - ')
                            if "\n" in gamename:
                                gamename = gamename.replace ('\n', '')
                            print("Game title: "+gamename)
                            newgamepath = dir+"games"+"/"+gamename+" ["+gameid+"]"
                            if not os.path.exists(newgamepath):
                                os.makedirs(newgamepath)
                                print("Copying game...")
                                shutil.copy(pathfile, newgamepath + "/game.iso")
                                total_games += 1
                            if  not os.path.exists(newgamepath+"/disc"+ str(disc_number)+".iso") and disc_number > 1:
                                print("Copying game...")
                                shutil.copy(pathfile, newgamepath + "/disc"+ str(disc_number) +".iso")
                                total_games += 1
            else:
                print("GameID: Invalid!!")
            print("====================================")
print("Total games copied: " + str(total_games))
 
Last edited by Prodeje79,
  • Like
Reactions: Tx3Jorge

Tx3Jorge

New Member
Newbie
Joined
Sep 28, 2016
Messages
1
Trophies
0
Age
30
XP
41
Country
United States
Made an account just to give a huuge shoutout to Germini for saving me so much time with his script. It's running in the background for me as I type this post.

I'll attach some screens so people get a feel for what it looks like. I'm using windows 10 Btw. Downloaded Python from Python.org

bi0WMtj.png
zSduEuR.png
pOQgkxG.png
G3HbBML.png
 

Vantis

Active Member
Newcomer
Joined
Feb 12, 2018
Messages
33
Trophies
0
Age
43
XP
216
Country
Canada
Thank you for the script

I have a question when I try on a about 50 titles it will close the error I get is saying missing “txt” not sure if some titles are not listed in the text file and it just closes

Have you seen this before ?

QUOTE="Germini, post: 6676697, member: 106616"]You must install python, then paste the code into a notepad and save it as script.py in the place where you have all your gamecube iso's, then execute it and wait :)
I could make it an executable file but would be like 30mb :s[/QUOTE]
 

Vantis

Active Member
Newcomer
Joined
Feb 12, 2018
Messages
33
Trophies
0
Age
43
XP
216
Country
Canada
Germini,

So if there is a game file the program can not scan it closes and does not continue on to the next game

Is there a way to continue to the next one with out shutting down script ?
 

evertonstz

Well-Known Member
Member
Joined
Jan 5, 2019
Messages
209
Trophies
0
Age
29
XP
557
Country
Brazil
I know the topic is a little old, but I "fixed" some things in @Gemini 's python code to run a little better for me, if anyone is interested:
What I changed:
  • added a percentage counter of how much the file was copied, I used threads so I don't really know how... unusual was my code...
  • the script will skip to the next iso in case it can't match the ID with the wiitdb.txt
  • in case there's already a iso in the destiny folder, the script will compare them, if they match it'll skip, if not it'll overwrite the destination iso with the source iso (can be a little slow in case the filesizes are equal, as both files will have to be hashed, but it's faster than copying the file again)
  • I'm reading the iso as bytes, seems to work better
  • cleaned the code a little and removed the need for "re matching"
You can get it at github: https://github.com/evertonstz/nintendont-move-isos
Any problems you guys can open an issue on github or just pm me :)
 
Last edited by evertonstz,
  • Like
Reactions: BluPhant

scrappysphinx

Member
Newcomer
Joined
Oct 30, 2010
Messages
22
Trophies
0
XP
54
Country
Hi, i tried to use your python script (just wanted to test so only 2 different games, a single disc and a multi disc game) but it gives me a GameID invalid error. Any ideas what i've done wrong?

Reading file: ./4x4 Evo 2 (USA).iso
GameID: Invalid!!
====================================

Reading file: ./Resident Evil (USA) (Disc 1).iso
GameID: Invalid!!
====================================

Reading file: ./Resident Evil (USA) (Disc 2).iso
GameID: Invalid!!
====================================

Total ISOs copied: 0 Total ISOs ignored: 3

I then tried the original script by Gemini earlier in the thread and that give the following output (nothing about invalid but doesn't actually make any directories or copy any games)

Reading file: ./4x4 Evo 2 (USA).iso
GameID: GE4E7D Disc: 1
====================================
Reading file: ./Resident Evil (USA) (Disc 1).iso
GameID: GBIE08 Disc: 1
====================================
Reading file: ./Resident Evil (USA) (Disc 2).iso
GameID: GBIE08 Disc: 2
====================================
Total games copied: 0
 

scrappysphinx

Member
Newcomer
Joined
Oct 30, 2010
Messages
22
Trophies
0
XP
54
Country
I'm all sorted, used Wiimm and got myself a nice Nintendont folder.

Also i reported the issues with the python script on github and evertonstz replied and advised he'll look into it which was nice :)
 

gonefishing1975

Well-Known Member
Member
Joined
Jan 23, 2020
Messages
213
Trophies
0
Age
48
XP
524
Country
Canada
Hey

I downloaded a wack of Gamecube games. I put them on my USB drive into the "games" folder. Example Games/smashbros/smashbros.iso. How do you rename all the games that are in separate folders to game.iso without having to do it 1 by 1

Thanks
 

gonefishing1975

Well-Known Member
Member
Joined
Jan 23, 2020
Messages
213
Trophies
0
Age
48
XP
524
Country
Canada
I did try to search *.iso which does find all the iso files in my games and all sub folder but if you rename this way it changes the names to game(1) and so on. Both on my mac and PC
 

gonefishing1975

Well-Known Member
Member
Joined
Jan 23, 2020
Messages
213
Trophies
0
Age
48
XP
524
Country
Canada
I have a utility I've been working on that does that if you'd like to test it. Send me a PM if you're interested and I will send it to you. It is only for Windows and you'll need the .NET Framework 4.5 installed.


Hey can I get a copy of this utility? I have all my gamecube games on my external usb drive in the games folder. Each gamne has it's own folder with the name of the game. Example /games/smashbros/smashbros.iso. Since the games have to be named game.iso and I have over 100 I would like to rename them will a batch utility so I don't have to do them 1 by1

Than ks
 

ElektroDog

Member
Newcomer
Joined
Aug 7, 2020
Messages
9
Trophies
0
XP
55
Country
Germany
Hi all! :)

Just arrived here to chip in on this one.......

I've made 2 scripts for you all. One to file sort and prep the files, the other.... erm, simply reverts it all back to "as was" (So if you have an archive with correct naming elsewhere, you can revert back to it in a click!)

Super simple scripts, super fast to use.

- Extract into the game folder (or wherever your iso files are held, it'll work anywhere)
- Double click (some screen popup, briefly, let's you know it's worked)
- Done! Yes, Really!! :o (copy the files from PC, they're ready now..... Or run in place on HDD or SD so no transfers at all!)



I hope this helps you out!
 

Attachments

  • nintendont.7z
    403 bytes · Views: 212

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: @StatusN, welcome