Make game_id.iso default output name

This commit is contained in:
Nichlas Severinsen 2019-08-01 08:34:56 +02:00
parent ad0c6da8cf
commit 94d7b71317
3 changed files with 12 additions and 2 deletions

View file

@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Changed
- Default output iso name is game_id.iso instead of output.iso
## [0.0.2] - 2019-07-07 ## [0.0.2] - 2019-07-07
### Added/Fixed ### Added/Fixed
- Decrypting block devices directly (eg. cd/dvd/bd drive) instead of .iso files. For example `-i /dev/sg0` or `-i /dev/sr0`. - Decrypting block devices directly (eg. cd/dvd/bd drive) instead of .iso files. For example `-i /dev/sg0` or `-i /dev/sr0`.

View file

@ -90,7 +90,13 @@ class ISO:
print('Decrypting with disc key: %s' % self.disc_key.hex()) print('Decrypting with disc key: %s' % self.disc_key.hex())
with open(args.iso, 'rb') as input_iso: with open(args.iso, 'rb') as input_iso:
with open(args.output, 'wb') as output_iso:
if not args.output:
output_name = '%s.iso' % self.game_id
else:
output_name = args.output
with open(output_name, 'wb') as output_iso:
pbar = tqdm(total= (self.size // 2048) - 4 ) pbar = tqdm(total= (self.size // 2048) - 4 )

View file

@ -34,7 +34,7 @@ if __name__ == '__main__':
# Parse command line arguments with argpase # Parse command line arguments with argpase
parser = argparse.ArgumentParser(description='A Libre (FLOSS) Python application for unencrypting, extracting, repackaging, and encrypting PS3 ISOs') parser = argparse.ArgumentParser(description='A Libre (FLOSS) Python application for unencrypting, extracting, repackaging, and encrypting PS3 ISOs')
parser.add_argument('-v', '--verbose', help='Increase verbosity', action='count') parser.add_argument('-v', '--verbose', help='Increase verbosity', action='count')
parser.add_argument('-o', '--output', dest='output', type=str, help='Output filename', default='output.iso') parser.add_argument('-o', '--output', dest='output', type=str, help='Output filename', default='')
parser.add_argument('-k', '--ird', dest='ird', type=str, help='Path to .ird file', default='') parser.add_argument('-k', '--ird', dest='ird', type=str, help='Path to .ird file', default='')
required = parser.add_argument_group('required arguments') required = parser.add_argument_group('required arguments')
required.add_argument('-i', '--iso', dest='iso', type=str, help='Path to .iso file', required=True) required.add_argument('-i', '--iso', dest='iso', type=str, help='Path to .iso file', required=True)