public static short getLiveStatus(int roomid) { string data = ThirdPartAPIs._get("https://api.live.bilibili.com/xlive/web-room/v1/index/getInfoByRoom?room_id=" + roomid); JObject json = (JObject)JsonConvert.DeserializeObject(data); return(json["data"]["room_info"].Value <short>("live_status")); }
public BiliLiveRoom(int roomid, IAuthBase auth) { this.sess = new ThirdPartAPIs(auth.GetLoginCookies()); string data = ThirdPartAPIs._get("https://api.live.bilibili.com/xlive/web-room/v1/index/getInfoByRoom?room_id=" + roomid); JObject json = (JObject)JsonConvert.DeserializeObject(data); roomid = json["data"]["room_info"].Value <int>("room_id"); shortid = json["data"]["room_info"].Value <int>("short_id"); title = json["data"]["room_info"].Value <string>("title"); cover = json["data"]["room_info"].Value <string>("cover"); tags = json["data"]["room_info"].Value <string>("tags").Split(','); keyframe = json["data"]["room_info"].Value <string>("keyframe"); status = json["data"]["room_info"].Value <short>("live_status"); lid = json["data"]["room_info"].Value <int>("live_start_time"); this.roomid = roomid; manage = new LiveManagement(this); //keyframe }