From 8f40d7595c05c6307dedcbd8d2c295f08aaa981b Mon Sep 17 00:00:00 2001 From: benton Date: Wed, 21 Jul 2021 18:47:53 -0500 Subject: [PATCH] logging in works! --- knock | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/knock b/knock index 237a606..29886cd 100644 --- a/knock +++ b/knock @@ -2,6 +2,7 @@ import os, sys, argparse, subprocess from pathlib import Path +from getpass import getpass parser = argparse.ArgumentParser(prog='knock', description='Convert an ACSM file to a DRM-free EPUB file') parser.add_argument('acsm_file', metavar='file', type=str, help='the ACSM file to convert') @@ -18,7 +19,17 @@ if not args.acsm_file.exists(): raise Exception(f'{str(args.acsm_file)} does not exist.') if not args.adobe_dir.exists(): - raise Exception('This device is not registered') + print('This device is not registered with Adobe.') + email = input("Enter your Adobe account's email address: ") + password = getpass("Enter your Adobe account's password: ") + print('Registering this device with Adobe...') + + subprocess.check_output([ + 'activate', + '-u', email, + '-p', password, + '-O', str(args.adobe_dir) + ]) print('Downloading the ACSM file from Adobe...')