Skip to content

Commit

Permalink
Added 3do support
Browse files Browse the repository at this point in the history
  • Loading branch information
tralph3 committed Sep 14, 2020
1 parent 3616d72 commit 80b386e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
17 changes: 16 additions & 1 deletion CueMaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ def fetchCue(entryName):
elif args.system == "playstation2":
link = "{}{}.cue".format(configParser.get('Links', 'ps2CueBase'), entryName[:-4]).replace(" ", "%20")
cueText = urlopen(link).read().decode("UTF-8")
elif args.system == "3do":
link = "{}{}.cue".format(configParser.get('Links', '3doCueBase'), entryName[:-4]).replace(" ", "%20")
cueText = urlopen(link).read().decode("UTF-8")
return cueText

def getTrackNumber(entryName):
Expand Down Expand Up @@ -252,7 +255,7 @@ def createM3u(cueFiles):
configParser.read(configFilePath)

parser = argparse.ArgumentParser(description="Original .cue file fetcher for game roms and .m3u creator.", prog="cuemaker")
parser.add_argument("system", type=str, help="the system (console) the roms belong to", choices=["playstation", "playstation2", "saturn"])
parser.add_argument("system", type=str, help="the system (console) the roms belong to", choices=["playstation", "playstation2", "saturn", "3do"])
parser.add_argument("directory", type=str, help="the directory for the roms")
parser.add_argument("-r", "--recursive", action="store_true", help="search sub-folders")
parser.add_argument("-g", "--generic", action="store_true", help="create generic .cue files if originals can't be found")
Expand Down Expand Up @@ -300,6 +303,18 @@ def createM3u(cueFiles):
print("\u001b[0;31mError: Can't find hash file, make sure they are on the same folder as the script.\u001b[0m")
exit()

elif args.system == "3do":
try:
link = configParser.get("Links", "3doHash")
hashFile = urlopen(link).read().decode("UTF-8")
except Exception:
print("\u001b[0;31mError: Can't connect to GitHub, defaulting to local hash file.\u001b[0m")
try:
hashFile = open(scriptDirectory + "3do.hash", "r").read()
except FileNotFoundError:
print("\u001b[0;31mError: Can't find hash file, make sure they are on the same folder as the script.\u001b[0m")
exit()

try:
directory = args.directory
os.chdir(directory)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ usage: cuemaker [-h] [-r] [-g] [-m] {playstation,playstation2,saturn} directory
Original .cue file fetcher for game roms and .m3u creator.
positional arguments:
{playstation,playstation2,saturn}
{playstation,playstation2,saturn,3do}
the system (console) the roms belong to
directory the directory for the roms
Expand Down
3 changes: 3 additions & 0 deletions links.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
psxHash = https://raw.githubusercontent.com/tralph3/Content/master/Cue-Maker/psx.hash
ps2Hash = https://raw.githubusercontent.com/tralph3/Content/master/Cue-Maker/ps2.hash
saturnHash = https://raw.githubusercontent.com/tralph3/Content/master/Cue-Maker/saturn.hash
3doHash = https://raw.githubusercontent.com/tralph3/Content/master/Cue-Maker/3do.hash

psxCueBase = https://raw.githubusercontent.com/tralph3/Content/master/Cue-Maker/Sony%20PlayStation%20Cue%20Sheets%20(redump.org)/
ps2CueBase = https://raw.githubusercontent.com/tralph3/Content/master/Cue-Maker/Sony%20Playstation%202%20Cue%20Sheets%20(redump.org)/
saturnCueBase = https://raw.githubusercontent.com/tralph3/Content/master/Cue-Maker/Sega%20Saturn%20Cue%20Sheets%20(redump.org)/
3doCueBase = https://raw.githubusercontent.com/tralph3/Content/master/Cue-Maker/Panasonic%203DO%20Interactive%20Multiplayer/

0 comments on commit 80b386e

Please sign in to comment.