From d124f90553376d0bb1c07763b254213fe3e13922 Mon Sep 17 00:00:00 2001
From: Yutousama <583819556@qq.com>
Date: Wed, 13 May 2020 17:39:29 +0800
Subject: [PATCH] update
---
pom.xml | 7 ++
.../yutou/tools/bangumi/AnimationData.java | 6 +-
.../java/com/yutou/tools/nas/SFTPManager.java | 4 +
.../java/com/yutou/tools/utils/SFTPTools.java | 87 +++++++++++++++++++
web/html/body/nas/animrss.html | 24 ++---
web/html/body/nas/bilidown.html | 23 ++---
web/html/body/nas/index.html | 11 +--
web/html/body/nas/sftp.html | 86 ++++++++++++++++++
web/html/body/nas/switchAdmin.html | 6 +-
web/html/body/tools/password.html | 7 +-
10 files changed, 225 insertions(+), 36 deletions(-)
create mode 100644 src/main/java/com/yutou/tools/nas/SFTPManager.java
create mode 100644 src/main/java/com/yutou/tools/utils/SFTPTools.java
create mode 100644 web/html/body/nas/sftp.html
diff --git a/pom.xml b/pom.xml
index 7c05d85..ecfab85 100644
--- a/pom.xml
+++ b/pom.xml
@@ -75,6 +75,13 @@
fastjson
1.2.67
+
+
+ com.jcraft
+ jsch
+ 0.1.55
+
+
diff --git a/src/main/java/com/yutou/tools/bangumi/AnimationData.java b/src/main/java/com/yutou/tools/bangumi/AnimationData.java
index fae69f6..71c72df 100644
--- a/src/main/java/com/yutou/tools/bangumi/AnimationData.java
+++ b/src/main/java/com/yutou/tools/bangumi/AnimationData.java
@@ -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");
diff --git a/src/main/java/com/yutou/tools/nas/SFTPManager.java b/src/main/java/com/yutou/tools/nas/SFTPManager.java
new file mode 100644
index 0000000..03c3011
--- /dev/null
+++ b/src/main/java/com/yutou/tools/nas/SFTPManager.java
@@ -0,0 +1,4 @@
+package com.yutou.tools.nas;
+
+public class SFTPManager {
+}
diff --git a/src/main/java/com/yutou/tools/utils/SFTPTools.java b/src/main/java/com/yutou/tools/utils/SFTPTools.java
new file mode 100644
index 0000000..46052b4
--- /dev/null
+++ b/src/main/java/com/yutou/tools/utils/SFTPTools.java
@@ -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();
+ }
+
+ }
+}
diff --git a/web/html/body/nas/animrss.html b/web/html/body/nas/animrss.html
index 171c054..fc812a8 100644
--- a/web/html/body/nas/animrss.html
+++ b/web/html/body/nas/animrss.html
@@ -172,6 +172,9 @@