From 02562b63dc6d76540622338d0951a223335018a0 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Wed, 8 Jan 2020 09:06:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E5=AE=8C=E6=88=90=E5=90=8E?= =?UTF-8?q?=E4=B8=8D=E8=87=AA=E5=8A=A8=E6=9B=B4=E6=96=B0=EF=BC=88=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E5=A4=96=E9=9D=A2=E5=BE=AA=E7=8E=AF=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api.py | 2 +- liveDownloader.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/api.py b/api.py index fa6ba86..9c53202 100644 --- a/api.py +++ b/api.py @@ -195,7 +195,7 @@ class XiGuaLiveApi: self._rawRoomInfo = d["user_info"]['live_info'] if self.isLive: self.roomID = d["user_info"]['live_info']['room_id'] - return True + return self.isLive def _getRoomInfo(self, force=False): if self.roomID == 0: diff --git a/liveDownloader.py b/liveDownloader.py index 885a1a3..ade2a87 100644 --- a/liveDownloader.py +++ b/liveDownloader.py @@ -13,7 +13,7 @@ def download(): Common.appendError("Download with No StreamUrl Specific") break path = datetime.strftime(datetime.now(), "%Y%m%d_%H%M.flv") - p = session.get(Common.streamUrl, stream=True, timeout=10) + p = session.get(Common.streamUrl, stream=True, timeout=5) if p.status_code != 200: Common.appendDownloadStatus("Download with Response {}".format(p.status_code)) Common.api.updRoomInfo(True) @@ -42,7 +42,6 @@ def download(): os.remove(path) return False Common.encodeQueue.put(path) - Common.api.updRoomInfo() def encode():