This commit is contained in:
Yutousama 2020-05-13 17:39:29 +08:00
parent 61b1636c54
commit d124f90553
10 changed files with 225 additions and 36 deletions

View File

@ -75,6 +75,13 @@
<artifactId>fastjson</artifactId>
<version>1.2.67</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.jcraft/jsch -->
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.55</version>
</dependency>
</dependencies>

View File

@ -7,6 +7,8 @@ import com.yutou.tools.utils.Tools;
import java.net.URLEncoder;
public class AnimationData {
private String rss2jsonApi_1="wtfm5pebya13pnl8rtu51wfgfpte0mb9sap1foll";
private String rss2jsonApi_2="z2s7zyzxvrsjz9vh5alvq3lxdypzykly2nnvqpdx";
private String rss2jsonUrl = "https://api.rss2json.com/v1/api.json?rss_url=";
private String animUrl = "http://share.dmhy.org/topics/rss/page/%s/rss.xml?keyword=%s&sort_id=%s&team_id=%s&order=date-desc";
private String team="[{\"0\":\"全部\"},{\"117\":\"動漫花園\"},{\"669\":\"喵萌奶茶屋\"},{\"648\":\"魔星字幕团\"},{\"185\":\"极影字幕社\"},{\"619\":\"桜都字幕组\"},{\"604\":\"c.c动漫\"},{\"241\":\"幻樱字幕组\"},{\"151\":\"悠哈C9字幕社\"},{\"657\":\"LoliHouse\"},{\"283\":\"千夏字幕组\"},{\"755\":\"GMTeam\"},{\"390\":\"天使动漫\"},{\"731\":\"星空字幕组\"},{\"303\":\"动漫国字幕组\"},{\"563\":\"花園壓制組\"},{\"37\":\"雪飄工作室(FLsnow)\"},{\"47\":\"爱恋字幕社\"},{\"710\":\"咪梦动漫组\"},{\"88\":\"动音漫影\"},{\"574\":\"梦蓝字幕组\"},{\"504\":\"LoveEcho!\"},{\"765\":\"爱咕字幕组\"},{\"520\":\"豌豆字幕组\"},{\"650\":\"SweetSub\"},{\"430\":\"幻之字幕组\"},{\"407\":\"DHR動研字幕組\"},{\"321\":\"轻之国度\"},{\"581\":\"VCB-Studio\"},{\"703\":\"届恋字幕组\"},{\"576\":\"银色子弹字幕组\"},{\"454\":\"风车字幕组\"},{\"485\":\"天空树双语字幕组\"},{\"134\":\"漫游字幕组\"},{\"434\":\"风之圣殿\"},{\"630\":\"枫叶字幕组\"},{\"228\":\"KRL字幕组\"},{\"526\":\"东京不够热\"},{\"592\":\"未央阁联盟\"},{\"288\":\"诸神kamigami字幕组\"},{\"767\":\"天月動漫&發佈組\"},{\"768\":\"千歲字幕組\"},{\"423\":\"漫貓字幕組\"},{\"562\":\"129.3字幕組\"},{\"447\":\"夢幻戀櫻\"},{\"680\":\"Little字幕组\"},{\"641\":\"冷番补完字幕组\"},{\"31\":\"卡通空間\"},{\"649\":\"云光字幕组\"},{\"701\":\"狐狸小宮\"},{\"459\":\"紫音動漫&發佈組\"},{\"699\":\"小花花同盟戰線\"},{\"626\":\"驯兽师联盟\"},{\"58\":\"澄空学园\"},{\"769\":\"动漫萌\"},{\"734\":\"TD-RAWS\"},{\"225\":\"鈴風字幕組\"},{\"673\":\"VRAINSTORM\"},{\"741\":\"銀月字幕組\"},{\"675\":\"AikatsuFans\"},{\"759\":\"红鸟窝字幕组\"},{\"764\":\"MCE汉化组\"},{\"391\":\"ZERO字幕组\"},{\"561\":\"钉铛字幕组\"},{\"727\":\"2B4B\"},{\"104\":\"动漫先锋\"},{\"567\":\"雪梦字幕组\"},{\"573\":\"Centaurea-Raws\"},{\"652\":\"SFEO-Raws\"},{\"666\":\"中肯字幕組\"},{\"754\":\"BYYM发布组\"},{\"613\":\"AI-Raws\"},{\"706\":\"K&W-RAWS\"},{\"732\":\"肥猫压制\"},{\"424\":\"TSDM字幕組\"},{\"739\":\"Clarita 压制组\"},{\"432\":\"自由字幕组\"},{\"217\":\"AQUA工作室\"},{\"753\":\"柠檬水字幕组\"},{\"763\":\"光之家族字幕组\"},{\"332\":\"CureSub\"},{\"537\":\"NEO·QSW\"},{\"632\":\"歐克勒亞\"},{\"548\":\"Cornflower Studio\"},{\"638\":\"LittleBakas!\"}]";
@ -21,8 +23,8 @@ public class AnimationData {
}
title = title.substring(1, title.length() - 1);
System.out.println(String.format(animUrl, "" + index, title,type,team));
System.out.println(rss2jsonUrl + URLEncoder.encode(String.format(animUrl, "" + index, title,type,team), "UTF-8") + "&api_key=wtfm5pebya13pnl8rtu51wfgfpte0mb9sap1foll&count=500");
String js=Tools.get(rss2jsonUrl+ URLEncoder.encode(String.format(animUrl,""+index,title,type,team),"UTF-8")+"&api_key=wtfm5pebya13pnl8rtu51wfgfpte0mb9sap1foll&count=500");
System.out.println(rss2jsonUrl + URLEncoder.encode(String.format(animUrl, "" + index, title,type,team), "UTF-8") +String.format( "&api_key=%s&count=500",rss2jsonApi_2));
String js=Tools.get(rss2jsonUrl+ URLEncoder.encode(String.format(animUrl,""+index,title,type,team),"UTF-8")+String.format( "&api_key=%s&count=500",rss2jsonApi_2));
JSONObject json=JSONObject.parseObject(js);
if(json.getString("status").equals("ok")){
return json.getJSONArray("items");

View File

@ -0,0 +1,4 @@
package com.yutou.tools.nas;
public class SFTPManager {
}

View File

@ -0,0 +1,87 @@
package com.yutou.tools.utils;
import com.jcraft.jsch.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ListIterator;
import java.util.Properties;
public class SFTPTools {
Session sshSession = null;
ChannelSftp sftp = null;
public SFTPTools() throws Exception {
JSch jsch = new JSch();
sshSession = jsch.getSession("yutou", "113.65.152.143", 23);
sshSession.setPassword("34864394");
Properties sshConfig = new Properties();
sshConfig.put("StrictHostKeyChecking", "no");
sshSession.setConfig(sshConfig);
sshSession.connect();
Channel channel = sshSession.openChannel("sftp");
channel.connect();
sftp = (ChannelSftp) channel;
}
/**
* 删除
*/
public void delete(String directory, String deleteFile) {
try {
sftp.cd(directory);
sftp.rm(deleteFile);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 上传
*/
public void upload(String directory, String uploadFile) {
try {
sftp.cd(directory);
File file = new File(uploadFile);
sftp.put(new FileInputStream(file), file.getName());
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 下载
*/
public void download(String directory, String downloadFile, String saveFile) {
try {
sftp.cd(directory);
File file = new File(saveFile);
sftp.get(downloadFile, new FileOutputStream(file));//可以用流
} catch (Exception e) {
e.printStackTrace();
}
}
//https://www.cnblogs.com/nlpvv/articles/11244553.html
public void getPath() {
try {
sftp.cd("/home");
ListIterator listIterator=sftp.ls("/media/yutou/4t/public/").listIterator();
while (listIterator.hasNext()){
ChannelSftp.LsEntry entry= (ChannelSftp.LsEntry) listIterator.next();
System.out.println(entry.getFilename()+" ="+entry.getAttrs().getSize());
}
sftp.disconnect();
} catch (SftpException e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
try {
SFTPTools tools=new SFTPTools();
tools.getPath();
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@ -172,6 +172,9 @@
</script>
<script>
$('#header').load("/html/header.html");
$('#footer').load("/html/footer.html");
$('#side').load("/html/body/nas/side.html");
let tabid = -1;
$.get("/login/check.do", function (data) {
let json = JSON.parse(data);
@ -239,7 +242,7 @@
, content: "确认删除 " + name
, btn: ['确认', '取消']
, yes: function (index) {
$.post('/tools/password/type/set/remove.do', { id: id }, function (data) {
$.post('/anim/type/del.do', { id: id }, function (data) {
let json = JSON.parse(data);
layer.msg(json.msg);
})
@ -251,13 +254,7 @@
})
});
table.on('rowDouble(listTools)', function (data) {
$.get('/tools/password/get/password.do?id=' + data.data.id, function (udata) {
let json = JSON.parse(udata);
data.data.password = json.data;
data.update(data.data)
})
})
table.on('tool(listTools)', function (obj) {
if (obj.event === 'edit') {
$("#type").find("option:contains('" + obj.data.categories + "')").attr("selected", null);
@ -276,6 +273,11 @@
, content: "删除操作无法回滚,是否确认删除:" + obj.data.title
, btn: ['确认', '取消']
, yes: function (index) {
$.post('/anim/rss/del.do', { id: obj.data.id }, function (data) {
let json = JSON.parse(data);
layer.msg(json.msg)
layer.close(index)
})
},
btn2: function (index) {
@ -324,16 +326,14 @@
where: {
key: $('#title').val(),
type: form.val("formTest").type,
team:form.val("formTest").team
team: form.val("formTest").team
}
})
}
});
$.ajax({ cache: false })
$('#header').load("/html/header.html");
$('#footer').load("/html/footer.html");
$('#side').load("/html/body/nas/side.html");
//let js="" ; $('#team option').each(function() { let value=$(this).val(); let text=$(this).text(); js+='{"'+value+'":"'+text+'"},'})
</script>
</body>

View File

@ -15,7 +15,7 @@
<div id="side"></div>
<blockquote class="layui-elem-quote"><span id="ip">B站直播下载器</span></blockquote>
<button type="button" id='add' class="layui-btn layui-btn-normal" style="margin-left: 10px;">新增</button>
<table id="address" lay-filter="listTools" ></table>
<table id="address" lay-filter="listTools"></table>
<div id="footer"></div>
</div>
@ -27,6 +27,9 @@
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<script>
$('#header').load("/html/header.html");
$('#footer').load("/html/footer.html");
$('#side').load("/html/body/nas/side.html");
$.get("/login/check.do", function (data) {
let json = JSON.parse(data);
if (json.code != 0) {
@ -105,15 +108,13 @@
})
});
$.ajax({ cache: false })
$('#header').load("/html/header.html");
$('#footer').load("/html/footer.html");
$('#side').load("/html/body/nas/side.html");
$('#add').click(function(){
$('#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);
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)
});

View File

@ -20,16 +20,16 @@
<script src="/layui/layui.js"></script>
<script src="/js/jquery-3.2.1.js"></script>
<script>
$('#header').load("/html/header.html");
$('#footer').load("/html/footer.html");
$('#side').load("/html/body/nas/side.html");
layui.use(['layer', 'form', 'element'], function () {
var layer = layui.layer
, form = layui.form;
});
$.ajax({ cache: false })
$('#header').load("/html/header.html");
$('#footer').load("/html/footer.html");
$('#side').load("/html/body/nas/side.html");
$.get("/login/check.do", function (data) {
let json = JSON.parse(data);
if (json.code != 0) {
@ -38,9 +38,10 @@
})
</script>
<style>
#icon {
#icon {
float: right;
}
.body {
bottom: 0;
}

View File

@ -0,0 +1,86 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>FTP</title>
<link rel="stylesheet" href="/layui/css/layui.css">
</head>
<body>
<div class="layui-layout layui-layout-admin">
<div id="header"></div>
<div class="layui-body" style="top: 100px; ">
<div id="side"></div>
<blockquote class="layui-elem-quote"><span id="ip">SFTP</span></blockquote>
<div id="sftp"></div>
<div id="footer"></div>
</div>
<script src="/layui/layui.js"></script>
<script src="/js/jquery-3.2.1.js"></script>
<script>
$('#header').load("/html/header.html");
$('#footer').load("/html/footer.html");
$('#side').load("/html/body/nas/side.html");
layui.use('tree', function () {
var tree = layui.tree;
//渲染
var inst1 = tree.render({
elem: '#sftp' //绑定元素
,edit: ['add', 'update', 'del'] //操作节点的图标
, data: [{
title: '江西' //一级菜单
, children: [{
title: '南昌' //二级菜单
, children: [{
title: '高新区' //三级菜单
//…… //以此类推,可无限层级
}]
}]
}, {
title: '陕西' //一级菜单
, children: [{
title: '西安' //二级菜单
}]
}]
,click:function(obj){
console.log(obj.data)
if(!obj.data.children){
obj.data={
"title":obj.data.title,
"children":[
{"title":'a'}
]
}
inst1.reload({
data:obj.data,
})
}
}
});
});
$.ajax({ cache: false })
</script>
</body>
<style>
#icon {
float: right;
}
#rss+.layui-table-view tbody>tr>td>.layui-table-cell {
height: 100px;
line-height: 100px;
}
</style>
</html>

View File

@ -47,6 +47,9 @@
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<script>
$('#header').load("/html/header.html");
$('#footer').load("/html/footer.html");
$('#side').load("/html/body/nas/side.html");
$.get("/login/check.do", function (data) {
let json = JSON.parse(data);
if (json.code != 0) {
@ -125,9 +128,6 @@
});
$.ajax({ cache: false })
$('#header').load("/html/header.html");
$('#footer').load("/html/footer.html");
$('#side').load("/html/body/nas/side.html");
$.get("/auth/nas/address/get.do", function (data) {
var json = JSON.parse(data);
if (json.code != 0) {

View File

@ -41,6 +41,9 @@
</script>
<script>
$('#header').load("/html/header.html");
$('#footer').load("/html/footer.html");
$('#side').load("/html/body/nas/side.html");
$.get("/login/check.do", function (data) {
let json = JSON.parse(data);
if (json.code != 0) {
@ -222,9 +225,7 @@
})
});
$.ajax({ cache: false })
$('#header').load("/html/header.html");
$('#footer').load("/html/footer.html");
$('#side').load("/html/body/nas/side.html");
</script>