From b3fb7dca43867b0f2d0906ca2277faa29c9302f9 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Sat, 4 Jan 2020 17:22:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=99=BB=E5=BD=95=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BC=98=E5=8C=96,=E5=BB=B6=E8=BF=9F=E6=8A=95?= =?UTF-8?q?=E7=A8=BF=E9=80=BB=E8=BE=91=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Common.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Common.py b/Common.py index ac77190..72bf40b 100644 --- a/Common.py +++ b/Common.py @@ -76,13 +76,10 @@ def resetDelay(): def doDelay(): - global delay, isBroadcasting - if isBroadcasting: - resetDelay() - else: - if (datetime.now() - delay).seconds < 120: - delay = datetime.fromtimestamp(0) - return True + global delay + if (datetime.now() - delay).seconds < 120: + delay = datetime.fromtimestamp(0) + return True return False @@ -299,7 +296,7 @@ def appendError(obj): def loginBilibili(force=False): if config["dlO"] is False or forceNotUpload is False: global loginTime - if not force and getTimeDelta(datetime.now(), loginTime) < 86400 * 10: + if getTimeDelta(datetime.now(), loginTime) < 86400 * 10 or not Force: return False res = b.login(config["b_u"], config["b_p"]) loginTime = datetime.now() @@ -321,6 +318,7 @@ class downloader(XiGuaLiveApi): broadcaster = self.broadcaster isBroadcasting = self.isLive if self.isLive: + resetDelay() self.updPlayList() else: self.playlist = False