// ==UserScript== // @name Bangumi快捷播放 // @description 首页追番卡片显示中文标题,浮动卡片增加资源搜索,可添加对应集数播放源,浮动卡片状态实时改变无需刷新 // @namespace https://github.com/RiverYale/Userscripts/ // @homepage https://riveryale.github.io/Userscripts/ // @version 3.3 // @author RiverYale // @match *://bangumi.tv // @match *://bgm.tv // @match *://chii.in // @icon https://riveryale.github.io/Userscripts/assets/pic/BangumiEasyPlay/icon.png // @run-at document-end // @compatible chrome // @compatible edge // @license MIT License // @downloadURL https://update.greasyfork.icu/scripts/436275/Bangumi%E5%BF%AB%E6%8D%B7%E6%92%AD%E6%94%BE.user.js // @updateURL https://update.greasyfork.icu/scripts/436275/Bangumi%E5%BF%AB%E6%8D%B7%E6%92%AD%E6%94%BE.meta.js // ==/UserScript== /*================= 更新脚本前注意保存自己修改的内容! =================*/ var autoMark = true; // 默认点击链接后自动标记为看过 var authSrc = ""; // 若404则表明未更新资源,全部移除,若无需验证则删除引号中的内容 var src_dict = { // 网址格式,番剧ID: [资源ID, 播放线路, 总体集数偏移, [集数, 增加偏移]...] "AGE动漫": { pattern: "https://www.agemys.org/play/${id}/${ch}/${ep}", search: "https://www.agemys.org/search?query=${keyword}", 373247: [20220248, 1, 1], // 无职转生:到了异世界就拿出真本事 ~ 第二季 441233: [20230154, 1, 0], // 总之就是非常可爱 女子高中篇 376433: [20230138, 1, 0], // 政宗君的复仇R 403225: [20230131, 1, -12], // 打工吧!!魔王大人 2nd Season 376739: [20220244, 1, -87], // 进击的巨人 最终季 Part.3 414461: [20230128, 1, 0], // 僵尸百分百~变成僵尸之前想做的100件事~ 386809: [20230077, 1, 0], // 我推的孩子 }, "Bimi": { pattern: "http://m.dodoge.me/bangumi/${id}/play/${ch}/${ep}/", search: "http://m.dodoge.me/vod/search/wd/${keyword}", }, "MX动漫": { pattern: "http://www.mxdm9.com/dongmanplay/${id}-${ch}-${ep}.html", search: "http://www.mxdm9.com/search/-------------.html?wd=${keyword}", 373247: [8183, 1, 1], // 无职转生:到了异世界就拿出真本事 ~ 第二季 441233: [7112, 1, 12], // 总之就是非常可爱 女子高中篇 376433: [7622, 1, 0], // 政宗君的复仇R 403225: [8181, 1, -12], // 打工吧!!魔王大人 2nd Season 376739: [8049, 1, -87], // 进击的巨人 最终季 Part.3 414461: [8169, 1, 0], // 僵尸百分百~变成僵尸之前想做的100件事~ 386809: [7963, 1, 0], // 我推的孩子 }, "橘子动漫": { pattern: "https://www.mgnacg.com/bangumi/${id}-${ch}-${ep}/", search: "https://www.mgnacg.com/search/-------------/?wd=${keyword}", }, "樱花动漫": { pattern: "https://www.vdm8.com/play/${id}-${ch}-${ep}.html", search: "https://www.vdm8.com/search/${keyword}-------------.html", }, "宫下动漫": { pattern: "https://arlnigdm.com/vodplay/${id}-${ch}-${ep}.html", search: "https://arlnigdm.com/vodsearch/-------------.html?wd=${keyword}", }, "新番组": { pattern: "https://bangumi.online", search: "https://bangumi.online", }, }; /*================= 更新脚本前注意保存自己修改的内容! =================*/ if($(".loginPanel").length == 1) return; /* 标题中日文对调 */ var titles_A = Array.from($(".tinyHeader .textTip:not(.prgCheckIn)")) // 平铺模式 .concat(Array.from($(".l.textTip"))) // 列表模式右侧 if(titles_A.length == 0) return; var handleTitle_A = function(title) { var text = $(title).text(); var data_original_title = $(title).attr("data-original-title"); if(!data_original_title){ return true; } $(title).text(data_original_title); $(title).attr("data-original-title", text); } var titles_B = Array.from($(".subjectItem.title.textTip")) // 列表模式左侧 - 1, 2, 3 var handleTitle_B = function(title) { var text = $(title).find('span').text(); var data_original_title = $(title).attr("data-original-title"); if(!data_original_title){ return true; } $(title).find('span').text(data_original_title); $(title).attr('data-original-title', text); var preALink = $(title).prev().prev(); var preALink_title = $(preALink).attr('data-original-title'); $(preALink).attr('data-original-title', preALink_title.replace(text, data_original_title)); } /* 生成配置模板 */ var _ul = $('
${type}
`); } if(status != 1) { var watched = $(statusLink).clone(true); $(watched).attr({href: `/subject/ep/${epid}/status/watched?gh=${gh}`, id: `Watched_${epid}`}); $(watched).text("看过") $(epStatusTool).append(watched); var watchedTill = $(statusLink).clone(true); $(watchedTill).attr({href: `/subject/ep/${epid}/status/watched?gh=${gh}`, id: `WatchedTill_${epid}`}); $(watchedTill).text("看到") $(epStatusTool).append(watchedTill); } if(status != 2) { var queue = $(statusLink).clone(true); $(queue).attr({href: `/subject/ep/${epid}/status/queue?gh=${gh}`, id: `Queue_${epid}`}); $(queue).text("想看") $(epStatusTool).append(queue); } if(status != 3) { var drop = $(statusLink).clone(true); $(drop).attr({href: `/subject/ep/${epid}/status/drop?gh=${gh}`, id: `Drop_${epid}`}); $(drop).text("抛弃") $(epStatusTool).append(drop); } if(status != 0) { var remove = $(statusLink).clone(true); $(remove).attr({href: `/subject/ep/${epid}/status/remove?gh=${gh}`, id: `remove_${epid}`}); $(remove).text("撤消") $(epStatusTool).append(remove); } } /* 修改进度后实时修改面板状态 */ var prgList = Array.from($("#subject_prg_content").children()); var handleprgList = function(prg) { $(".epStatusTool a", prg).click((event) => { var type = event.currentTarget.innerText; if(type == '看到') { var offset = Number($(prg).attr("ep_offset")); var curI = $(prg).index(); while(curI >= 0 && offset >= 0) { if (offset == Number($(prgList[curI]).attr("ep_offset"))) { if ($(".epStatusTool p", prgList[curI]).text() != '抛弃') { updataEpStatusTool(prgList[curI], "看过"); } offset -= 1; } curI -= 1; } } else { updataEpStatusTool(prg, type); } // 更新显示的面板 var prg_new = $(prg).clone(true); $(prg_new).css("display", "block"); $("#cluetip-inner").empty(); $("#cluetip-inner").append(prg_new); return false; }) } /* 功能运行进度指示文本 */ class Task { constructor(func, ...args) { this.func = func; this.args = args; this.delayMillsec = 0; } delay(millsec) { if (millsec) this.delayMillsec = millsec; return this.delayMillsec; } execute() { return this.func(...this.args); } } var taskList = []; titles_A.forEach(title => { taskList.push(new Task(handleTitle_A, title)); }); titles_B.forEach(title => { taskList.push(new Task(handleTitle_B, title)); }); epLinkList.forEach(epLink => { taskList.push(new Task(handleEpLinkList, epLink)); }); prgList.forEach(prg => { taskList.push(new Task(handleprgList, prg)); }); var _progressUl = $('