private DouyuData getJson(string room) { string json = getHttp(room).GetAwaiter().GetResult(); DouyuDataTemp result = (DouyuDataTemp)JsonConvert.DeserializeObject(json, typeof(DouyuDataTemp)); if (result == null) { return(null); } return(result.data); }
private DouyuData getJson(string room) { try { string json = getHttp(room); if (json == null || json == "") { return(null); } if (!json.Contains("{")) { return(null); } DouyuDataTemp result = JsonConvert.DeserializeObject <DouyuDataTemp>(json); if (result == null) { return(null); } return(result.data); } catch (Exception) { return(null); } }