web_toolset/web/html/body/nas/animrss.html

572 lines
28 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>NAS</title>
<link rel="stylesheet" href="/layui/css/layui.css">
<link rel="stylesheet" href="/css/my.css">
</head>
<body>
<div class="layui-layout layui-layout-admin">
<div id="header"></div>
<div class="layui-body body2">
<div id="side"></div>
<blockquote class="layui-elem-quote"><span>番剧订阅器</span></blockquote>
<button type="button" id="addType" class="layui-btn layui-btn-normal">新增分类</button>
<div class="layui-tab" lay-filter="animType" lay-allowclose="true">
<ul class="layui-tab-title">
</ul>
<div class="layui-tab-content">
</div>
</div>
<blockquote class="layui-elem-quote"><span>动漫花园RSS</span></blockquote>
<form class="layui-form" action="" lay-filter="formTest">
<div class="layui-form-item">
<label class="layui-form-label"><a type="text" id="search"
class="layui-btn layui-btn-normal">搜索</a></label>
<div class="layui-input-block" style="padding-top: 8px; width: 200px;">
<input type="text" name="title" id="title" required lay-verify="required" placeholder="请输入标题"
autocomplete="off" class="layui-input" style="width: 200px;">
</div>
<div class="layui-form-item">
<label class="layui-form-label">类型</label>
<div class="layui-input-block" style="width: 200px;">
<select name="type" lay-verify="type" id="type">
<option value="0">全部</option>
<option value="2">動畫</option>
<option value="31">季度全集</option>
<option value="3">漫畫</option>
<option value="41">港台原版</option>
<option value="42">日文原版</option>
<option value="4">音樂</option>
<option value="43">動漫音樂</option>
<option value="44">同人音樂</option>
<option value="15">流行音樂</option>
<option value="6">日劇</option>
<option value="7"></option>
<option value="9">遊戲</option>
<option value="17">電腦遊戲</option>
<option value="18">電視遊戲</option>
<option value="19">掌機遊戲</option>
<option value="20">網絡遊戲</option>
<option value="21">遊戲周邊</option>
<option value="12">特攝</option>
<option value="1">其他</option>
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">字幕组</label>
<div class="layui-input-block" style="width: 200px;">
<select name="team" lay-verify="team" id='team'>
<option value="0">全部</option>
<option value="117">動漫花園</option>
<option value="669">喵萌奶茶屋</option>
<option value="648">魔星字幕团</option>
<option value="185">极影字幕社</option>
<option value="619">桜都字幕组</option>
<option value="604">c.c动漫</option>
<option value="241">幻樱字幕组</option>
<option value="151">悠哈C9字幕社</option>
<option value="657">LoliHouse</option>
<option value="283">千夏字幕组</option>
<option value="755">GMTeam</option>
<option value="390">天使动漫</option>
<option value="731">星空字幕组</option>
<option value="303">动漫国字幕组</option>
<option value="563">花園壓制組</option>
<option value="37">雪飄工作室(FLsnow)</option>
<option value="47">爱恋字幕社</option>
<option value="710">咪梦动漫组</option>
<option value="88">动音漫影</option>
<option value="574">梦蓝字幕组</option>
<option value="504">LoveEcho!</option>
<option value="765">爱咕字幕组</option>
<option value="520">豌豆字幕组</option>
<option value="650">SweetSub</option>
<option value="430">幻之字幕组</option>
<option value="407">DHR動研字幕組</option>
<option value="321">轻之国度</option>
<option value="581">VCB-Studio</option>
<option value="703">届恋字幕组</option>
<option value="576">银色子弹字幕组</option>
<option value="454">风车字幕组</option>
<option value="485">天空树双语字幕组</option>
<option value="134">漫游字幕组</option>
<option value="434">风之圣殿</option>
<option value="630">枫叶字幕组</option>
<option value="228">KRL字幕组</option>
<option value="526">东京不够热</option>
<option value="592">未央阁联盟</option>
<option value="288">诸神kamigami字幕组</option>
<option value="767">天月動漫&amp;發佈組</option>
<option value="768">千歲字幕組</option>
<option value="423">漫貓字幕組</option>
<option value="562">129.3字幕組</option>
<option value="447">夢幻戀櫻</option>
<option value="680">Little字幕组</option>
<option value="641">冷番补完字幕组</option>
<option value="31">卡通空間</option>
<option value="649">云光字幕组</option>
<option value="701">狐狸小宮</option>
<option value="459">紫音動漫&amp;發佈組</option>
<option value="699">小花花同盟戰線</option>
<option value="626">驯兽师联盟</option>
<option value="58">澄空学园</option>
<option value="769">动漫萌</option>
<option value="734">TD-RAWS</option>
<option value="225">鈴風字幕組</option>
<option value="673">VRAINSTORM</option>
<option value="741">銀月字幕組</option>
<option value="675">AikatsuFans</option>
<option value="759">红鸟窝字幕组</option>
<option value="764">MCE汉化组</option>
<option value="391">ZERO字幕组</option>
<option value="561">钉铛字幕组</option>
<option value="727">2B4B</option>
<option value="104">动漫先锋</option>
<option value="567">雪梦字幕组</option>
<option value="573">Centaurea-Raws</option>
<option value="652">SFEO-Raws</option>
<option value="666">中肯字幕組</option>
<option value="754">BYYM发布组</option>
<option value="613">AI-Raws</option>
<option value="706">K&amp;W-RAWS</option>
<option value="732">肥猫压制</option>
<option value="424">TSDM字幕組</option>
<option value="739">Clarita 压制组</option>
<option value="432">自由字幕组</option>
<option value="217">AQUA工作室</option>
<option value="753">柠檬水字幕组</option>
<option value="763">光之家族字幕组</option>
<option value="332">CureSub</option>
<option value="537">NEO·QSW</option>
<option value="632">歐克勒亞</option>
<option value="548">Cornflower Studio</option>
<option value="638">LittleBakas!</option>
</select>
</div>
</div>
</div>
</form>
<table id="rss" lay-filter="rssTools"></table>
<div id="footer"></div>
</div>
</div>
<script src="/layui/layui.js"></script>
<script src="/js/jquery-3.2.1.js"></script>
<script type="text/html" id="rssTopTools">
<a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="rss_src">原地址</a>
<a class="layui-btn layui-btn-xs" lay-event="addRss">订阅</a>
</script>
<script type="text/html" id="listTools">
<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">
<a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="mikan">MiKan</a>
<a class="layui-btn layui-btn-xs" lay-event="tmp_rss_show">查看</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="tmp_rss_del">删除</a>
</script>
<script type="text/html" id="animState">
{{# if(d.enable==1){}}
<div><input type="checkbox" name="state" lay-text="启用|关闭" lay-filter="stateCheckbox" lay-skin="switch"
value="{{d.id}}" checked></div>
{{# } else { }}
<div><input type="checkbox" name="state" lay-text="启用|关闭" lay-filter="stateCheckbox" lay-skin="switch"
value="{{d.id}}"></div>
{{# }}}
</script>
<script type="text/html" id="animUpdateState">
{{# if(d.updateDay=='今天更新'){}}
<div><input type="checkbox" name="update" lay-text="今天更新|不更新" lay-filter="stateCheckbox" lay-skin="switch"
value="{{d.id}}" checked disabled></div>
{{# } else { }}
<div><input type="checkbox" name="update" lay-text="{{d.updateDay}}|{{d.updateDay}}" lay-filter="stateCheckbox" lay-skin="switch"
value="{{d.id}}" disabled></div>
{{# }}}
</script>
<script>
$('#header').load("/html/header.html");
$('#footer').load("/html/footer.html");
let tabid = -1;
$.get("/login/check.do", function (data) {
let json = JSON.parse(data);
if (json.code !== 0) {
window.location.href = "/"
}
})
function addTmpRss(def) {
let option = '';
for (let i = 0; i < 20; i++) {
if (i === 1) {
option += '<option selected>' + i + '</option>'
} else {
option += '<option>' + i + '</option>'
}
}
let html = '<form class="layui-form">标题:<div class="layui-form-item"><input type="text" id="anim_rss_title" required lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">URL:<textarea class="layui-textarea" id="rss_value""></textarea> 季度:<select lay-search lay-verify="required" id="rss_select">' + option + '</select> </div></form>'
layer.open({
type: 0,
area: ['500px', '600px'],
title: '请输入RSS地址',
content: html,
success: function () {
layui.use(['form'], function () {
layui.form.render('select');
})
},
cancel :function (index){
layer.close(index)
},
yes: function (index, elem) {
let url = $('#rss_value')[0].value
let title = $('#anim_rss_title')[0].value+ '/Season ' + $('#rss_select')[0].value
$.post("/anim/rss/add.do", {
title: url
, titleKey: title
, bid: -1
}, function (json) {
layer.msg(json.msg)
layer.close(index)
})
}
})
}
layui.use(['layer', 'form', 'element', 'table', 'util'], function () {
let layer = layui.layer
, util = layui.util
, form = layui.form
, table = layui.table
, element = layui.element;
util.fixbar({
bar1: '&#xe637;',
bgcolor: '#393D49',
css: {right: 100, bottom: 100},
click: function(type){
console.log(type);
if(type === 'bar1'){
showToDayAnim()
}
}
});
$.get("/anim/type/list.do", function (data) {
let json = JSON.parse(data);
if (json.code === 0) {
for (let index = 0; index < json.data.length; index++) {
let ret = json.data[index];
let content;
if(ret.id===-1){
content='<button type="button" class="layui-btn layui-btn-xs" onclick="addTmpRss(this)">添加临时订阅地址</button>'
}else{
content=''
}
element.tabAdd('animType', {
title: ret.title
, content: content+'<table id="passwordlist' + ret.id + '" lay-filter="adminTable"></table>'
, id: ret.id
})
}
element.on('tab(animType)', function (data) {
tabid = $(this).attr('lay-id')
let cols;
if(tabid==='-1'){
cols=[[
{field: 'title', title: '地址'}
,{field: "right", toolbar: '#RsslistTools'}
]]
}else{
cols=[[
{field: "id", title: "id", width: 60, sort: true, fixed: 'left'}
, {field: 'bgmid', title: 'bgmId', width: 80, edit: 'text'}
, {field: 'title', title: '标题', edit: 'text'}
, {field: 'categories', title: '类型', width: 80}
, {field: 'author', title: '字幕组', width: 100}
, {field: 'titlekey', title: '搜索关键词', width: 200, edit: 'text'}
, {field: 'enable', title: '状态', width: 80, templet: '#animState'}
, {field: 'update', title: '更新', width: 110, templet: '#animUpdateState'}
, {field: "right", toolbar: '#listTools'}
]]
}
table.render({
elem: "#passwordlist" + tabid
, url: '/anim/rss/list.do?type=' + tabid
, page: true
, cols: cols
});
})
table.on('edit(adminTable)', function (obj) {
let type = obj.field;
let value = obj.value;
let id = obj.data.id;
console.log("id = " + id + " type = " + type + " value = " + value)
let data = {}
if (type === 'title') {
data = {id: id, title: value}
} else if (type === 'bgmid') {
data = {id: id, bgmId: value}
} else {
data = {id: id, titleKey: value}
}
$.post('/anim/rss/edit.do', data, function (json) {
layer.msg(json.msg)
})
})
element.on('tabDelete(animType)', function (data) {
let name = $(data.elem.prevObject.prevObject[0]).text().replace("ဆ", "")
let id = $(data.elem.prevObject.prevObject[0]).attr('lay-id')
layer.open({
title: "警告"
, content: "确认删除 " + name
, btn: ['确认', '取消']
, yes: function (index) {
$.post('/anim/type/del.do', {id: id}, function (data) {
let json = JSON.parse(data);
layer.msg(json.msg);
})
layer.close(index)
}
, btn2: function (index) {
layer.close(index)
}
})
});
table.on('tool(adminTable)', function (obj) {
if (obj.event === 'show') {
$("#type").find("option:contains('" + obj.data.categories + "')").attr("selected", null);
$("#team").find("option:contains('" + obj.data.author + "')").attr("selected", null);
$("#type").find("option:contains('" + obj.data.categories + "')").attr("selected", true);
$("#team").find("option:contains('" + obj.data.author + "')").attr("selected", true);
$('#title').val(obj.data.titlekey);
form.render("select", 'team');
form.render("select", 'type');
searchClick();
} else if (obj.event === 'del') {
layer.open({
title: "警告!"
, content: "删除操作无法回滚,是否确认删除:" + obj.data.title
, btn: ['确认', '取消']
, yes: function (index) {
$.post('/anim/rss/del.do', {id: obj.data.id}, function (json) {
layer.msg(json.msg)
layer.close(index)
})
},
btn2: function (index) {
layer.close(index);
}
})
} else if (obj.event === 'src') {
window.open("https://share.dmhy.org/topics/list?keyword=" + encodeURI(obj.data.titlekey))
} else if (obj.event === 'bgm_src') {
window.open("https://bgm.tv/subject/" + obj.data.bgmid)
} else if (obj.event==='mikan'){
console.log(getParamToUrl('bangumiId',obj.data.title))
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: 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) {
let data = obj.data;
if (obj.event === 'addRss') {
let option = '';
for (let i = 0; i < 20; i++) {
if (i === 1) {
option += '<option selected>' + i + '</option>'
} else {
option += '<option>' + i + '</option>'
}
}
let html = '<form class="layui-form">名字:<div class="layui-form-item"><textarea class="layui-textarea" id="rss_value" onblur="setTitle(this)">' + data.title + '</textarea> 季度:<select lay-search lay-verify="required" id="rss_select">' + option + '</select> <a id="bgmUrl" href="javascript:;" target="_blank">bgmId:</a><input class="layui-input" id="bgmId"/></div></form>'
layer.open({
type: 0,
area: ['500px', '600px'],
title: '订阅这个RSS结果,并加入到第' + tabid + '个分类中',
content: html,
success: function () {
form.render('select');
},
yes: function (index, elem) {
let value = $('#rss_value')[0].value + '/Season ' + $('#rss_select')[0].value
let bgmId = $('#bgmId')[0].value
$.post("/anim/rss/add.do", {
title: value
, bgmId: bgmId
, author: data.author
, categories: data.categories[0]
, titleKey: $('#title').val()
, bid: tabid
}, function (json) {
layer.msg(json.msg)
layer.close(index)
})
}
})
} else if (obj.event === "rss_src") {
window.open(obj.data.link)
}
})
form.on('switch(stateCheckbox)', function (data) {
let flag = data.elem.checked ? 1 : 0;
let id = data.value;
$.post('/anim/rss/edit.do', {id: id, enable: flag}, function (json) {
layer.msg(json.msg)
})
})
element.tabChange('animType', '1');
}
});
let rssList = table.render({
elem: "#rss",
url: "/anim/rss/data.do?key=&type=" + form.val("formTest").type + "&team=" + form.val("formTest").team,
toolbar: true,
page: true,
cols: [[
{field: "title", title: "标题", sort: true, fixed: 'left'}
, {field: 'author', title: '字幕组', width: 100}
, {field: 'categories', title: '类型', width: 80, templet: '<div><label>{{d.categories[0]}}</label><div>'}
, {field: 'pubDate', title: '发布时间',}
, {field: 'thumbnail', title: '封面', templet: '<div><img src="{{d.thumbnail}}"/><div>'}
, {field: 'title', title: 'magnet', templet: '<div><label >{{d.enclosure.link}}</label ></div>'}
, {field: "right", toolbar: '#rssTopTools'}
]]
})
form.render()
$('#addType').click(function () {
layer.prompt({
title: '新增分类'
}, function (value, index, elem) {
$.post('/anim/type/add.do', {title: value}, function (data) {
window.location.reload()
})
layer.close(index)
})
})
$('#search').click(function () {
searchClick()
})
$('#searchBgmId').click(function () {
let url = "https://bgm.tv/subject_search/" + encodeURIComponent($('#title')[0].value) + "?cat=2"
window.open(url)
})
function searchClick() {
rssList.reload({
where: {
key: $('#title').val(),
type: form.val("formTest").type,
team: form.val("formTest").team
}
})
}
function showToDayAnim() {
$.get("/anim/getToDay.do", function (json) {
let items = json.items;
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
if (name === '') {
name = item.name;
}
let img='#'
if(item.images!=null){
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>'
})
html += "</table>"
layer.open({
title: '今日新番列表',
area: ['700px', '300px'],
content: html,
shade: 0,
offset: 'rb'
});
})
}
});
function setTitle(_this) {
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>
<style>
#icon {
float: right;
}
#rss + .layui-table-view tbody > tr > td > .layui-table-cell {
height: 100px;
line-height: 100px;
}
</style>
</html>