wc
This commit is contained in:
parent
5fa4ee929e
commit
16c68e5ceb
17
WebMain.py
17
WebMain.py
@ -1,14 +1,21 @@
|
|||||||
from time import sleep
|
from time import sleep
|
||||||
|
from flask_cors import CORS
|
||||||
from flask import Flask, jsonify, request
|
from flask import Flask, jsonify, request, redirect, url_for
|
||||||
import Common
|
import Common
|
||||||
import threading
|
import threading
|
||||||
from liveDownloader import run as RUN
|
from liveDownloader import run as RUN
|
||||||
|
|
||||||
app = Flask("liveStatus")
|
app = Flask("liveStatus")
|
||||||
app.config['JSON_AS_ASCII'] = False
|
app.config['JSON_AS_ASCII'] = False
|
||||||
|
CORS(app, supports_credentials=True)
|
||||||
|
url_for('static', filename='index.html')
|
||||||
|
url_for('static', filename='index.js')
|
||||||
|
|
||||||
|
|
||||||
|
@app.route("/")
|
||||||
|
def index():
|
||||||
|
return redirect("/static/index.html")
|
||||||
|
|
||||||
@app.route("/config", methods=["GET"])
|
@app.route("/config", methods=["GET"])
|
||||||
def readConfig():
|
def readConfig():
|
||||||
config = Common.config.copy()
|
config = Common.config.copy()
|
||||||
@ -74,6 +81,7 @@ def getUploadStats():
|
|||||||
}})
|
}})
|
||||||
|
|
||||||
|
|
||||||
|
def SubThread():
|
||||||
t = threading.Thread(target=RUN, args=(Common.config['l_u'],))
|
t = threading.Thread(target=RUN, args=(Common.config['l_u'],))
|
||||||
t.setDaemon(True)
|
t.setDaemon(True)
|
||||||
t.start()
|
t.start()
|
||||||
@ -84,3 +92,8 @@ while True:
|
|||||||
t = threading.Thread(target=RUN, args=(Common.config['l_u'],))
|
t = threading.Thread(target=RUN, args=(Common.config['l_u'],))
|
||||||
t.setDaemon(True)
|
t.setDaemon(True)
|
||||||
t.start()
|
t.start()
|
||||||
|
|
||||||
|
|
||||||
|
p = threading.Thread(target = SubThread)
|
||||||
|
p.setDaemon(True)
|
||||||
|
p.start()
|
||||||
|
@ -188,7 +188,7 @@ class Bilibili:
|
|||||||
"""
|
"""
|
||||||
self.preUpload(parts)
|
self.preUpload(parts)
|
||||||
self.finishUpload(title, tid, tag, desc, source, cover, no_reprint)
|
self.finishUpload(title, tid, tag, desc, source, cover, no_reprint)
|
||||||
self.clean()
|
self.clear()
|
||||||
|
|
||||||
def preUpload(self, parts):
|
def preUpload(self, parts):
|
||||||
"""
|
"""
|
||||||
|
Reference in New Issue
Block a user