From 1ca7226cfe174acba7d600a4b1432befe2dc291f Mon Sep 17 00:00:00 2001 From: JerryYan <792602257@qq.com> Date: Tue, 16 Apr 2019 21:28:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BB=E5=8A=A8=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Common.py | 1 - WebMain.py | 3 +-- liveDownloader.py | 4 +++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Common.py b/Common.py index 0384785..34afc1e 100644 --- a/Common.py +++ b/Common.py @@ -50,7 +50,6 @@ def doClean(): os.system(config["dow"]) - def getCurrentStatus(): _disk = psutil.disk_usage("/") _mem = psutil.virtual_memory() diff --git a/WebMain.py b/WebMain.py index 7675d51..b4336a0 100644 --- a/WebMain.py +++ b/WebMain.py @@ -203,11 +203,10 @@ def fileDownload(path): status=code, mimetype='application/octet-stream', headers={ - "Content-Length": os.path.getsize(path)-1-offset, + "Content-Length": os.path.getsize(path), "Content-Range": "bytes {}-{}/{}".format(offset,os.path.getsize(path)-1,os.path.getsize(path)), "Accept-Ranges": "bytes", "Range": "bytes", - "Content-Disposition": "attachment; filename={}".format(path), }) else: return Response(status=404) diff --git a/liveDownloader.py b/liveDownloader.py index b015e00..690c674 100644 --- a/liveDownloader.py +++ b/liveDownloader.py @@ -94,7 +94,9 @@ def upload(date=datetime.strftime(datetime.now(), "%Y_%m_%d")): except Exception as e: Common.appendError(e.__str__()) continue - os.remove(i) + if not Common.forceNotEncode: + os.remove(i) + Common.doClean() i = Common.uploadQueue.get() Common.appendUploadStatus("Upload Daemon Quiting")