抽奖信息可从弹幕中提取,可实时检测抽奖避免刷屏

This commit is contained in:
2019-02-01 13:33:01 +08:00
parent 1b920fa55c
commit 4a59cbcf82
2 changed files with 17 additions and 12 deletions

12
api.py
View File

@ -189,20 +189,22 @@ class XiGuaLiveApi:
self.onLike(User(i))
else:
pass
self.lottery = Lottery(i)
self._updRoomCount += 1
if self.lottery is not None:
if self.lottery is not None or self.lottery.ID != 0:
self.lottery.update()
if self.lottery.isFinished:
self.onLottery(self.lottery)
self.lottery = None
if self._updRoomCount > 120 or len(d['data']) == 0:
if self.lottery.isFinished:
self.onLottery(self.lottery)
self.lottery = None
self.updRoomInfo()
self._updRoomCount = 0
return
if __name__ == "__main__":
name = "永恒de草薙"
# name = "永恒de草薙"
name = "尤美"
if len(sys.argv) > 2:
if sys.argv[-1] == "d":
DEBUG = True