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)