1
0
mirror of https://github.com/Escartem/AnimeWwise.git synced 2026-06-05 07:50:23 +08:00

better error handling

This commit is contained in:
Escartem
2025-01-07 14:42:02 +01:00
parent 982bf81c27
commit f28afbb87c
5 changed files with 27 additions and 16 deletions

View File

@@ -11,7 +11,12 @@ from filereader import FileReader
cwd = os.getcwd()
path = lambda *args: os.path.join(*args)
call = lambda args: subprocess.call(args, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
def call(args):
try:
subprocess.call(args, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
except Exception as e:
print(f"[WARNING] failed to extract, {e}")
class WwiseExtract:
def __init__(self):
@@ -170,6 +175,9 @@ class WwiseExtract:
wem_data = data[file_data["offset"]:file_data["offset"]+file_data["size"]]
parsed_wem = wwise.parse_wwise(FileReader(io.BytesIO(wem_data), "little", name=f"{file[3]}:{file[0]}:{file[1]}"))
if not parsed_wem:
continue
file_data["metadata"] = parsed_wem
if key is not None: