DEMO CHECK
This commit is contained in:
parent
d327a230b2
commit
5c0ed5e13f
10
api.py
10
api.py
@ -351,7 +351,9 @@ class XiGuaLiveApi:
|
|||||||
print(i)
|
print(i)
|
||||||
if "common" not in i and "method" not in i["common"]:
|
if "common" not in i and "method" not in i["common"]:
|
||||||
continue
|
continue
|
||||||
if i["common"]['method'] == "VideoLivePresentEndTipMessage":
|
if i["common"]['method'] == "VideoLivePresentMessage":
|
||||||
|
self.onPresent(Gift(i))
|
||||||
|
elif i["common"]['method'] == "VideoLivePresentEndTipMessage":
|
||||||
self.onPresentEnd(Gift(i))
|
self.onPresentEnd(Gift(i))
|
||||||
# elif i["common"]['method'] == "VideoLiveRoomAdMessage":
|
# elif i["common"]['method'] == "VideoLiveRoomAdMessage":
|
||||||
# self.onAd(i)
|
# self.onAd(i)
|
||||||
@ -391,14 +393,14 @@ if __name__ == "__main__":
|
|||||||
DEBUG = True
|
DEBUG = True
|
||||||
name = sys.argv[1]
|
name = sys.argv[1]
|
||||||
print("西瓜直播弹幕助手 by JerryYan")
|
print("西瓜直播弹幕助手 by JerryYan")
|
||||||
print("用户名【", name, "】搜索中", end="\t")
|
print("搜索【", name, "】中", end="\t", flush=True)
|
||||||
api = XiGuaLiveApi(name)
|
api = XiGuaLiveApi(name)
|
||||||
if not api.isValidUser:
|
if not api.isValidUser:
|
||||||
input("用户不存在")
|
input("用户不存在")
|
||||||
sys.exit()
|
sys.exit()
|
||||||
print("OK")
|
print("OK")
|
||||||
print("直播用户:", api.broadcaster)
|
print("直播用户:", api.broadcaster)
|
||||||
print("更新房间信息,请稍后", end="\t")
|
print("更新房间信息,请稍后", end="\t", flush=True)
|
||||||
if api.updRoomInfo(True):
|
if api.updRoomInfo(True):
|
||||||
print("OK")
|
print("OK")
|
||||||
else:
|
else:
|
||||||
@ -417,4 +419,4 @@ if __name__ == "__main__":
|
|||||||
else:
|
else:
|
||||||
print("主播未开播,等待1分钟后重试")
|
print("主播未开播,等待1分钟后重试")
|
||||||
time.sleep(60)
|
time.sleep(60)
|
||||||
api.updRoomInfo()
|
api.updRoomInfo(True)
|
||||||
|
Reference in New Issue
Block a user