Update 'root/app/fanficdownload.py'

This commit is contained in:
sam 2023-06-06 20:16:36 +00:00
parent 419151cc51
commit cfc536dcd3

View File

@ -128,6 +128,8 @@ def downloader(args):
# loc = '/config/downloads'
if not exists('/config/downloads'):
makedirs('/config/downloads')
copyfile("/config/personal.ini", "{}/personal.ini".format(loc))
copyfile("/config/defaults.ini", "{}/defaults.ini".format(loc))
loc = '/config/downloads'
output = ""
output += log("Working with url {}".format(url), 'HEADER', live)
@ -154,8 +156,8 @@ def downloader(args):
output += log("\tStory is not in Calibre", 'WARNING', live)
cur = url
moving = 'cd "{}" && '.format(loc)
copyfile("/config/personal.ini", "{}/personal.ini".format(loc))
copyfile("/config/defaults.ini", "{}/defaults.ini".format(loc))
# copyfile("/config/personal.ini", "{}/personal.ini".format(loc))
# copyfile("/config/defaults.ini", "{}/defaults.ini".format(loc))
output += log('\tRunning: {}python3.9 -m fanficfare.cli -u "{}" --update-cover --non-interactive'.format(
moving, cur), 'BLUE', live)
res = check_output('{}python3.9 -m fanficfare.cli -u "{}" --update-cover --non-interactive --config={}/personal.ini'.format(
@ -228,13 +230,13 @@ def downloader(args):
live)
if not live:
print(output.strip())
rmtree(loc)
# rmtree(loc)
except Exception as e:
output += log("Exception: {}".format(e), 'FAIL', live)
if not live:
print(output.strip())
try:
rmtree(loc)
# rmtree(loc)
except BaseException:
pass
with open(inout_file, "a") as fp: