From ce152f617e5e93624d93eb912d793739ca0e5777 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Fri, 3 Jan 2020 09:30:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Common.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Common.py b/Common.py index 4ff9260..d790023 100644 --- a/Common.py +++ b/Common.py @@ -79,8 +79,11 @@ def doDelay(): global delay, isBroadcasting if isBroadcasting: resetDelay() - return False - return (datetime.now() - delay).seconds < 120 + else: + if (datetime.now() - delay).seconds < 120: + delay = datetime.fromtimestamp(0) + return True + return False def updateNetwork(): @@ -167,8 +170,6 @@ if config["dlO"] is True: forceNotEncode = True forceStartEncodeThread = False forceStartUploadThread = False -isEncode = True -isUpload = True uploadQueue = queue.Queue() encodeQueue = queue.Queue() @@ -346,18 +347,15 @@ def refreshDownloader(): def uploadVideo(name): - global isUpload if not os.path.exists(name): Common.appendError("Upload File Not Exist {}".format(name)) return - isUpload = True loginBilibili() doClean() if forceNotUpload is False: b.preUpload(VideoPart(name, os.path.basename(name))) else: appendUploadStatus("设置了不上传,所以[{}]不会上传了".format(name)) - isUpload = False if not Common.forceNotEncode: os.remove(name) @@ -367,8 +365,6 @@ def publishVideo(date): b.finishUpload(config["t_t"].format(date), 17, config["tag"], config["des"], source=config["src"], no_reprint=0) b.clear() - global delay - delay = datetime.fromtimestamp(0) else: appendUploadStatus("设置了不上传,所以[{}]的录播不会投了".format(date)) @@ -391,4 +387,3 @@ def encodeVideo(name): return False Common.modifyLastEncodeStatus("Encode >{}< Finished".format(name)) uploadQueue.put(_new_name) -