add:新增临时rss下载功能

This commit is contained in:
2022-07-16 18:50:36 +08:00
parent e8fe762c53
commit 238efb7a40
7 changed files with 179 additions and 120 deletions

View File

@@ -0,0 +1,35 @@
package com.yutou.nas.utils;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.yutou.nas.Controllers.UpdateIp;
public class AnimRssManager {
public static void scan() {
String tmp=HttpTools.https_get("https://tools.yutou233.cn/anim/rss/list.do?type=-1&token=zIrsh9TUZP2lfRW753PannG49E7VJvor",null);
System.out.println("tmp = " + tmp);
if(tmp==null){
return;
}
JSONObject json= JSON.parseObject(tmp);
if(json.getInteger("code")==0){
JSONArray data=json.getJSONArray("data");
for (Object datum : data) {
String url= ((JSONObject) datum).getString("title");
download(url);
}
}
}
private static void download(String url) {
JSONObject rss=RssXMLtoJson.toJSON(url);
if (rss != null && "ok".equals(rss.getString("status"))) {
BTDownloadManager.download(rss.getJSONObject("feed").getString("title"), rss);
}
}
public static void main(String[] args) {
scan();
}
}