From 94d7b7131720c630bc44eb7c39d3c4cc57aef6bd Mon Sep 17 00:00:00 2001 From: Nichlas Severinsen Date: Thu, 1 Aug 2019 08:34:56 +0200 Subject: [PATCH] Make game_id.iso default output name --- CHANGELOG.md | 4 ++++ libray/iso.py | 8 +++++++- libray/libray.py | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a829944..8b58e39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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/). +## [Unreleased] +### Changed +- Default output iso name is game_id.iso instead of output.iso + ## [0.0.2] - 2019-07-07 ### Added/Fixed - Decrypting block devices directly (eg. cd/dvd/bd drive) instead of .iso files. For example `-i /dev/sg0` or `-i /dev/sr0`. diff --git a/libray/iso.py b/libray/iso.py index d899a63..c5e1562 100644 --- a/libray/iso.py +++ b/libray/iso.py @@ -90,7 +90,13 @@ class ISO: print('Decrypting with disc key: %s' % self.disc_key.hex()) 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 ) diff --git a/libray/libray.py b/libray/libray.py index 08d62d0..515b70b 100755 --- a/libray/libray.py +++ b/libray/libray.py @@ -34,7 +34,7 @@ if __name__ == '__main__': # Parse command line arguments with argpase 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('-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='') required = parser.add_argument_group('required arguments') required.add_argument('-i', '--iso', dest='iso', type=str, help='Path to .iso file', required=True)