diff options
author | Devtools Arcadia <[email protected]> | 2022-02-07 18:08:42 +0300 |
---|---|---|
committer | Devtools Arcadia <[email protected]> | 2022-02-07 18:08:42 +0300 |
commit | 1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch) | |
tree | e26c9fed0de5d9873cce7e00bc214573dc2195b7 /build/scripts/extract_asrc.py |
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'build/scripts/extract_asrc.py')
-rw-r--r-- | build/scripts/extract_asrc.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/build/scripts/extract_asrc.py b/build/scripts/extract_asrc.py new file mode 100644 index 00000000000..89892ddf2de --- /dev/null +++ b/build/scripts/extract_asrc.py @@ -0,0 +1,23 @@ +import argparse +import os +import tarfile + + +def parse_args(): + parser = argparse.ArgumentParser() + parser.add_argument('--input', nargs='*', required=True) + parser.add_argument('--output', required=True) + + return parser.parse_args() + + +def main(): + args = parse_args() + + for asrc in filter(lambda x: x.endswith('.asrc') and os.path.exists(x), args.input): + with tarfile.open(asrc, 'r') as tar: + tar.extractall(path=args.output) + + +if __name__ == '__main__': + main() |