5 Commits

2 changed files with 13 additions and 10 deletions

8
api.py
View File

@ -189,9 +189,10 @@ class XiGuaLiveApi:
self.onLike(User(i))
else:
pass
self.lottery = Lottery(i)
if self.lottery is None or self.lottery.ID == 0:
self.lottery = Lottery(i)
self._updRoomCount += 1
if self.lottery is not None or self.lottery.ID != 0:
if self.lottery is not None and self.lottery.ID != 0:
self.lottery.update()
if self.lottery.isFinished:
self.onLottery(self.lottery)
@ -203,8 +204,7 @@ class XiGuaLiveApi:
if __name__ == "__main__":
# name = "永恒de草薙"
name = "尤美"
name = "永恒de草薙"
if len(sys.argv) > 2:
if sys.argv[-1] == "d":
DEBUG = True

View File

@ -23,13 +23,16 @@ 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
if self.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","")
else:
self.playlist = self._rawRoomInfo["stream_url"]["alternate_pull_url"]
self.playlist = self.playlist.replace("_uhd","").replace("_sd","").replace("_ld","")
print("未开播,等待开播")
def onLike(self, user):
pass