diff --git a/api.py b/api.py index e9c5d7d..94d8309 100644 --- a/api.py +++ b/api.py @@ -254,6 +254,7 @@ class XiGuaLiveApi: print("搜索接口请求失败") return False self.broadcaster = None + self.isValidUser = False if "data" in d and d["data"] is not None: for i in d["data"]: if self.broadcaster is not None: @@ -276,6 +277,7 @@ class XiGuaLiveApi: :return: """ if self.broadcaster is None: + self.isValidUser = False return False _formatData = {"COMMON": COMMON_GET_PARAM, "TIMESTAMP": time.time() * 1000, "userId": self.broadcaster.ID} _url = USER_INFO_API.format_map(_formatData).format_map(_formatData) @@ -304,6 +306,7 @@ class XiGuaLiveApi: def _getRoomInfo(self, force=False): if self.roomID == 0: + self.isLive = False return False if not force or (self._updRoomAt + timedelta(minutes=2) > datetime.now()): return self.isLive