B站下载页面新增添加url功能
This commit is contained in:
parent
6627f00d3e
commit
0f0906a02f
@ -48,16 +48,31 @@ public class UpdateIp {
|
|||||||
StringBuilder stringBuffer = new StringBuilder();
|
StringBuilder stringBuffer = new StringBuilder();
|
||||||
String line = null;
|
String line = null;
|
||||||
boolean isIp = false;
|
boolean isIp = false;
|
||||||
|
boolean isNas=false;
|
||||||
while ((line = reader.readLine()) != null) {
|
while ((line = reader.readLine()) != null) {
|
||||||
//System.out.println(line.trim().replace("server_name","").replace("upstream","").trim());
|
//System.out.println(line.trim().replace("server_name","").replace("upstream","").trim());
|
||||||
if (keys.contains(line.trim().replace("server_name", "").replace("upstream", "").replace("{", "").trim())) {
|
if (keys.contains(line.trim().replace("server_name", "").replace("upstream", "").replace("{", "").trim())) {
|
||||||
isIp = true;
|
isIp = true;
|
||||||
}
|
}
|
||||||
|
if(line.trim().replace("server_name", "").trim().equals("nas.yutou233.cn;")){
|
||||||
|
isNas=true;
|
||||||
|
}
|
||||||
if (isIp) {
|
if (isIp) {
|
||||||
String testIp = testIp(line);
|
String testIp = testIp(line);
|
||||||
if (testIp != null) {
|
if (testIp != null) {
|
||||||
System.out.println("检测到目标:" + line + " 修改IP " + testIp + " > " + ip);
|
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;
|
isIp = false;
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,8 @@
|
|||||||
<div class="layui-body" style="left: 200px;">
|
<div class="layui-body" style="left: 200px;">
|
||||||
<div id="side"></div>
|
<div id="side"></div>
|
||||||
<blockquote class="layui-elem-quote"><span id="ip">B站直播下载器</span></blockquote>
|
<blockquote class="layui-elem-quote"><span id="ip">B站直播下载器</span></blockquote>
|
||||||
<table id="address" lay-filter="listTools"></table>
|
<button type="button" id='add' class="layui-btn layui-btn-normal" style="margin-left: 10px;">新增</button>
|
||||||
|
<table id="address" lay-filter="listTools" ></table>
|
||||||
<div id="footer"></div>
|
<div id="footer"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -107,6 +108,19 @@
|
|||||||
$('#header').load("/html/header.html");
|
$('#header').load("/html/header.html");
|
||||||
$('#footer').load("/html/footer.html");
|
$('#footer').load("/html/footer.html");
|
||||||
$('#side').load("/html/body/nas/side.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)
|
||||||
|
});
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user