Created
February 17, 2020 14:07
-
-
Save Zer0xFF/523623b188ecea6b298d8b70c2b95ac0 to your computer and use it in GitHub Desktop.
Verify Collection Of PS2 Dumps Against Redump
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# pip3 install --user filehash untangle | |
import os | |
import untangle | |
from filehash import FileHash | |
obj = untangle.parse('redump.ps2.dat') | |
hashes = set() | |
for game in obj.datafile.game: | |
for rom in game.rom: | |
hashes.add(rom['crc']) | |
obj = None | |
path = 'G:\\PS2ISO\\' | |
files = [] | |
for r, d, f in os.walk(path): | |
for file in f: | |
files.append(os.path.join(r, file)) | |
invalidCrc = [] | |
crc32hasher = FileHash('crc32') | |
for file in files: | |
print("Processing {}".format(file), end = '', flush=True) | |
crc = crc32hasher.hash_file(file).casefold() | |
print(" - CRC {}".format(crc), end = '', flush=True) | |
if(crc in hashes): | |
print(" - Valid", flush=True) | |
else: | |
print(" - Invalid", flush=True) | |
invalidCrc.append(file) | |
print("Invalid Dumps", invalidCrc) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Zer0xFF:flatpak