From 53fd5c3f6553f1e5287a682b79696053a6bd811e Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Fri, 10 Jan 2020 22:00:28 +0800 Subject: [PATCH] stop downloading with update room --- api.py | 2 +- liveDownloader.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/api.py b/api.py index c7229d2..fd122a1 100644 --- a/api.py +++ b/api.py @@ -203,7 +203,7 @@ class XiGuaLiveApi: if self.roomID == 0: self.isLive = False return False - if (self._updRoomAt + timedelta(minutes=2) > datetime.now()) and not force: + if (self._updRoomAt + timedelta(minutes=3) > datetime.now()) and not force: return self.isLive _formatData = {"COMMON": COMMON_GET_PARAM, "TIMESTAMP": time.time() * 1000, "roomId": self.roomID} _url = ROOM_INFO_API.format_map(_formatData).format_map(_formatData) diff --git a/liveDownloader.py b/liveDownloader.py index ade2a87..f0bed4b 100644 --- a/liveDownloader.py +++ b/liveDownloader.py @@ -36,6 +36,7 @@ def download(): Common.modifyLastDownloadStatus("Download >{}< Finished".format(path)) except Exception as e: Common.appendError("Download >{}< With Exception {}".format(path, e.__str__())) + Common.api.updRoomInfo(True) f.close() if os.path.getsize(path) < 1024 * 1024: Common.modifyLastDownloadStatus("Downloaded File >{}< is too small, will ignore it".format(path))