output of commands is visible

This commit is contained in:
benton 2021-07-27 12:18:14 -05:00
parent ea8790084d
commit d5c4c63ba8

12
knock
View file

@ -26,23 +26,23 @@ if not args.adobe_dir.exists():
password = getpass("Enter your Adobe account's password: ") password = getpass("Enter your Adobe account's password: ")
print('Registering this device with Adobe...') print('Registering this device with Adobe...')
subprocess.check_call([ subprocess.run([
'adept-register', 'adept-register',
'-u', email, '-u', email,
'-p', password, '-p', password,
'-O', str(args.adobe_dir) '-O', str(args.adobe_dir)
]) ], check=True)
print('Downloading the EPUB file from Adobe...') print('Downloading the EPUB file from Adobe...')
subprocess.check_call([ subprocess.run([
'adept-download', 'adept-download',
'-d', str(args.adobe_dir.joinpath('device.xml')), '-d', str(args.adobe_dir.joinpath('device.xml')),
'-a', str(args.adobe_dir.joinpath('activation.xml')), '-a', str(args.adobe_dir.joinpath('activation.xml')),
'-k', str(args.adobe_dir.joinpath('devicesalt')), '-k', str(args.adobe_dir.joinpath('devicesalt')),
'-o', str(args.drm_file), '-o', str(args.drm_file),
'-f', str(args.acsm_file) '-f', str(args.acsm_file)
]) ], check=True)
drm_file_type = magic.from_file(str(args.drm_file), mime=True) drm_file_type = magic.from_file(str(args.drm_file), mime=True)
if drm_file_type != 'application/epub+zip': if drm_file_type != 'application/epub+zip':
@ -50,12 +50,12 @@ if drm_file_type != 'application/epub+zip':
print('Decrypting the file...') print('Decrypting the file...')
subprocess.check_call([ subprocess.run([
'inept-epub', 'inept-epub',
str(args.adobe_dir.joinpath('activation.xml')), str(args.adobe_dir.joinpath('activation.xml')),
str(args.drm_file), str(args.drm_file),
str(args.epub_file) str(args.epub_file)
]) ], check=True)
args.drm_file.unlink() args.drm_file.unlink()