-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmass_extract.py
44 lines (36 loc) · 1.07 KB
/
mass_extract.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import argparse
import os
import subprocess
import sys
argparser = argparse.ArgumentParser(
description="Mass extractor for Breath of Fire IV dialogue sections"
)
argparser.add_argument(
"source", metavar="SOURCE", type=str, help="Source folder containing the .EMI files"
)
argparser.add_argument(
"target",
metavar="TARGET",
type=str,
help="Output folder containing the extracted dialogues",
)
argparser.add_argument("-j", "--jp", "--japanese", action="store_true")
argparser.add_argument("-v", "--verbose", action="store_true")
args = argparser.parse_args()
def main():
files = os.listdir(path=args.source)
if not os.path.exists(args.target):
os.mkdir(args.target)
extractor = "jpextractor.exe" if args.jp else "extractor.exe"
for i in files:
if args.verbose:
print("Extracting", i)
subprocess.run(
[
extractor,
"/".join([args.source, i]),
"".join([args.target, "/", i, "_output.txt"]),
]
)
if __name__ == "__main__":
main()