From 23a8bc0d420e1ea614e0d521d3c41f7ce6299cc8 Mon Sep 17 00:00:00 2001 From: Dan Dembinski Date: Fri, 20 Mar 2020 11:01:02 -0400 Subject: [PATCH] Adjusted subprocess calls --- main.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index f6575e0..292cf47 100644 --- a/main.py +++ b/main.py @@ -50,15 +50,18 @@ def download(): for each in result: book={} if 'http' in each.manga.name or 'https' in each.manga.url: - execute = """manga-py """ + each.manga.url + """ -n \"""" + each.manga.name + """\" -d \"""" + PATH + """\" -z -N --print-json""" + # execute = """manga-py """ + each.manga.url + """ -n \"""" + each.manga.name + """\" -d \"""" + PATH + """\" -z -N --print-json""" + exec_command = subprocess.Popen(['manga-py', each.manga.url, '-n', each.manga.name, '-d', PATH, '-z', '-N', '--print-json'], stdout=subprocess.PIPE) else: - execute = """manga-py """ + each.url_metadata.base_url+each.manga.url + """ -n \"""" + each.manga.name.strip('?') + """\" -d \"""" + PATH + """\" -z -N --print-json""" + print('nothing') + # execute = """manga-py """ + each.url_metadata.base_url+each.manga.url + """ -n \"""" + each.manga.name.strip('?') + """\" -d \"""" + PATH + """\" -z -N --print-json""" + exec_command = subprocess.Popen(['manga-py', each.url_metadata.base_url, each.manga.url, '-n', each.manga.name.strip('?'), '-d', PATH, '-z', '-N', '--print-json'], stdout=subprocess.PIPE) book['title'] = each.manga.name - book['command'] = execute + # book['command'] = 'nothing' # os.system(execute) - exec_command = subprocess.Popen(execute, stdout=subprocess.PIPE) - book['output'] = exec_command.stdout.read() + # exec_command = subprocess.Popen(execute, stdout=subprocess.PIPE) + book['output'] = exec_command.communicate() updated.append(book) missing = check(passin=1)