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