From f81c2811ce55a78ff0e35347a7412e5551290105 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Fri, 1 Feb 2019 16:31:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=95=E6=92=AD=E5=8A=A9=E6=89=8B=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=EF=BC=9A=E9=81=BF=E5=85=8D=E5=9B=A0=E4=B8=BA=E6=9C=AA?= =?UTF-8?q?=E5=BC=80=E6=92=AD=E8=80=8C=E5=AF=BC=E8=87=B4=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- liveDownloader.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/liveDownloader.py b/liveDownloader.py index a5942cf..7e370b5 100644 --- a/liveDownloader.py +++ b/liveDownloader.py @@ -23,13 +23,14 @@ class downloader(XiGuaLiveApi): self.updPlayList() def updPlayList(self): - if "stream_url" not in self._rawRoomInfo: - if self.playlist is None: - self.apiChangedError("无法获取直播链接") - self.playlist = False - else: - self.playlist = self._rawRoomInfo["stream_url"]["alternate_pull_url"] - self.playlist = self.playlist.replace("_uhd","").replace("_sd","").replace("_ld","") + if api.isLive: + if "stream_url" not in self._rawRoomInfo: + if self.playlist is None: + self.apiChangedError("无法获取直播链接") + self.playlist = False + else: + self.playlist = self._rawRoomInfo["stream_url"]["alternate_pull_url"] + self.playlist = self.playlist.replace("_uhd","").replace("_sd","").replace("_ld","") def onLike(self, user): pass