diff --git a/src/main/java/com/yutou/tools/nas/UpdateIp.java b/src/main/java/com/yutou/tools/nas/UpdateIp.java index 246208b..ce1b9cd 100644 --- a/src/main/java/com/yutou/tools/nas/UpdateIp.java +++ b/src/main/java/com/yutou/tools/nas/UpdateIp.java @@ -48,16 +48,31 @@ public class UpdateIp { StringBuilder stringBuffer = new StringBuilder(); String line = null; boolean isIp = false; + boolean isNas=false; while ((line = reader.readLine()) != null) { //System.out.println(line.trim().replace("server_name","").replace("upstream","").trim()); if (keys.contains(line.trim().replace("server_name", "").replace("upstream", "").replace("{", "").trim())) { isIp = true; } + if(line.trim().replace("server_name", "").trim().equals("nas.yutou233.cn;")){ + isNas=true; + } if (isIp) { String testIp = testIp(line); if (testIp != null) { System.out.println("检测到目标:" + line + " 修改IP " + testIp + " > " + ip); - line = line.replace(testIp, ip); + if(isNas){ + String adminAddress=redisTools.get("adminAddress"); + if(adminAddress!=null) { + JSONObject json=JSONObject.parseObject(adminAddress); + line = "proxy_pass http://" +ip+":"+json.getInteger("port")+"/;"; + }else{ + line = line.replace(testIp, ip); + } + isNas=false; + }else { + line = line.replace(testIp, ip); + } isIp = false; } diff --git a/web/html/body/nas/bilidown.html b/web/html/body/nas/bilidown.html index 9883d39..1323696 100644 --- a/web/html/body/nas/bilidown.html +++ b/web/html/body/nas/bilidown.html @@ -14,7 +14,8 @@
B站直播下载器
-
+ +
@@ -107,6 +108,19 @@ $('#header').load("/html/header.html"); $('#footer').load("/html/footer.html"); $('#side').load("/html/body/nas/side.html"); + $('#add').click(function(){ + layer.prompt({ + title:"填写url或cid" + },function(value,index){ + $.post("/bili/live/add/url.do",{url:value},function(data){ + let json=JSON.parse(data); + layer.msg(json.msg); + layer.close(index) + }); + + }) + + });