diff --git a/release-versions/latest.txt b/release-versions/latest.txt index 69c32f0..993de2a 100644 --- a/release-versions/latest.txt +++ b/release-versions/latest.txt @@ -1 +1 @@ -2022.03.25-24 +2022.03.25-25 diff --git a/root/app/fanficdownload.py b/root/app/fanficdownload.py index bd9df46..bab4204 100644 --- a/root/app/fanficdownload.py +++ b/root/app/fanficdownload.py @@ -236,11 +236,11 @@ def downloader(args): fp.write("{}\n".format(url)) -def main(user, password, server, label, inout_file, path, live): +def main(user, password, server, label, inout_file, path, lib_user, lib_password, live): if path: - path = '--with-library "{}" --username calibre --password pornoboobies'.format( - path) + path = '--with-library "{}" --username {} --password {}'.format( + path, lib_user, lib_password) try: with open(devnull, 'w') as nullout: call(['calibredb'], stdout=nullout, stderr=nullout) @@ -346,7 +346,21 @@ if __name__ == "__main__": action='store_true', dest='live', help='Include this if you want all the output to be saved and posted live. Useful when multithreading.') + + option_parser.add_option( + '-q', + '--libuser', + action='store', + dest='libuser', + help='Calibre User. Required.') + option_parser.add_option( + '-w', + '--libpassword', + action='store', + dest='libpassword', + help='Calibre Password. Required.') + (options, args) = option_parser.parse_args() if options.config: @@ -368,6 +382,20 @@ if __name__ == "__main__": 'login', 'password').strip()) except BaseException: pass + + try: + options.libuser = updater( + options.libuser, config.get( + 'login', 'libuser').strip()) + except BaseException: + pass + + try: + options.libpassword = updater( + options.libpassword, config.get( + 'login', 'libpassword').strip()) + except BaseException: + pass try: options.server = updater( @@ -413,4 +441,6 @@ if __name__ == "__main__": options.mailbox, options.input, options.library, + options.libuser, + options.libpassword, options.live) diff --git a/root/app/runner_notify.py b/root/app/runner_notify.py index b7a9fed..64cf5eb 100644 --- a/root/app/runner_notify.py +++ b/root/app/runner_notify.py @@ -41,7 +41,7 @@ def touch(fname, times=None): def main(options): try: res = check_output( - "python3.9 fanficdownload.py -c config.ini", + f"python3.9 /app/fanficdownload.py -c {options.config}", shell=True, stderr=STDOUT) except Exception as e: diff --git a/root/config.default/config.ini b/root/config.default/config.ini index faacc91..85aefd7 100644 --- a/root/config.default/config.ini +++ b/root/config.default/config.ini @@ -3,6 +3,8 @@ user= password= server= mailbox= +libuser= +libpassword= [locations] library=