From 65be98f6b8ed0ff27bccee25026b040d3443feaf Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Wed, 4 Dec 2019 10:12:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E7=82=B9=E5=B0=8F=E5=BB=B6=E8=BF=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api.py | 2 +- liveDownloader.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/api.py b/api.py index c6b4afe..bfcf416 100644 --- a/api.py +++ b/api.py @@ -236,7 +236,7 @@ class XiGuaLiveApi: 更新房间信息 :return: """ - if not force and self._updRoomAt > (datetime.now() - timedelta(minutes=2)): + if not force and self._updRoomAt > (datetime.now() - timedelta(minutes=3)): return self.isLive self._updRoomAt = datetime.now() if self.isLive: diff --git a/liveDownloader.py b/liveDownloader.py index 8f75861..2e80f9e 100644 --- a/liveDownloader.py +++ b/liveDownloader.py @@ -8,7 +8,6 @@ import os import requests - def download(): session = requests.session() while Common.api.isLive and not Common.forceNotDownload: @@ -56,7 +55,7 @@ def encode(): def upload(): - date=datetime.strftime(datetime.now(), "%Y_%m_%d") + date = datetime.strftime(datetime.now(), "%Y_%m_%d") Common.appendUploadStatus("Upload Daemon Starting") i = Common.uploadQueue.get() while True: @@ -126,9 +125,9 @@ def run(): Common.api.updRoomInfo() except Exception as e: Common.appendError(e.__str__()) - time.sleep(5) + time.sleep(2) continue - time.sleep(1) + time.sleep(0.5) else: try: Common.api.updRoomInfo() @@ -145,4 +144,6 @@ def run(): Common.forceStartUploadThread = False if Common.doDelay(): Common.uploadQueue.put(True) + isEncode = True + isUpload = True time.sleep(5)