Fix configs

This commit is contained in:
MrTyton 2022-03-25 22:48:11 -04:00
parent 21f34726de
commit 5536dce8f8
4 changed files with 37 additions and 5 deletions

View File

@ -1 +1 @@
2022.03.25-24
2022.03.25-25

View File

@ -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)
@ -347,6 +347,20 @@ if __name__ == "__main__":
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:
@ -369,6 +383,20 @@ if __name__ == "__main__":
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(
options.server, config.get(
@ -413,4 +441,6 @@ if __name__ == "__main__":
options.mailbox,
options.input,
options.library,
options.libuser,
options.libpassword,
options.live)

View File

@ -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:

View File

@ -3,6 +3,8 @@ user=
password=
server=
mailbox=
libuser=
libpassword=
[locations]
library=