Emeg Update
This commit is contained in:
parent
10754d8ca0
commit
4572fd63ea
4
User.py
4
User.py
@ -14,15 +14,13 @@ class User:
|
||||
if "user" in json["Msg"]:
|
||||
self.ID = json["Msg"]['user']['user_id']
|
||||
self.name = json["Msg"]['user']['name']
|
||||
self.type = json["Msg"]['user']['user_type']
|
||||
if "discipulus_info" in json["Msg"]:
|
||||
self.level = json["Msg"]["discipulus_info"]["level"]
|
||||
self.brand = json["Msg"]["discipulus_info"]["discipulus_group_title"]
|
||||
elif "data" in json:
|
||||
if "anchorInfo" in json["data"]:
|
||||
self.ID = json["data"]['anchorInfo']['user_id']
|
||||
self.ID = json["data"]['anchorInfo']['id']
|
||||
self.name = json["data"]['anchorInfo']['name']
|
||||
self.type = 0
|
||||
if self.type is None:
|
||||
self.type = 0
|
||||
|
||||
|
13
api.py
13
api.py
@ -77,9 +77,13 @@ class XiGuaLiveApi:
|
||||
if not self.isValidRoom:
|
||||
return
|
||||
p = s.post("https://live.ixigua.com/api/room/enter/{roomID}".format(roomID=self.roomID))
|
||||
if DEBUG:
|
||||
print(p.text)
|
||||
|
||||
def updRoomInfo(self):
|
||||
p = s.get("https://live.ixigua.com/api/room/{room}".format(room=self.room))
|
||||
p = s.get("https://live.ixigua.com/api/room?anchorId={room}".format(room=self.room))
|
||||
if DEBUG:
|
||||
print(p.text)
|
||||
d = p.json()
|
||||
if "data" not in d:
|
||||
self.apiChangedError("无法获取RoomID,请与我联系")
|
||||
@ -87,10 +91,9 @@ class XiGuaLiveApi:
|
||||
self.isValidRoom = True
|
||||
self._rawRoomInfo = d["data"]
|
||||
self.roomLiver = User(d)
|
||||
self.roomTitle = self._rawRoomInfo["Title"]
|
||||
self.roomPopularity = self._rawRoomInfo["Extra2"]["Popularity"]
|
||||
if "Id" in d["data"]:
|
||||
self.roomID = d["data"]["Id"]
|
||||
self.roomTitle = self._rawRoomInfo["title"]
|
||||
if "id" in d["data"]:
|
||||
self.roomID = d["data"]["id"]
|
||||
else:
|
||||
self.apiChangedError("无法获取RoomID,请与我联系")
|
||||
if "FinishTime" in d["data"]:
|
||||
|
Reference in New Issue
Block a user