Open Murderhead opened 3 months ago
I wrote such a script in python. Searches for roms in the "ROMS" directory and the unpacked roms are placed in the "UNPACKED" directory.
import zipfile
import os
onlyfiles = [f for f in os.listdir("./ROMS")]
for f in onlyfiles:
with open("./ROMS/" + f, 'rb') as in_file:
with open(f+'.zip', 'wb') as out_file:
out_file.write(in_file.read()[59904:])
with zipfile.ZipFile(f+'.zip',"r") as zip_ref:
if not os.path.exists("./UNPACKED"):
os.makedirs("./UNPACKED")
zip_ref.extractall("./UNPACKED")
os.remove(f+'.zip')
Would it be possible to add a function to extract every rom file?