diff --git a/main.py b/main.py index de3448e..f6575e0 100644 --- a/main.py +++ b/main.py @@ -2,6 +2,7 @@ from flask_sqlalchemy import SQLAlchemy from flask import Flask, jsonify, render_template, request import json import os +import subprocess PATH = '/download' @@ -54,8 +55,12 @@ def download(): execute = """manga-py """ + each.url_metadata.base_url+each.manga.url + """ -n \"""" + each.manga.name.strip('?') + """\" -d \"""" + PATH + """\" -z -N --print-json""" book['title'] = each.manga.name book['command'] = execute + + # os.system(execute) + exec_command = subprocess.Popen(execute, stdout=subprocess.PIPE) + book['output'] = exec_command.stdout.read() updated.append(book) - os.system(execute) + missing = check(passin=1) return jsonify(manga=updated, missingFlags=missing[0], missingManga=missing[1])