extract_asrc.py 502 B

1234567891011121314151617181920212223
  1. import argparse
  2. import os
  3. import tarfile
  4. def parse_args():
  5. parser = argparse.ArgumentParser()
  6. parser.add_argument('--input', nargs='*', required=True)
  7. parser.add_argument('--output', required=True)
  8. return parser.parse_args()
  9. def main():
  10. args = parse_args()
  11. for asrc in filter(lambda x: x.endswith('.asrc') and os.path.exists(x), args.input):
  12. with tarfile.open(asrc, 'r') as tar:
  13. tar.extractall(path=args.output)
  14. if __name__ == '__main__':
  15. main()