diff options
author | jaseg <git@jaseg.net> | 2019-06-26 17:32:10 +0900 |
---|---|---|
committer | jaseg <git@jaseg.net> | 2019-06-26 17:32:10 +0900 |
commit | c75e2e7140e5547778106b4801648e543f037faf (patch) | |
tree | 6d054955bdaa0bfce569046d14766b2cbed2f538 | |
parent | bf86e740bd1f025af3158ffdaaa05c25d7a2a37a (diff) | |
download | secure-download-c75e2e7140e5547778106b4801648e543f037faf.tar.gz secure-download-c75e2e7140e5547778106b4801648e543f037faf.tar.bz2 secure-download-c75e2e7140e5547778106b4801648e543f037faf.zip |
encrypt: Add download filename option
-rw-r--r-- | encrypt.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -14,6 +14,7 @@ if __name__ == '__main__': parser.add_argument('infile') parser.add_argument('-c', '--config', default=None, help='Config file location (default; $XDG_CONFIG_HOME/filecrypt.conf)') parser.add_argument('-b', '--base-url', default=None, help='Base URL for link (also as config option)') + parser.add_argument('-f', '--filename', default=None, help='Download filename (default: Same as input filename)') parser.add_argument('-q', '--no-progress', action='store_true', help='Hide progress bar') parser.add_argument('-p', '--progress', action='store_true', help='Show progress bar (default, also as config option)') args = parser.parse_args() @@ -35,7 +36,7 @@ if __name__ == '__main__': print(f'{infile} is not a file or directory, exiting.') os.exit(2) - download_filename = os.path.basename(args.infile) + download_filename = args.filename or os.path.basename(args.infile) file_id, token, encrypt = generate_keys(download_filename) print(f'{base_url}/{file_id}/{token}/{download_filename}') |