add:新增手动下载动画选项(吸附于已注册动画)
This commit is contained in:
parent
760720a96c
commit
62831348e4
@ -5,8 +5,10 @@ import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.yutou.tools.mybatis.model.BangumiItem;
|
||||
import com.yutou.tools.mybatis.model.BangumiList;
|
||||
import com.yutou.tools.nas.UpdateIp;
|
||||
import com.yutou.tools.services.interfaces.BangumiService;
|
||||
import com.yutou.tools.utils.BangumiTools;
|
||||
import com.yutou.tools.utils.HttpTools;
|
||||
import com.yutou.tools.utils.RedisTools;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.util.StringUtils;
|
||||
@ -15,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@ -130,7 +133,7 @@ public class AnimationController {
|
||||
public JSONObject delAnimation(String id) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("code", 0);
|
||||
if (id.startsWith("http")) {
|
||||
if (id.startsWith("{")) {
|
||||
boolean tmpRss = RedisTools.list_remove("anim_tmp_rss", id);
|
||||
json.put("msg", tmpRss ? "删除成功" : "删除失败");
|
||||
return json;
|
||||
@ -196,4 +199,37 @@ public class AnimationController {
|
||||
public JSONObject getToDayAnim() {
|
||||
return BangumiTools.getBangumi(0);
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "/anim/setDownload.do", method = RequestMethod.POST)
|
||||
public JSONObject setDownload(int id, String url) {
|
||||
String serverUrl = "http://" + UpdateIp.nas_ip + ":8000/bt/download.do";
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("id", id);
|
||||
json.put("url", url);
|
||||
String post = HttpTools.post(serverUrl, HttpTools.toUrlParams(json).getBytes(StandardCharsets.UTF_8));
|
||||
json.clear();
|
||||
json.put("code", 0);
|
||||
json.put("msg", post);
|
||||
return json;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "/anim/rssdata.do", method = RequestMethod.POST)
|
||||
public JSONObject getRssData(int id) {
|
||||
JSONObject json = new JSONObject();
|
||||
BangumiItem item = bangumiService.getBangumiItem(id);
|
||||
if (item != null) {
|
||||
String key = item.getTitle().split("/")[0];
|
||||
AnimationData animationData = new AnimationData();
|
||||
JSONArray array = animationData.bangumiList(1, "0", "0", ","+key.replace(" ","+"));
|
||||
json.put("code",0);
|
||||
json.put("data", array);
|
||||
json.put("msg","ok");
|
||||
}else{
|
||||
json.put("code",-1);
|
||||
json.put("msg","id错误");
|
||||
}
|
||||
return json;
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ 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&order=date-desc";
|
||||
private String animUrl = "https://share.dmhy.org/topics/rss/page/%s/rss.xml?keyword=%s&sort_id=%s&order=date-desc";
|
||||
private String team="[{\"0\":\"全部\"},{\"117\":\"動漫花園\"},{\"669\":\"喵萌奶茶屋\"},{\"648\":\"魔星字幕团\"},{\"185\":\"极影字幕社\"},{\"619\":\"桜都字幕组\"},{\"604\":\"lleeopen\"},{\"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!\"}]";
|
||||
private String type="[{\"0\":\"全部\"},{\"2\":\"動畫\"},{\"31\":\"季度全集\"},{\"3\":\"漫畫\"},{\"41\":\"港台原版\"},{\"42\":\"日文原版\"},{\"4\":\"音樂\"},{\"43\":\"動漫音樂\"},{\"44\":\"同人音樂\"},{\"15\":\"流行音樂\"},{\"6\":\"日劇\"},{\"7\":\"RAW\"},{\"9\":\"遊戲\"},{\"17\":\"電腦遊戲\"},{\"18\":\"電視遊戲\"},{\"19\":\"掌機遊戲\"},{\"20\":\"網絡遊戲\"},{\"21\":\"遊戲周邊\"},{\"12\":\"特攝\"},{\"1\":\"其他\"}]";
|
||||
|
||||
|
@ -171,6 +171,7 @@
|
||||
<a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="src">原地址</a>
|
||||
<a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="bgm_src">番剧计划</a>
|
||||
<a class="layui-btn layui-btn-xs" lay-event="show">查看</a>
|
||||
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="down">手动下载</a>
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
|
||||
</script>
|
||||
<script type="text/html" id="RsslistTools">
|
||||
@ -384,10 +385,36 @@
|
||||
window.open('https://mikanani.me/Home/Bangumi/'+getParamToUrl('bangumiId',obj.data.title)+'#'+getParamToUrl('subgroupid',obj.data.title))
|
||||
} else if (obj.event==='tmp_rss_show'){
|
||||
window.open(obj.data.title)
|
||||
} else if (obj.event==='tmp_rss_del'){
|
||||
$.post('/anim/rss/del.do', {id: obj.data.title}, function (json) {
|
||||
} else if (obj.event === 'tmp_rss_del'){
|
||||
$.post('/anim/rss/del.do', {id: JSON.stringify(obj.data)}, function (json) {
|
||||
layer.msg(json.msg)
|
||||
})
|
||||
} else if(obj.event === 'down'){
|
||||
let index=layer.load()
|
||||
$.post('/anim/rssdata.do',{id:obj.data.id},function (json) {
|
||||
layer.close(index)
|
||||
if(json.code!==0){
|
||||
layer.msg(json.msg)
|
||||
return;
|
||||
}
|
||||
let html = '<table class="layui-table"> <colgroup> <col width="150" /> <col width="200" /> <col /> </colgroup> <thead> <tr> <th width="200">标题</th> <th>更新时间</th> <th>图片</th> <th>地址</th> </tr> </thead> <tbody> </tbody>'
|
||||
json.data.forEach((item) => {
|
||||
let name = item.title
|
||||
let img='#'
|
||||
if(item.thumbnail!=null){
|
||||
img=item.thumbnail
|
||||
}
|
||||
html += '<tr><td>' + name + '</td><td>' + item.pubDate + '</td><td><img src="' + img + '"></td><td><a href="javascript:sendDownload('+obj.data.id+',\''+item.enclosure.link+'\')">下载这个</a></td></tr>'
|
||||
})
|
||||
html += "</table>"
|
||||
layer.open({
|
||||
title: '手动下载',
|
||||
area: ['800px', '600px'],
|
||||
content: html,
|
||||
shade: 0
|
||||
});
|
||||
|
||||
})
|
||||
}
|
||||
})
|
||||
table.on('tool(rssTools)', function (obj) {
|
||||
@ -492,7 +519,6 @@
|
||||
function showToDayAnim() {
|
||||
$.get("/anim/getToDay.do", function (json) {
|
||||
let items = json.items;
|
||||
let _tab = []
|
||||
let html = '<table class="layui-table"> <colgroup> <col width="150" /> <col width="200" /> <col /> </colgroup> <thead> <tr> <th>标题</th> <th>首更时间</th> <th>图片</th> <th>地址</th> </tr> </thead> <tbody> </tbody>'
|
||||
items.forEach((item) => {
|
||||
let name = item.name_cn
|
||||
@ -504,7 +530,6 @@
|
||||
img=item.images.small
|
||||
}
|
||||
html += '<tr><td>' + name + '</td><td>' + item.air_date + '</td><td><img src="' + img + '"></td><td><a href="' + item.url + '" target="_blank">前往番剧计划</a></td></tr>'
|
||||
_tab.push({title: item.name, url: '<a href="' + item.url + '">前往番剧计划</a>'})
|
||||
})
|
||||
html += "</table>"
|
||||
layer.open({
|
||||
@ -524,6 +549,12 @@
|
||||
let url = "https://bgm.tv/subject_search/" + encodeURIComponent(_this.value) + "?cat=2"
|
||||
$('#bgmUrl')[0].href = url;
|
||||
}
|
||||
function sendDownload(id, url) {
|
||||
console.log("id = "+id +" url = "+url);
|
||||
$.post("/anim/setDownload.do",{id:id,url:url},function (json) {
|
||||
layer.msg(json.msg)
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
Loading…
Reference in New Issue
Block a user