diff --git a/Web/html/body/bilibili/upInfo.html b/Web/html/body/bilibili/upInfo.html index 0636a73..ed71574 100644 --- a/Web/html/body/bilibili/upInfo.html +++ b/Web/html/body/bilibili/upInfo.html @@ -8,7 +8,7 @@
-
+
在这里添加需要监控的UP主,添加请填入直播地址或房间号 @@ -263,7 +263,7 @@ udata.live = udata.live ? 1 : 0; udata.saveDanmu = udata.saveDanmu ? 1 : 0; console.log(udata) - $.post("/upinfo/update.do", udata, function (json) { + $.post("/upinfo/set/update.do", udata, function (json) { layer.close(dialogIndex); layer.msg(json.msg, function () { window.location.reload(); diff --git a/src/main/java/com/yutou/bilibili/BiliBili/Controllers/UpInfoController.java b/src/main/java/com/yutou/bilibili/BiliBili/Controllers/UpInfoController.java index d70c406..ba4c6a5 100644 --- a/src/main/java/com/yutou/bilibili/BiliBili/Controllers/UpInfoController.java +++ b/src/main/java/com/yutou/bilibili/BiliBili/Controllers/UpInfoController.java @@ -69,6 +69,11 @@ public class UpInfoController { return json; } + @ResponseBody + @RequestMapping("/upinfo/update.do") + public JSONObject updateV1(BilibiliUpInfo upData) { + return update(upData); + } @ResponseBody @RequestMapping("/upinfo/set/update.do") public JSONObject update(BilibiliUpInfo upData) { @@ -132,6 +137,9 @@ public class UpInfoController { JSONObject infoData = infoByUid.getJSONObject("data"); for (BilibiliUpInfo up : list) { JSONObject user = infoData.getJSONObject(up.getMid() + ""); + if(user==null){ + continue; + } up.setLive(user.getInteger("live_status")); if (up.checkLiveStatus() == 1) { online++; diff --git a/src/main/java/com/yutou/bilibili/BiliBili/Live.java b/src/main/java/com/yutou/bilibili/BiliBili/Live.java index 251a50e..bbd9f41 100644 --- a/src/main/java/com/yutou/bilibili/BiliBili/Live.java +++ b/src/main/java/com/yutou/bilibili/BiliBili/Live.java @@ -193,8 +193,12 @@ public class Live implements ApplicationContextAware { Log.i(roomId + " 断开连接,重连..."); try { init = true; - heartBeattimer.cancel(); - client.close(); + if(heartBeattimer!=null) { + heartBeattimer.cancel(); + } + if(client!=null) { + client.close(); + } start(); } catch (Exception e) { Log.e(e); diff --git a/src/main/java/com/yutou/bilibili/BiliBili/LiveUtils.java b/src/main/java/com/yutou/bilibili/BiliBili/LiveUtils.java index 48f0412..f055ccb 100644 --- a/src/main/java/com/yutou/bilibili/BiliBili/LiveUtils.java +++ b/src/main/java/com/yutou/bilibili/BiliBili/LiveUtils.java @@ -350,7 +350,7 @@ public class LiveUtils { } public static long getMid(int roomId) { - JSONObject http_get = http_get("http://api.live.bilibili.com/room/v1/Room/room_init?id=" + roomId); + JSONObject http_get = http_get("https://api.live.bilibili.com/room/v1/Room/room_init?id=" + roomId); if (http_get == null) { return -1; }