豆瓣资源随便下

聚合几百家资源网站,通过右侧边栏告诉你哪些网站能下载豆瓣网站上的电影/电视剧/纪录片/综艺/动画/音乐/图书等!

  1. // ==UserScript==
  2. // @name 豆瓣资源随便下
  3. // @description 聚合几百家资源网站,通过右侧边栏告诉你哪些网站能下载豆瓣网站上的电影/电视剧/纪录片/综艺/动画/音乐/图书等!
  4. // @author wpzy.cc
  5. // @namespace https://wpzy.cc
  6. // @contributor Rhilip
  7. // @connect *
  8. // @grant GM_xmlhttpRequest
  9. // @grant GM_setClipboard
  10. // @grant GM_addStyle
  11. // @grant GM_setValue
  12. // @grant GM_getValue
  13. // @grant GM_listValues
  14. // @grant GM_deleteValue
  15. // @grant GM_registerMenuCommand
  16. // @grant GM_getResourceText
  17. // @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js
  18. // @require https://gf.qytechs.cn/scripts/368137-encodeToGb2312/code/encodeToGb2312.js?version=601683
  19. // @include https://movie.douban.com/*
  20. // @include https://music.douban.com/*
  21. // @include https://book.douban.com/*
  22. // @resource top250_css https://img1.doubanio.com/f/movie/5986ab7176af54744e71209c6afb5e1d8d1191cf/dist/movie/charts/top250.css
  23. // @license Zlib/Libpng License
  24. // @version 1.3.1
  25. // @icon https://img3.doubanio.com/favicon.ico
  26. // @run-at document-end
  27. // @namespace doveboy_js
  28. // ==/UserScript==
  29.  
  30. /* global $, jQuery, encodeToGb2312 */
  31.  
  32. // This Userscirpt can't run under Greasemonkey 4.x platform
  33. if (typeof GM_xmlhttpRequest === "undefined") {
  34. alert("不支持Greasemonkey 4.x,请换用暴力猴或Tampermonkey");
  35. return;
  36. }
  37.  
  38. // 不属于豆瓣的页面
  39. if (!/douban.com/.test(location.host)) {
  40. function AutoSearch(host, zInputSelector, btnSelector, dict) {
  41. if (location.host === host) {
  42. let match = location.href.match(/#search_(.+)/); // 从url的hash部分获取搜索关键词
  43. if (match) {
  44. history.pushState("", document.title, window.location.pathname + window.location.search); // 清空hash
  45. window.addEventListener("load", function () { // 等待页面完全加载完成
  46. let zInput = $(zInputSelector);
  47. zInput.val(decodeURIComponent(match[1])); // 填入搜索值
  48. dict = $.extend({}, dict);
  49. if (dict.ang) { // 补加Event,防止Angular绑定失效。 From: https://stackoverflow.com/questions/34360739/automate-form-submission-on-an-angularjs-website-using-tampermonkey
  50. let changeEvent = document.createEvent("HTMLEvents");
  51. changeEvent.initEvent("change", true, true);
  52. zInput[0].dispatchEvent(changeEvent);
  53. }
  54. if (dict.notarget) { // 取消form的提交跳转
  55. $(btnSelector).parents("form").attr("target", "_self");
  56. }
  57. $(btnSelector).click(); // 模拟点击
  58. });
  59. }
  60. }
  61. }
  62.  
  63. AutoSearch("bangumi.moe", '#filter-tag-list div.torrent-title-search > md-input-group > input', '#filter-tag-list > div.torrent-search > div:nth-child(3) > button:nth-child(4)', { ang: true });
  64. AutoSearch("v.dsb.ink", '.search__input', '.icon-search', {});
  65. AutoSearch("www.x5v.net", '#searchText', '#btnSearch', {});
  66. AutoSearch("desitorrents.tv", 'input.search_string_input', 'input.search_string_input+img', {});
  67.  
  68. return; // 终止脚本运行,防止豆瓣的css以及js片段等污染页面
  69. }
  70.  
  71. // 阻止其他豆瓣同类脚本加载
  72. var seBwhA = document.createElement("a");
  73. seBwhA.id = "seBwhA";
  74. document.getElementsByTagName("html")[0].appendChild(seBwhA);
  75.  
  76. // 注入脚本相关的CSS,包括:隐藏、调整豆瓣原先的元素,脚本页面样式
  77. GM_addStyle(`
  78. .c-aside{margin-bottom:30px}.c-aside-body a{border-radius:6px;color:#37a;display:inline-block;letter-spacing:normal;margin:0 8px 8px 0;padding:0 8px;text-align:center;width:65px}.c-aside-body a:link,.c-aside-body a:visited{background-color:#f5f5f5;color:#37a}.c-aside-body a:active,.c-aside-body a:hover{background-color:#e8e8e8;color:#37a}.c-aside-body a.available{background-color:#5ccccc;color:#006363}.c-aside-body a.available:active,.c-aside-body a.available:hover{background-color:#3cc}.c-aside-body a.sites_r0{text-decoration:line-through}
  79. #c_dialog li{margin:10px}#c_dialog{text-align:center}
  80. #interest_sectl .rating_imdb{border-top:1px solid #eaeaea;border-bottom:1px solid #eaeaea;padding-bottom:0}#interest_sectl .rating_wrap{padding-top:15px}#interest_sectl .rating_more{border-bottom:1px solid #eaeaea;color:#9b9b9b;margin:0;padding:15px 0;position:relative}#interest_sectl .rating_more a{left:80px;position:absolute}#interest_sectl .rating_more .titleOverviewSprite{background:url(https://coding.net/u/Changhw/p/MyDoubanMovieHelper/git/raw/master/title_overview_sprite.png) no-repeat;display:inline-block;vertical-align:middle}#interest_sectl .rating_more .popularityImageUp{background-position:-14px -478px;height:8px;width:8px}#interest_sectl .rating_more .popularityImageDown{background-position:-34px -478px;height:8px;width:8px}#interest_sectl .rating_more .popularityUpOrFlat{color:#83c40b}#interest_sectl .rating_more .popularityDown{color:#930e02}
  81. .more{display:block;height:34px;line-height:34px;text-align:center;font-size:14px;background:#f7f7f7}
  82. div#drdm_setting input[type=checkbox]{display:none}div#drdm_setting input[type=checkbox]+label{display:inline-block;width:40px;height:20px;position:relative;transition:.3s;margin:0 20px;box-sizing:border-box;background:#ddd;border-radius:20px;box-shadow:1px 1px 3px #aaa}div#drdm_setting input[type=checkbox]+label:after,div#drdm_setting input[type=checkbox]+label:before{content:'';display:block;position:absolute;left:0;top:0;width:20px;height:20px;transition:.3s;cursor:pointer}div#drdm_setting input[type=checkbox]+label:after{background:#fff;border-radius:50%;box-shadow:1px 1px 3px #aaa}div#drdm_setting input[type=checkbox]:checked+label{background:#aedcae}div#drdm_setting input[type=checkbox]:checked+label:after{background:#5cb85c;left:calc(100% - 20px)}
  83. .drdm-dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.drdm-dl-horizontal dd{margin-left:180px}
  84. `);
  85.  
  86.  
  87. if (GM_getValue('enable_extra_stylesheet', true)) {
  88. GM_addStyle('#dale_movie_chart_top_right,#dale_movie_home_bottom_right,#dale_movie_home_bottom_right_down,#dale_movie_home_download_bottom,#dale_movie_home_inner_bottom,#dale_movie_home_side_top,#dale_movie_home_top_right,#dale_movie_subject_bottom_super_banner,#dale_movie_subject_download_middle,#dale_movie_subject_inner_middle,#dale_movie_subject_middle_right,#dale_movie_subject_top_midle,#dale_movie_subject_top_right,#dale_movie_tags_top_right,#dale_movie_towhome_explore_right,#dale_review_best_top_right,#footer,#movie_home_left_bottom,.extra,.mobile-app-entrance.block5.app-movie,.qrcode-app,.top-nav-doubanapp,div.gray_ad,div.ticket{display:none}');
  89. }
  90.  
  91. // -- 定义基础方法 --
  92.  
  93. // 对使用GM_xmlhttpRequest返回的html文本进行处理并返回DOM树
  94. function page_parser(responseText) {
  95. // 替换一些信息防止图片和页面脚本的加载,同时可能加快页面解析速度
  96. // responseText = responseText.replace(/s+src=/ig, ' data-src='); // 图片,部分外源脚本
  97. // responseText = responseText.replace(/<script[^>]*?>[\S\s]*?<\/script>/ig, ''); //页面脚本
  98. return (new DOMParser()).parseFromString(responseText, 'text/html');
  99. }
  100.  
  101. function getDoc(url, meta, callback) {
  102. GM_xmlhttpRequest({
  103. method: 'GET',
  104. url: url,
  105. onload: function (responseDetail) {
  106. if (responseDetail.status === 200) {
  107. let doc = page_parser(responseDetail.responseText);
  108. callback(doc, responseDetail, meta);
  109. }
  110. }
  111. });
  112. }
  113.  
  114. function getJSON(url, callback) {
  115. GM_xmlhttpRequest({
  116. method: 'GET',
  117. url: url,
  118. headers: {
  119. 'Accept': 'application/json'
  120. },
  121. onload: function (response) {
  122. if (response.status >= 200 && response.status < 400) {
  123. callback(JSON.parse(response.responseText), url);
  124. } else {
  125. callback(false, url);
  126. }
  127. }
  128. });
  129. }
  130.  
  131. // 缓存相关方法
  132. function CacheStorage(name, expire = null) {
  133. let now = Date.now();
  134. let cache_name = "drdm_cache_" + (name ? name : 'default');
  135.  
  136. if (localStorage[cache_name + "_exp"]) {
  137. if (now > localStorage[cache_name + "_exp"]) {
  138. localStorage.removeItem(cache_name);
  139. }
  140. }
  141.  
  142. let cache = localStorage[cache_name] ? JSON.parse(localStorage[cache_name]) : {};
  143. localStorage.setItem(cache_name + "_exp", now + expire);
  144.  
  145. return {
  146. flush: function () {
  147. localStorage.setItem(cache_name, JSON.stringify(cache));
  148. },
  149.  
  150. add: function (name, value) {
  151. cache[name] = value;
  152. this.flush();
  153. },
  154.  
  155. del: function (name) {
  156. if (name) {
  157. delete cache[name];
  158. this.flush;
  159. } else {
  160. localStorage.removeItem(cache_name);
  161. }
  162. },
  163.  
  164. get: function (name, def = null) {
  165. if (name) {
  166. return cache[name] ? cache[name] : def;
  167. } else {
  168. return cache;
  169. }
  170. }
  171. }
  172. }
  173.  
  174. function clearExpiredCacheValue(force) {
  175. let StorageKey = [];
  176. for (let i = 0, len = localStorage.length; i < len; ++i) { // 先从里面取出所有的key
  177. StorageKey.push(localStorage.key(i));
  178. }
  179.  
  180. let CacheKey = StorageKey.filter(function (x) {
  181. return x && x.match(/(drdm_cache_.+)_exp/);
  182. }); // 再从中提取出本脚本缓存的键值
  183.  
  184. for (let i = 0, len = CacheKey.length; i < len; ++i) {
  185. let key_name = CacheKey[i];
  186. let exp_at = localStorage.getItem(key_name);
  187. if (force || exp_at < Date.now()) {
  188. localStorage.removeItem(key_name);
  189. localStorage.removeItem(key_name.slice(0, -4)); // 移除 _exp 后缀
  190. }
  191. }
  192. }
  193.  
  194. let _version = GM_getValue("version", "轻量版");
  195. let delete_site_prefix = "delete_site_";
  196.  
  197. if (typeof GM_registerMenuCommand !== "undefined") {
  198.  
  199. function changeVersionConfirm() {
  200. if (confirm(`你当前版本是 ${_version},是否进行切换?`)) {
  201. GM_setValue("version", _version === "完整版" ? "轻量版" : "完整版");
  202. }
  203. }
  204. GM_registerMenuCommand("脚本功能切换", changeVersionConfirm);
  205.  
  206. function changeTagBColor() {
  207. let now_bcolor_list = [GM_getValue("tag_bcolor_exist", "#e3f1ed"), GM_getValue("tag_bcolor_not_exist", "#f4eac2"), GM_getValue("tag_bcolor_need_login", ""), GM_getValue("tag_bcolor_error", "")];
  208. let name = prompt("请依次输入代表'点击进入','点击进入','站点需要登陆','站点解析错误'颜色的Hex值,并用英文逗号分割。当前值为:", `${now_bcolor_list.join(',')}`);
  209. if (name != null && name !== "") {
  210. try {
  211. let bcolor_list = name.split(",");
  212. GM_setValue("tag_bcolor_exist", bcolor_list[0] || "#e3f1ed");
  213. GM_setValue("tag_bcolor_not_exist", bcolor_list[1] || "#f4eac2");
  214. GM_setValue("tag_bcolor_need_login", bcolor_list[2] || "");
  215. GM_setValue("tag_bcolor_error", bcolor_list[3] || "");
  216. } catch (e) {
  217. alert("解析输入出错");
  218. }
  219. }
  220. }
  221. GM_registerMenuCommand("更改标签背景色", changeTagBColor);
  222.  
  223. function changeTagFColor() {
  224. let now_fcolor_list = [GM_getValue("tag_fcolor_exist", "#3377aa"), GM_getValue("tag_fcolor_not_exist", "#3377aa"), GM_getValue("tag_fcolor_need_login", "#3377aa"), GM_getValue("tag_fcolor_error", "#3377aa")];
  225. let name = prompt("请依次输入代表'点击进入','点击进入','站点需要登陆','站点解析错误'颜色的Hex值,并用英文逗号分割。当前值为:", `${now_fcolor_list.join(',')}`);
  226. if (name != null && name !== "") {
  227. try {
  228. let fcolor_list = name.split(",");
  229. GM_setValue("tag_fcolor_exist", fcolor_list[0] || "#3377aa");
  230. GM_setValue("tag_fcolor_not_exist", fcolor_list[1] || "#3377aa");
  231. GM_setValue("tag_fcolor_need_login", fcolor_list[2] || "#3377aa");
  232. GM_setValue("tag_fcolor_error", fcolor_list[3] || "#3377aa");
  233. } catch (e) {
  234. alert("解析输入出错");
  235. }
  236. }
  237. }
  238. GM_registerMenuCommand("更改标签文字色", changeTagFColor);
  239.  
  240. function forceCacheClear() {
  241. if (confirm("清空所有缓存信息(包括资源存在情况、登陆情况等)")) {
  242. clearExpiredCacheValue(true);
  243. }
  244. }
  245. GM_registerMenuCommand("清空脚本缓存", forceCacheClear);
  246. }
  247.  
  248.  
  249. let fetch_anchor = function (anchor) {
  250. return anchor[0].nextSibling.nodeValue.trim();
  251. };
  252.  
  253. function starBlock(source, source_link, _rating, _vote, max = 10) {
  254. let starValue = parseFloat(_rating) / 2;
  255. starValue = starValue % 1 > 0.5 ? Math.floor(starValue) + 0.5 : Math.floor(starValue);
  256. starValue *= (100 / max);
  257.  
  258. return `<div class=rating_logo >${source} 评分</div><div class="rating_self clearfix" typeof="v:Rating"><strong class="ll rating_num" property="v:average">${parseFloat(_rating).toFixed(1)}</strong><span property="v:best" content=10.0 ></span><div class="rating_right "><div class="ll bigstar ${'bigstar' + starValue}"></div><div class="rating_sum"> <a href=${source_link} class=rating_people target="_blank"><span property="v:votes">${_vote}</span>人${source === "MAL" ? "观看" : "评价"}</a> </div> </div> </div>`
  259. }
  260.  
  261. function parseLdJson(raw) {
  262. return JSON.parse(raw.replace(/\n/ig, ''));
  263. }
  264.  
  265.  
  266. $(document).ready(function () {
  267. let douban_link, douban_id;
  268.  
  269. douban_link = 'https://' + location.href.match(/douban.com\/subject\/\d+\//); //豆瓣链接
  270. douban_id = location.href.match(/(\d{7,8})/g);
  271.  
  272. let site_map = [];
  273.  
  274. /** label对象键值说明:
  275. * name: String 站点名称,请注意该站点名称在不同的site_map中也应该唯一,以免脚本后续判断出错
  276. * method: String 搜索请求方式,默认值为 "GET"
  277. * link: String 构造好的请求页面链接,作为label的href属性填入,用户应该能直接点开这个页面。
  278. * ajax: String 如果站点使用ajax的形式加载页面,则需要传入该值作为实际请求的链接,即优先级比link更高。
  279. * type: String 返回结果类型,脚本默认按html页面解析;只有当传入值为"json"时,脚本按JSON格式解析
  280. * selector: String 搜索成功判断结果,默认值为 "table.torrents:last > tbody > tr:gt(0)" (适用于国内多数NexusPHP构架的站点)
  281. * 如果type为"page"(默认)时,为一个(jQuery)CSS选择器,
  282. * 如果type为"json"或"jsonp"时,为一个具体的判断式。
  283. * selector_need_login 搜索需要登录(不可用)的选择器,仅在type为默认时有用,其余用法同Selector一致。
  284. * data: String 作为请求的主体发送的内容,默认为空即可
  285. * headers: Object 修改默认请求头,(防止某些站点有referrer等请求头检查
  286. * rewrite_href: Boolean 如果站点最终搜索显示的页面与实际使用搜索页面(特别是使用post进行交互的站点)不一致,
  287. * 设置为true能让脚本存储最终url,并改写label使用的href属性
  288. * csrf: Object 一个类似这样的字典 { name: "_csrf", update: "link"}
  289. * 其中key为站点csrf防护的名称,update为需要更新的字段(一般为link或data)
  290. *
  291. * 注意: 1. 如果某键有默认值,则传入值均会覆盖默认值
  292. * 2. 关于请求方法请参考:https://github.com/scriptish/scriptish/wiki/GM_xmlhttpRequest
  293. * */
  294. if (douban_id) {
  295. clearExpiredCacheValue(false); // 清理缓存
  296. let cache = CacheStorage(douban_id, 86400 * 7 * 1e3);
  297. let need_login_cache = CacheStorage("need_login", 86400 * 1e3);
  298.  
  299. $("#content div.aside").prepend(`<div id="drdm_req_status" style="color: #C65E24; padding: 10px; margin-bottom: 20px; word-wrap: break-word;display: none;">
  300. <div style="text-align: ">豆瓣资源随便下!<a href="javascript:void();" id="drdm_req_status_hide"></a> </div>
  301. <span id="drdm_req_help">
  302. </span>
  303. </div>
  304. <div id='drdm_sites'></div>`);
  305. $("#drdm_req_status_hide").click(function () { $("#drdm_req_status").hide(); });
  306. $("#drdm_hide_fail").click(function () {
  307. $("#drdm_sites a[title!=\"点击进入\"]").hide();
  308. $('#drdm_sites > div.c-aside.name-offline').each(function () { let that = $(this); if (that.find('> div > ul > a:visible').length == 0) { that.hide() } });
  309. });
  310. $("#drdm_show_all").click(function () { $("#drdm_sites a:hidden").show(); $('#drdm_sites > div.c-aside.name-offline').show(); });
  311.  
  312. let update_status_interval;
  313.  
  314. function update_req_status() {
  315. let asking_length = $("#drdm_sites a[title=\"正在请求信息中\"]").length;
  316.  
  317. $("#drdm_req_success").text($("#drdm_sites a[title=\"点击进入\"]").length);
  318. $("#drdm_req_asking").text(asking_length);
  319. $("#drdm_req_noexist").text($("#drdm_sites a[title=\"点击进入\"]").length);
  320. $("#drdm_req_fail").text($("#drdm_sites a[title=\"站点需要登陆\"]").length + $("#drdm_sites a[title=\"遇到问题\"]").length);
  321.  
  322. if (asking_length === 0) {
  323. clearInterval(update_status_interval); // 当所有请求完成后清除定时器
  324. if (GM_getValue('enalbe_adv_auto_tip_hide', false)) {
  325. $("#drdm_req_status_hide").click();
  326. }
  327. }
  328. }
  329.  
  330. function _encodeToGb2312(str, opt) {
  331. let ret = "";
  332. try {
  333. ret = encodeToGb2312(str, opt);
  334. } catch (e) {
  335. ret = Math.random() * 1e6;
  336. $("#drdm_dep_notice").show();
  337. }
  338. return ret;
  339. }
  340.  
  341. if (location.host === "movie.douban.com") {
  342. // 查看原图
  343. if ($('#mainpic p.gact').length === 0) { // 在未登录(不可用)的情况下添加空白元素以方便查看原图交互按钮的定位
  344. $("#mainpic").append("<p class=\"gact\"></p>");
  345. }
  346. let posterAnchor = document.querySelector('#mainpic > a > img');
  347. let postersUrl, rawUrl;
  348. if (posterAnchor) {
  349. postersUrl = posterAnchor.getAttribute("src");
  350. rawUrl = postersUrl.replace(/photo\/[sl](_ratio_poster|pic)\/public\/(p\d+).+$/, "photo/raw/public/$2.jpg");
  351. $('#mainpic p.gact').after(`<a target="_blank" rel="nofollow" href="${rawUrl}">查看原图</a>`);
  352. }
  353.  
  354. // 调整底下剧情简介的位置
  355. let interest_sectl_selector = $('#interest_sectl');
  356. interest_sectl_selector.after($('div.grid-16-8 div.related-info'));
  357. interest_sectl_selector.attr('style', 'float:right');
  358. $('div.related-info').attr('style', 'width:480px;float:left');
  359.  
  360. // Movieinfo信息生成相关
  361. let this_title, trans_title, aka;
  362. let year, region, genre, language, playdate;
  363. let imdb_link, imdb_id, imdb_average_rating, imdb_votes, imdb_rating;
  364. let douban_average_rating, douban_votes, douban_rating;
  365. let episodes, duration;
  366. let director, writer, cast;
  367. let tags, introduction, awards;
  368.  
  369. // 获得 <script type="application/ld+json" /> 里面的信息,这里面的东西和API返回需要的东西差不多
  370. let ld_json;
  371. try {
  372. ld_json = parseLdJson($('head > script[type="application/ld+json"]').text());
  373. } catch (e) { }
  374.  
  375. // 增加Mediainfo的交互按钮与监听
  376. if (GM_getValue("enable_mediainfo_gen", false)) {
  377. $("div#info").append("<br><span class=\"pl\">生成信息: </span><a id='movieinfogen' href='javascript:void(0);'>movieinfo</a>");
  378. $("div.related-info").before("<div class='c-aside' style='float:left;margin-top:20px;width: 470px;display: none' id='movieinfo_div'><h2><i>电影简介</i>· · · · · · </h2><a href='javascript:void(0);' id='copy_movieinfo'>点击复制</a><div class=\"c-aside-body\" style=\"padding: 0 12px;\" id='movieinfo'></div></div>");
  379. $("a#movieinfogen").click(function () {
  380. let descr = "";
  381. descr += poster ? `[img]${poster}[/img]\n\n` : "";
  382. descr += trans_title ? `◎译  名 ${trans_title}\n` : "";
  383. descr += this_title ? `◎片  名 ${this_title}\n` : "";
  384. descr += year ? `◎年  代 ${year.trim()}\n` : "";
  385. descr += region ? `◎产  地 ${region}\n` : "";
  386. descr += genre ? `◎类  别 ${genre}\n` : "";
  387. descr += language ? `◎语  言 ${language}\n` : "";
  388. descr += playdate ? `◎上映日期 ${playdate}\n` : "";
  389. descr += imdb_rating ? `◎IMDb评分 ${imdb_rating}\n` : ""; // 注意如果长时间没能请求完成imdb信息,则该条不显示
  390. descr += imdb_link ? `◎IMDb链接 ${imdb_link}\n` : "";
  391. descr += douban_rating ? `◎豆瓣评分 ${douban_rating}\n` : "";
  392. descr += douban_link ? `◎豆瓣链接 ${douban_link}\n` : "";
  393. descr += episodes ? `◎集  数 ${episodes}\n` : "";
  394. descr += duration ? `◎片  长 ${duration}\n` : "";
  395. descr += director ? `◎导  演 ${director}\n` : "";
  396. descr += writer ? `◎编  剧 ${writer}\n` : "";
  397. descr += cast ? `◎主  演 ${cast.replace(/\n/g, '\n' + ' '.repeat(4) + '  ').trim()}\n` : "";
  398. descr += tags ? `\n◎标  签 ${tags}\n` : "";
  399. descr += introduction ? `\n◎简  介\n\n  ${introduction.replace(/\n/g, '\n' + ' '.repeat(2))}\n` : "";
  400. descr += awards ? `\n◎获奖情况\n\n  ${awards.replace(/\n/g, '\n' + ' '.repeat(2))}\n` : "";
  401. $("div#movieinfo").html(descr.replace(/\n/ig, "<br>"));
  402. $("#movieinfo_div").toggle();
  403. });
  404. $("a#copy_movieinfo").click(function () {
  405. let movieclip = $("#movieinfo").html().replace(/<br>/ig, "\n").replace(/<a [^>]*>/g, "").replace(/<\/a>/g, "");
  406. GM_setClipboard(movieclip);
  407. $(this).text("复制成功");
  408. });
  409. }
  410.  
  411. // 先对一些关键信息进行判断
  412. let aka_anchor = $('#info span.pl:contains("又名")');
  413. let has_aka = aka_anchor.length > 0;
  414. let is_movie = $("a.bn-sharing[data-type='电影']").length > 0;
  415. let is_series = $("a.bn-sharing[data-type='电视剧']").length > 0;
  416. let is_anime = $('span[property="v:genre"]:contains("动画")').length > 0;
  417. let is_document = $('span[property="v:genre"]:contains("纪录片")').length > 0;
  418.  
  419. // 页面元素定位
  420. let regions_anchor = $('#info span.pl:contains("制片国家/地区")'); //产地
  421. let language_anchor = $('#info span.pl:contains("语言")'); //语言
  422. let episodes_anchor = $('#info span.pl:contains("集数")'); //集数
  423. let duration_anchor = $('#info span.pl:contains("单集片长")'); //片长
  424.  
  425. let imdb_anchor = $('#info span.pl:contains("IMDb")'); // IMDb
  426. let has_imdb = imdb_anchor.length > 0;
  427.  
  428. // 基础Movieinfo信息
  429. let chinese_title = document.title.replace('(豆瓣)', '').trim();
  430. let foreign_title = $('#content h1>span[property="v:itemreviewed"]').text().replace(chinese_title, '').trim();
  431. let poster = rawUrl ? rawUrl.replace('raw', 'l_ratio_poster').replace('img3', 'img1') : '';
  432.  
  433. if (has_aka) {
  434. aka = fetch_anchor(aka_anchor).split(' / ').sort(function (a, b) { //首字(母)排序
  435. return a.localeCompare(b);
  436. }).join('/');
  437. }
  438.  
  439. if (foreign_title) {
  440. trans_title = chinese_title + (aka ? ('/' + aka) : '');
  441. this_title = foreign_title;
  442. } else {
  443. trans_title = aka ? aka : '';
  444. this_title = chinese_title;
  445. }
  446.  
  447. playdate = $('#info span[property="v:initialReleaseDate"]').map(function () { //上映日期
  448. return $(this).text().trim();
  449. }).toArray().sort(function (a, b) {//按上映日期升序排列
  450. return new Date(a) - new Date(b);
  451. }).join('/');
  452.  
  453. year = ' ' + $('#content > h1 > span.year').text().substr(1, 4);
  454. region = regions_anchor[0] ? fetch_anchor(regions_anchor).split(' / ').join('/') : '';
  455. language = language_anchor[0] ? fetch_anchor(language_anchor).split(' / ').join('/') : '';
  456. episodes = episodes_anchor[0] ? fetch_anchor(episodes_anchor) : '';
  457. duration = duration_anchor[0] ? fetch_anchor(duration_anchor) : $('#info span[property="v:runtime"]').text().trim();
  458.  
  459. let is_europe = region.match(/美国|英国|加拿大|丹麦/);
  460. let is_japan = region.match(/日本/);
  461. let is_korea = region.match(/韩国/);
  462. let is_thai = region.match(/泰国/);
  463. let is_india = region.match(/印度/);
  464. let is_pakistan = region.match(/巴基斯坦|Pakistan/)
  465. let is_mainland = region.match(/中国大陆/);
  466. let is_mandarine = language.match(/汉语普通话/);
  467. let is_otherlan = language.match(/\//);
  468.  
  469. genre = $('#info span[property="v:genre"]').map(function () { //类别
  470. return $(this).text().trim();
  471. }).toArray().join('/');
  472.  
  473. // 获取电影名
  474. let title = $('#content > h1 > span')[0].textContent.split(' ').shift().replace(/[,]/g, " ").replace(/:.*$/, "");
  475. let eng_title = [this_title, trans_title].join("/").split("/").filter(function (arr) {
  476. return /([a-zA-Z]){2,}/.test(arr);
  477. })[0] || "";
  478. let is_chinese = title.match(/[^\x00-\xff]/);
  479. let unititle = is_chinese ? title : eng_title;
  480.  
  481. // 剧集修正季数名
  482. eng_title = eng_title.match(/Season\s\d\d/) ? eng_title.replace(/Season\s/, "S") : eng_title.replace(/Season\s/, "S0");
  483. eng_title = eng_title.replace(/[:,!\-]/g, "").replace(/ [^a-z0-9]+$/, "").replace(/ +/g, " ");
  484. let eng_title_clean = eng_title.replace(/ S\d\d*$/, "");
  485. let has_entitle = eng_title_clean;
  486.  
  487. // 日剧春夏秋冬解析
  488. let playdate_pro = new Date(playdate.split('/')[0]);
  489. let release_year = playdate.replace(/-.*$/, "").replace(/^\d{2}/, "");
  490. let release_month = playdate_pro.getMonth() + 1;
  491. let drama_season;
  492. if ([4, 5, 6].includes(release_month)) { drama_season = "spring"; }
  493. else if ([7, 8, 9].includes(release_month)) { drama_season = "summer"; }
  494. else if ([10, 11, 12].includes(release_month)) { drama_season = "autumn"; }
  495. else { drama_season = "winter"; }
  496.  
  497. // 电影+年份 (只有电影才搜索并赋值年份)
  498. let encode_year = is_movie ? year.replace(/ /, "_") : "";
  499. let nian = is_movie ? year : "";
  500. let encode_this_title = (this_title || "").replace(/:/, "").replace(/ /g, "_");
  501. let ptzimu = encode_this_title + encode_year;
  502. chinese_title = chinese_title.replace(/[:,]/, " ");
  503. let gunititle = _encodeToGb2312(unititle, true);
  504. let punititle = encodeURI(unititle).replace(/%/g, "%25");
  505. let uunititle = encodeURI(unititle).replace(/%/g, "_");
  506. let ywm = eng_title + nian;
  507. let zwm = chinese_title + nian;
  508. let entitle = eng_title_clean + nian
  509. let is_ywm = ywm.match(/[A-Z]/);
  510.  
  511. // Add top rank tag
  512. if (GM_getValue("enable_top_rang_tag", true)) {
  513. GM_xmlhttpRequest({
  514. method: 'GET',
  515. url: "https://bimzcy.github.io/rank4douban/data.json",
  516. onload: function (response) {
  517. let rank_json = JSON.parse(response.responseText);
  518. let insert_html_list = [];
  519. for (let i in rank_json) {
  520. let top_list = rank_json[i];
  521. let list_num = top_list.list[douban_id];
  522. if (list_num) {
  523. let list_order = top_list.top;
  524. insert_html_list[list_order] = `<div class="top250"><span class="top250-no">${top_list.prefix ? top_list.prefix : "No."}${list_num}</span><span class="top250-link"><a href="${top_list.href}" title="${top_list.title}">${top_list.short_title}</a></span></div>`;
  525. }
  526. }
  527. if (insert_html_list) {
  528. if ($('link[href*="top250.css"]').length === 0) {
  529. GM_addStyle(GM_getResourceText("top250_css"));
  530. }
  531. insert_html_list.push("<div style=\"display: none;\" id='rank_toggle' data-toggle='show'><a href=\"javascript::\">展示剩余 →</a></div>");
  532. let after = $("#content > h1");
  533. after.before(insert_html_list.join(' '));
  534. let top_selector = $(".top250");
  535. top_selector.css("display", "inline-block");
  536. if (top_selector.length > 4) {
  537. $(".top250:gt(3)").hide();
  538. $("#rank_toggle").show().css("display", "inline-block").click(function () {
  539. if ($(this).attr("data-toggle") === "show") {
  540. top_selector.show();
  541. $(this).attr("data-toggle", "hide").html("<a href=\"javascript::\">隐藏剩余 ←</a>");
  542. } else {
  543. $(".top250:gt(3)").hide();
  544. $(this).attr("data-toggle", "show").css("display", "inline-block").html("<a href=\"javascript::\">展示剩余 →</a>");
  545. }
  546. })
  547. }
  548. }
  549. }
  550. });
  551. }
  552.  
  553. // 从中栏中先获取豆瓣评分信息(此时还没有imdb等第三方评价信息)
  554. let douban_vote_another = $('div[typeof="v:Rating"]:eq(0)');
  555. if (douban_vote_another.length > 0) {
  556. douban_average_rating = douban_vote_another.find('[property="v:average"]').length > 0 ? douban_vote_another.find('[property="v:average"]').text() : 0;
  557. douban_votes = douban_vote_another.find('[property="v:votes"]').length > 0 ? douban_vote_another.find('[property="v:votes"]').text() : 0;
  558. douban_rating = douban_average_rating + '/10 from ' + douban_votes + ' users';
  559. }
  560.  
  561. // 中栏加强
  562. $("div#interest_sectl").append(`<div class='rating_wrap clearbox' id='loading_more_rate'>加载第三方评价信息中.......</div>
  563. <div class="rating_wrap clearbox rating_imdb" style="display:none"></div>
  564. <div class="rating_wrap clearbox rating_rott" style="display:none"></div>
  565. <div class="rating_wrap clearbox rating_anidb" style="border-top: 1px solid #eaeaea; display:none"></div>
  566. <div class="rating_more" style="display:none"></div>`); // 修复部分情况$("div.rating_betterthan")不存在情况
  567.  
  568. // put on more ratings
  569. let rating_more_data = [ /** {name, link || `${imdb_link}`, text} */];
  570.  
  571. function update_rating_more(data) {
  572. rating_more_data.push(data);
  573.  
  574. let rating_more = $('#interest_sectl .rating_more');
  575. let rating_more_html = '';
  576. for (let i = 0; i < rating_more_data.length; i++) {
  577. let rating_data = rating_more_data[i];
  578. rating_more_html += `<div>${rating_data['name']} <a href='${rating_data['link'] || imdb_link}' style="${rating_data['name'].length <= 4 ? 'margin-left:-20px' : ''} " target="_blank" title="${rating_data['data']}">${rating_data['data']}</a></div>`;
  579. }
  580. rating_more.html(rating_more_html);
  581. rating_more.show();
  582. $("#loading_more_rate").hide();
  583. }
  584.  
  585. // 请求IMDb信息(最慢,最先且单独请求)
  586. if (has_imdb) {
  587. imdb_id = fetch_anchor(imdb_anchor);
  588. imdb_link = `https://www.imdb.com/title/${imdb_id}/`
  589.  
  590. // 把豆瓣删除的超链接给加回去
  591. $(imdb_anchor[0].nextSibling).replaceWith(`&nbsp;<a href="${imdb_link}" target="_blank">${imdb_id}</a>`);
  592.  
  593. getDoc(imdb_link, null, function (doc) {
  594. // 判断是不是新版界面
  595. let new_another = $('script#__NEXT_DATA__', doc);
  596. let is_new = new_another.length > 0;
  597. let ld_json_imdb;
  598.  
  599. try {
  600. // IMDb 评分 (评分信息直接从 ld_json 中获取算了)
  601. ld_json_imdb = parseLdJson($('head > script[type="application/ld+json"]', doc).text());
  602. imdb_average_rating = ld_json_imdb["aggregateRating"]["ratingValue"];
  603. imdb_votes = ld_json_imdb["aggregateRating"]["ratingCount"];
  604. imdb_rating = imdb_votes ? imdb_average_rating + '/10 from ' + imdb_votes + ' users' : ''; // MovieinfoGen 相关
  605. $('#interest_sectl div.rating_imdb').html(starBlock("IMDB", imdb_link + 'ratings?ref_=tt_ov_rt', imdb_average_rating, imdb_votes)).show();
  606.  
  607. // 分级信息 可以从 ld_json 中获取
  608. if (ld_json_imdb['contentRating']) {
  609. const contentRatingMap = {
  610. 'G': '大众级 | 全年龄',
  611. 'PG': '指导级 | ≥6岁',
  612. 'PG-13': '特指级 | ≥13岁',
  613. 'NC-17': '限定级 | ≥17岁',
  614. 'R': '限制级 | ≥18岁',
  615. 'Not Rated': '未分级'
  616. };
  617. update_rating_more({
  618. name: '分级', // MPAA
  619. link: imdb_link + 'parentalguide#certification',
  620. data: contentRatingMap[ld_json_imdb['contentRating']] || ld_json_imdb['contentRating']
  621. });
  622. }
  623.  
  624. // Metascore
  625. let metascore_selector = is_new ? 'a[href*="criticreviews"] span.score' : 'a[href^=criticreviews] span';
  626. if ($(metascore_selector, doc).length > 0) {
  627. update_rating_more({
  628. name: 'Metascore',
  629. link: imdb_link + 'criticreviews?ref_=tt_ov_rt',
  630. data: $(metascore_selector, doc).text()
  631. });
  632. }
  633.  
  634. // 流行度
  635. let popularity_selector = is_new
  636. ? 'div[class^="TitleBlockButtonBase__ButtonContentWrap"]:has( > div[class^="TrendingButton__ContentWrap"])'
  637. : 'div:contains("Popularity") + div > span.subText';
  638. if ($(popularity_selector, doc).length > 0) {
  639. let popularity_another = $(popularity_selector, doc);
  640. let pop_score, pop_delta, pop_up;
  641. if (is_new) {
  642. pop_score = popularity_another.find('div[class^="TrendingButton__TrendingScore"]').text();
  643. pop_delta = popularity_another.find('div[class^="TrendingButton__TrendingDelta"]').text();
  644. pop_up = popularity_another.find('svg.ipc-icon--arrow-drop-up').length > 0;
  645. } else {
  646. let pop_text_match = popularity_another.text().match(/(\d+)\n.+?(\d+)/i);
  647. if (pop_text_match && pop_text_match.length >= 3) {
  648. pop_score = pop_text_match[1];
  649. pop_delta = pop_text_match[2];
  650. pop_up = popularity_another.find('span.popularityImageUp').length > 0;
  651. }
  652. }
  653.  
  654. if (pop_score) {
  655. update_rating_more({
  656. name: '流行度',
  657. link: imdb_link + 'criticreviews?ref_=tt_ov_rt',
  658. data: `${pop_score} (${pop_up ? '∧' : '∨'}${pop_delta})`
  659. });
  660. }
  661. }
  662.  
  663. // TODO let reviews;
  664.  
  665. // 从网页中获取的部分信息,要区分是否新版页面
  666. if (GM_getValue("enable_imdb_ext_info", true)) {
  667. if (is_new) {
  668. if ($("li.ipc-metadata-list__item.fJEELB:contains('Budget')", doc).length > 0) {
  669. update_rating_more({
  670. name: '总成本',
  671. data: $("li.ipc-metadata-list__item.fJEELB:contains('Budget')", doc).text().replace(/^Budget/, '').replace(/\(estimated\)/, '')
  672. });
  673. }
  674. if ($("li.ipc-metadata-list__item.fJEELB:contains('Opening weekend US & Canada')", doc).length > 0) {
  675. update_rating_more({
  676. name: '美首周',
  677. data: $("li.ipc-metadata-list__item.fJEELB:contains('Opening weekend US & Canada')", doc).text().replace(/^Opening weekend US & Canada/, '').replace(/[a-zA-Z]+ \d+, \d+$/, '')
  678. });
  679. }
  680. if ($("li.ipc-metadata-list__item.fJEELB:contains('Gross US & Canada')", doc).length > 0) {
  681. update_rating_more({
  682. name: '美票房',
  683. data: $("li.ipc-metadata-list__item.fJEELB:contains('Gross US & Canada')", doc).text().replace(/^Gross US & Canada/, '')
  684. });
  685. }
  686. if ($("li.ipc-metadata-list__item.fJEELB:contains('Gross worldwide')", doc).length > 0) {
  687. update_rating_more({
  688. name: '总票房',
  689. data: $("li.ipc-metadata-list__item.fJEELB:contains('Gross worldwide')", doc).text().replace(/^Gross worldwide/, '')
  690. });
  691. }
  692. if ($("li.ipc-metadata-list__item:contains('Aspect ratio')", doc).length > 0) {
  693. update_rating_more({
  694. name: '宽高比',
  695. data: $("li.ipc-metadata-list__item:contains('Aspect ratio')", doc).text().replace(/^Aspect ratio/, '')
  696. });
  697. }
  698. } else { // 旧版代码
  699. if ($("div.txt-block:contains('Budget:')", doc).length > 0) {
  700. update_rating_more({
  701. name: '总成本',
  702. data: $("div.txt-block:contains('Budget:')", doc).text().trim().replace(/\n/g, '').replace(/ .*$/, '').replace(/^Budget:/, '').replace(/CNY./, '¥').replace(/KRW./, '₩').replace(/JPY./, '円').replace(/HKD./, '港')
  703. });
  704. }
  705. if ($("div.txt-block:contains('Opening Weekend:'):not(:contains('USA:'))", doc).text().length > 0) {
  706. update_rating_more({
  707. name: '本首周',
  708. data: $("div.txt-block:contains('Opening Weekend:'):not(:contains('USA:'))", doc).text().trim().replace(/\n/g, '').replace(/^Opening Weekend:/, '').replace(/ \(.*$/, '').replace(/CNY./, '¥').replace(/KRW./, '₩').replace(/JPY./, '円').replace(/HKD./, '港')
  709. });
  710. }
  711. if ($("div.txt-block:contains('Opening Weekend USA:')", doc).text().length > 0) {
  712. update_rating_more({
  713. name: '美首周',
  714. data: $("div.txt-block:contains('Opening Weekend USA:')", doc).text().trim().replace(/\n/g, '').replace(/^Opening Weekend USA:/, '').replace(/,\d+ .*$/, '')
  715. });
  716. }
  717. if ($("div.txt-block:contains('Gross USA:')", doc).text().length > 0) {
  718. update_rating_more({
  719. name: '美票房',
  720. data: $("div.txt-block:contains('Gross USA:')", doc).text().trim().replace(/\n/g, '').replace(/^Gross USA:/, '').replace(/\, \d+ .*$/, '')
  721. });
  722. }
  723. if ($("div.txt-block:contains('Cumulative Worldwide Gross:')", doc).text().length > 0) {
  724. update_rating_more({
  725. name: '总票房',
  726. data: $("div.txt-block:contains('Cumulative Worldwide Gross:')", doc).text().trim().replace(/\n/g, '').replace(/^Cumulative Worldwide Gross:/, '').replace(/\, \d+ .*$/, '')
  727. });
  728. }
  729. if ($("div.txt-block:contains('Aspect Ratio:')", doc).text().length > 0) {
  730. update_rating_more({
  731. name: '宽高比',
  732. link: imdb_link + 'technical?ref_=tt_dt_spec',
  733. data: $("div.txt-block:contains('Aspect Ratio:')", doc).text().trim().replace(/\n/g, '').replace(/^Aspect Ratio:/, '')
  734. });
  735. }
  736. }
  737. }
  738. } catch (e) {
  739. // throw e;
  740. };
  741.  
  742. if (GM_getValue("enable_tomato_rate", true)) { //烂番茄评分显示功能
  743. // add rottentomatoes block
  744. let movieTitle = ld_json_imdb['name'].trim();
  745. let rottURL = 'https://www.rottentomatoes.com/m/' + movieTitle.replace(/:|-/, "").replace(/\s+/g, "_").replace(/\W+/g, "").replace(/_+/g, "_").toLowerCase();
  746. getDoc(rottURL, null, function (rotdoc) {
  747. $('#interest_sectl div.rating_rott').html(`<span class="rating_logo ll">烂番茄评分</span><br><div id="rottValue" class="rating_self clearfix"></div></div>`).show();
  748. if ($('script#score-details-json', rotdoc).length > 0) {
  749. let rottJson = JSON.parse($('#score-details-json', rotdoc).text());
  750. if (rottJson.modal && rottJson.modal.tomatometerScoreAll) {
  751. let tomatometerScoreAll = rottJson.modal.tomatometerScoreAll || {};
  752. let rating_rott_value = tomatometerScoreAll.score || 0;
  753. let fresh_rott_value = tomatometerScoreAll.likedCount || 0;
  754. let rotten_rott_value = tomatometerScoreAll.notLikedCount || 0;
  755. $('#interest_sectl .rating_rott #rottValue').append(`<strong class="ll rating_num"><a target="_blank" href="${rottURL}">${rating_rott_value}%</a></strong><div class="rating_right" style="line-height: 16px;"><span>鲜:&nbsp;&nbsp;${fresh_rott_value}</span><br><span>烂:&nbsp;&nbsp;${rotten_rott_value}</span></div>`);
  756. }
  757. }
  758. else {
  759. $('#interest_sectl div.rating_rott').append(`<br>搜索rotta: <a target='_blank' href='${'https://www.rottentomatoes.com/search/?search=' + encodeURI(movieTitle)}'>${movieTitle}</a>`);
  760. }
  761. });
  762. }
  763. $("#loading_more_rate").hide();
  764. });
  765. }
  766.  
  767. if (GM_getValue("enable_blue_date", true)) { //蓝光发售日期显示功能
  768. let ywm = eng_title.replace(/[:,!\-]/g, "").replace(/ /g, '-');
  769. let blueURL = 'https://www.releases.com/p/' + ywm.toLowerCase() + '/blu-ray/';
  770. getDoc(blueURL, null, function (bluedoc) {
  771. let result_0 = $('span[title*="Blu-ray"][title*="release date"]:not(:contains("TBA")):first', bluedoc);
  772. if (result_0.length > 0) {
  773. let blueDate = new Date(result_0.text());
  774. update_rating_more({ // 这种写法可能会导致 蓝光发售日期显示顺序飘忽不定,不过没有太大关系
  775. name: '蓝光发售',
  776. link: blueURL,
  777. data: `${blueDate.getFullYear()}年${blueDate.getMonth() + 1}月${blueDate.getDate()}日`
  778. });
  779. }
  780. });
  781. }
  782.  
  783. if (GM_getValue("enable_anime_rate", true)) { //开启动漫评分显示功能
  784. // 如果是动漫,请求anydb的anidb、bgm、mal信息
  785. if (is_anime) {
  786. getJSON("https://anydb.depar.cc/anime/query?_cf_cache=1&douban=" + douban_id, function (data1) {
  787. let _anydb_html = "";
  788. if (data1.success) {
  789. let source_list = ["AniDB", "Bgm", "MAL"];
  790. for (let i = 0; i < source_list.length; i++) {
  791. let source = source_list[i];
  792. let _data = data1.matched[source.toLowerCase()];
  793. if (_data) {
  794. let _group = _data.rate.match(/([\d.]+?) \((\d+)\)/);
  795. let _rating = _group[1];
  796. let _vote = _group[2];
  797. _anydb_html += starBlock(source, _data.url, _rating, _vote);
  798. }
  799. }
  800. if (_anydb_html.trim().length > 0) {
  801. $('#interest_sectl > div.rating_anidb').html(_anydb_html).show();
  802. }
  803. }
  804. $("#loading_more_rate").hide();
  805. });
  806. }
  807. }
  808.  
  809. if (GM_getValue("enable_mediainfo_gen", false)) { // 请求豆瓣附属信息用于Mediainfo生成
  810. GM_xmlhttpRequest({
  811. method: 'GET',
  812. url: douban_link + 'awards/',
  813. headers: {
  814. 'Host': 'movie.douban.com',
  815. // 'Referer' : location.href,
  816. },
  817. onload: function (responseDetail) {
  818. if (responseDetail.status === 200) {
  819. let doc = page_parser(responseDetail.responseText);
  820. awards = $('#content>div>div.article', doc).html()
  821. .replace(/[ \n]/g, '')
  822. .replace(/<\/li><li>/g, '</li> <li>')
  823. .replace(/<\/a><span/g, '</a> <span')
  824. .replace(/<(div|ul)[^>]*>/g, '\n')
  825. .replace(/<[^>]+>/g, '')
  826. .replace(/&nbsp;/g, ' ')
  827. .replace(/ +\n/g, '\n')
  828. .trim();
  829. }
  830. }
  831. }); // 该影片的评奖信息
  832.  
  833. // 简介 (首先检查是不是有隐藏的,如果有,则直接使用隐藏span的内容作为简介,不然则用 span[property="v:summary"] 的内容)
  834. introduction = $('#link-report > span.all.hidden').length > 0 ? $('#link-report > span.all.hidden').text() : // 隐藏部分
  835. ($('[property="v:summary"]').length > 0 ? $('[property="v:summary"]').text() : '暂无相关剧情介绍');
  836. introduction = introduction.split('\n').map(function (a) { return a.trim() }).join('\n'); // 处理简介缩进
  837. // 导演,编剧,演员 (只能获取到显示的,没API丰富)
  838. let director_another = $('span > span:contains("导演")').parent('span'); // 往上回溯一级
  839. let writer_another = $('span > span:contains("编剧")').parent('span');
  840. let cast_another = $('span.actor');
  841. if (ld_json) { // 优先使用ld_json中内容,没有则做页面解析
  842. if (ld_json['director']) director = ld_json['director'].map(function (d) { return d['name'] }).join(' / ');
  843. if (ld_json['author']) writer = ld_json['author'].map(function (d) { return d['name'] }).join(' / ');
  844. if (ld_json['actor']) cast = ld_json['actor'].map(function (d) { return d['name'] }).join('\n');
  845. }
  846. if (typeof director == 'undefined' && director_another.length > 0) director = director_another.find('a[href^="/celebrity"]').map(function () { return $(this).text() }).get().join(' / ');
  847. if (typeof writer == 'undefined' && writer_another.length > 0) writer = writer_another.find('a[href^="/celebrity"]').map(function () { return $(this).text() }).get().join(' / ');
  848. if (typeof cast == 'undefined' && cast_another.length > 0) cast = cast_another.find('a[href^="/celebrity"]').map(function () { return $(this).text() }).get().join('\n');
  849.  
  850. // 标签
  851. let tag_another = $('div.tags-body > a[href^="/tag"]');
  852. if (tag_another.length > 0) tags = tag_another.map(function () { return $(this).text() }).get().join(' | ');
  853. }
  854.  
  855. // 资源名称
  856. let zwzy = (unititle.replace(/ /g, ".").replace(":", ".").replace(/\.\./g, ".") + "." + eng_title.replace(": ", ".").replace(/ /g, ".") + "." + year.replace(/ /, "")).replace(/\.{2,}/g, ".");
  857. let imdbzy = has_imdb ? "." + imdb_id : "";
  858. $("div#info").append(`<br><span class=\"pl\">资源名称: </span>${zwzy}${imdbzy}`);
  859.  
  860. let neizhan = has_imdb ? imdb_id : ('/subject/' + douban_id); // PT内站 智能判定是用IMDB ID还是豆瓣ID
  861. let gongwang = has_imdb ? imdb_id : douban_id;
  862. let jingzhun = has_imdb ? imdb_id : ywm;
  863. let dbzw = has_imdb ? imdb_id : unititle + nian;
  864. let unit3d = has_imdb ? "imdb=" + imdb_id.slice(2) : "search=" + ywm;
  865. let movieright = is_movie ? "movies" : "tv-shows";
  866.  
  867. if (_version === "完整版") {
  868. let npid = has_imdb ? ('imdb=' + imdb_id) : ('douban=' + douban_id); // NPUBITS 智能判定是用IMDB ID还是豆瓣ID
  869. let ttgid = has_imdb ? ('IMDB' + imdb_id.slice(2)) : zwm; // TTG 智能判定是用IMDB ID还是中文名
  870. let ptfriend = has_imdb ? (imdb_id + '&search_area=4') : (douban_id + '&search_area=5'); // PT之友 智能判定是用IMDB ID还是豆瓣ID
  871. let zxid = has_imdb ? imdb_id : zwm; // ZX 智能判定是用IMDB ID还是中文名
  872. let monid = has_imdb ? ('imdbId=' + imdb_id) : ('name=' + zwm); // MONIKA智能判定是IMDB ID还是中文名
  873. let spid = has_imdb ? (imdb_id + '&search_area=4') : (unititle + '&search_area=0'); // Spring、天空、馒头 智能判定是用IMDB ID还是中文名
  874. let leid = has_imdb ? (imdb_id + '&search_area=imdb') : (douban_id + '&search_area=douban'); // Lemon 智能判定是用IMDB ID还是豆瓣ID
  875. site_map.push({
  876. name: "20万+种PT内站",
  877. label: [
  878. { name: "HDSky", link: 'https://hdsky.me/torrents.php?incldead=1&notnewword=1&search=' + spid, },
  879. { name: "MTeam", link: 'https://kp.m-team.cc/torrents.php?incldead=1&notnewword=1&search=' + spid, },
  880. { name: "PT之友", link: 'https://pterclub.com/torrents.php?incldead=1&notnewword=1&search=' + ptfriend, selector: "table.torrents table.torrentname" },
  881. { name: "TTG", link: 'https://totheglory.im/browse.php?c=M&notnewword=1&search_field=' + ttgid, selector: "table#torrent_table:last > tbody > tr:gt(0)" },
  882. ]
  883. });
  884. site_map.push({
  885. name: "10万+种PT内站",
  886. label: [
  887. { name: "Audience", link: 'https://audiences.me/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  888. { name: "BTSchool", link: 'http://pt.btschool.club/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,/* selector: "table.torrents:last > tbody > tr:gt(0)"}, */ },
  889. { name: "CHDBits", link: 'https://chdbits.co/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  890. { name: "HDChina", link: 'https://hdchina.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, selector: "table.torrent_list:last > tbody > tr:gt(0)" },
  891. { name: "HDHome", link: 'https://hdhome.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  892. { name: "OurBits", link: 'https://ourbits.club/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  893. { name: "PTHOME", link: 'https://www.pthome.net/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  894. { name: "SJTU", link: 'https://pt.sjtu.edu.cn/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, selector: "table.torrents:last > tbody > tr" },
  895. { name: "TJUPT", link: 'https://www.tjupt.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, selector: "table.torrents table.torrentname" },
  896. ]
  897. });
  898. site_map.push({
  899. name: "5万+种PT内站",
  900. label: [
  901. { name: "HDArea", link: 'https://www.hdarea.co/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, selector: "table.torrents table.torrentname", selector_need_login: "h1 span:contains('Checking your browser before accessing')" },
  902. { name: "HDDolby", link: 'https://www.hddolby.com/torrents.php?incldead=1&search_area=1¬newword=1&search=' + neizhan, },
  903. { name: "HDTime", link: 'https://hdtime.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  904. { name: "Spring", link: 'https://springsunday.net/torrents.php?incldead=1&notnewword=1&search=' + spid, },
  905. { name: "红叶", link: 'http://leaves.red/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  906. { name: "聆音Club", link: 'https://pt.soulvoice.club/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  907. ]
  908. });
  909. site_map.push({
  910. name: "2万+种PT内站",
  911. label: [
  912. { name: "CarPT", link: 'https://carpt.net/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  913. { name: "DiscFan", link: 'http://discfan.net/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  914. { name: "GHTT", link: 'https://www.hitpt.com/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, selector: "table.torrents table.torrentname" },
  915. { name: "GPW", link: 'https://greatposterwall.com/torrents.php?searchstr=' + unititle, selector: ".TableTorrent-movieInfoBody .TableTorrent-movieInfoTitle" },
  916. { name: "HD4FANS", link: 'https://pt.hd4fans.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  917. { name: "HDAtmos", link: 'https://hdatmos.club/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  918. { name: "HDFans", link: 'https://hdfans.org/torrents.php?incldead=1&search_area=1&newword=1&search=' + neizhan, },
  919. { name: "HDU", link: 'http://pt.upxin.net/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  920. { name: "HHCLUB", link: 'https://hhanclub.top/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  921. { name: "NYPT", link: 'https://nanyangpt.com/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, selector: "table.torrents:last > tbody > tr" },
  922. { name: "PT时间", link: 'https://www.pttime.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  923. { name: "TCCF", link: 'https://et8.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  924. { name: "TLFBits", link: 'http://pt.eastgame.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  925. { name: "海胆之家", link: 'https://www.haidan.video/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, selector: "div.name_col.table_cell" },
  926. { name: "明教", link: 'https://hdpt.xyz/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  927. { name: "烧包乐园", link: 'https://ptsbao.club/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  928. ]
  929. });
  930. site_map.push({
  931. name: "1万+种PT内站",
  932. label: [
  933. { name: "52PT", link: 'https://52pt.site/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,/* selector: "table.torrents:last > tbody > tr:gt(0)"}, */ },
  934. { name: "FRDS", link: 'https://pt.keepfrds.com/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, selector: "table.torrents table.torrentname" },
  935. { name: "JoyHD", link: 'https://www.joyhd.net/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, selector: "tr table.torrentname" },
  936. { name: "Hares", link: 'https://club.hares.top/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, selector: "div.layui-torrents-title" },
  937. { name: "HDCity", link: 'https://hdcity.city/pt?incldead=1&search_area=1&notnewword=1&iwannaseethis=' + neizhan, selector: "center > div > div > div.text" },
  938. { name: "HDVIDEO", link: 'https://hdvideo.one/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  939. { name: "HDZone", link: 'http://hdzone.me/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  940. { name: "龙之家", link: 'https://www.dragonhd.xyz/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  941. { name: "小蚂蚁", link: 'http://hdmayi.com/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  942. { name: "壹PT吧", link: 'https://1ptba.com/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  943. ]
  944. });
  945. site_map.push({
  946. name: "5千+种PT内站",
  947. label: [
  948. // { name: "HDAI", method: "post", link: 'http://www.hd.ai/Torrents.index?keyword=' + unititle, ajax:'http://www.hd.ai/Torrents.tableList', data:`{"keyword":"${unititle}"}`, headers: { "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8" }, selector: 'data.length > 0' },
  949. { name: "3Wmg", link: 'https://www.3wmg.com/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  950. { name: "BeiTai", link: 'http://www.beitai.pt/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,/* selector: "table.torrents:last > tbody > tr:gt(0)"}, */ },
  951. { name: "FreeFarm", link: 'https://pt.0ff.cc/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  952. { name: "OshenPT", link: 'http://www.oshen.win/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  953. { name: "UBits", link: 'https://ubits.club/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  954. { name: "WinSaku", link: 'https://wintersakura.net/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  955. { name: "ZmPT", link: 'https://zmpt.cc/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  956. { name: "铂金学院", link: 'https://ptchina.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  957. { name: "海棠PT", link: 'https://www.htpt.cc/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  958. ]
  959. });
  960. site_map.push({
  961. name: "1千+种内站",
  962. label: [
  963. { name: "ICC", link: 'https://www.icc2022.com/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  964. { name: "OKPT", link: 'https://www.okpt.net/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  965. { name: "PT分享站", link: 'https://pt.itzmx.com/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  966. { name: "UltraHD", link: 'https://ultrahd.net/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  967. { name: "库非", link: 'https://kufei.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  968. ]
  969. });
  970. if (is_anime) {
  971. site_map.push({
  972. name: "PT动漫游戏",
  973. label: [
  974. { name: "AB", link: 'https://animebytes.tv/torrents.php?searchstr=' + ywm, selector: "div.thin > div.group_cont" },
  975. { name: "BakaBT", link: 'https://bakabt.me/browse.php?q=' + ywm, selector: "table.torrents > tbody > tr:gt(0)", selector_need_login: "#loginForm" },
  976. { name: "CC", link: 'http://www.cartoonchaos.org/index.php?page=torrents&options=0&active=1&search=' + ywm, selector: "table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(2) > td > table > tbody > tr:gt(0)", selector_need_login: "table[style='border-color:#E70000']" },
  977. { name: "MONIKA", link: 'https://monikadesign.uk/torrents?' + monid, selector: "td.torrent-listings-overview" },
  978. { name: "SkySnow", link: 'https://skyeysnow.com/forum.php?mod=torrents&notnewword=1&search=' + unititle + nian, selector: "table.torrents > tbody > tr:gt(0)" },
  979. { name: "U2", link: 'https://u2.dmhy.org/torrents.php?incldead=1&search_area=0&notnewword=1&search=' + this_title, },
  980. ]
  981. });
  982. }
  983. site_map.push({
  984. name: "PT影视IPV6",
  985. label: [
  986. { name: "6V", method: "POST", link: 'http://bt.neu6.edu.cn/search.php?mod=forum', selector: '#threadlist > table > tbody > tr:gt(0)', data: `srchtxt=${gunititle}&srchfilter=all&srchfrom=0&before=0&orderby=lastpost&ascdesc=desc&srchfid[]=all&searchsubmit=yes`, headers: { "Content-Type": "application/x-www-form-urlencoded" }, rewrite_href: true, csrf: { name: "formhash", update: "data" } },
  987. { name: "BYRBT", link: 'https://bt.byr.cn/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  988. { name: "HUDBT", link: 'https://hudbt.hust.edu.cn/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  989. { name: "NPUBITS", link: 'https://npupt.com/torrents.php?incldead=1&search_area=1&notnewword=1&' + npid, selector: "#torrents_table > tbody > tr:gt(0)" },
  990. { name: "NWSUAF", link: 'https://pt.nwsuaf6.edu.cn/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, },
  991. { name: "PT江湖", method: "POST", link: 'http://www.dutpt.com/search.php?mod=forum', selector: '#threadlist li.pbw', data: `srchtxt=${unititle}&searchsubmit=yes`, headers: { "Content-Type": "application/x-www-form-urlencoded" }, rewrite_href: true, csrf: { name: "formhash", update: "data" }, selector_need_login: "#messagetext" },
  992. { name: "ZX", link: 'http://pt.zhixing.bjtu.edu.cn/search/x' + zxid + '-notnewword=1/', selector: "table.torrenttable > tbody > tr:gt(1)" },
  993. ]
  994. });
  995. site_map.push({
  996. name: "PT影视原声",
  997. label: [
  998. { name: "DicMusic", link: 'https://dicmusic.club/torrents.php?notnewword=1&searchstr=' + unititle, selector: "td.td_info.big_info" },
  999. { name: "OpenCD", link: 'https://open.cd/torrents.php?incldead=1&search_area=0&notnewword=1&search=' + unititle, selector: "table.torrents:last > tbody > tr:gt(0)" },
  1000. { name: "JPOP", link: 'https://jpopsuki.eu/torrents.php?searchstr=' + eng_title, selector: "#torrent_table > tbody > tr:gt(0)" },
  1001. { name: "Red", link: 'https://redacted.ch/torrents.php?searchstr=' + eng_title, selector: "tr.group_torrent.edition_1" },
  1002. ]
  1003. });
  1004. site_map.push({
  1005. name: "PT影视外站",
  1006. label: [
  1007. { name: "AR", link: 'https://alpharatio.cc/torrents.php?searchstr=' + ywm, selector: "#torrent_table > tbody > tr:gt(0)" },
  1008. { name: "AHD", link: 'https://awesome-hd.me/torrents.php?id=' + imdb_id, selector: ".torrent_table", selector_need_login: "#loginform" },
  1009. { name: "AsiaCine", link: 'https://asiancinema.me/filterTorrents?' + unit3d, selector: "div.table-responsive a.view-torrent" },
  1010. { name: "BHD", link: 'https://beyond-hd.me/browse.php?incldead=0&search=' + imdb_id, selector: "table.tb_detail.grey.torrenttable:last > tbody > tr:gt(0)" },
  1011. { name: "Classix", link: 'http://classix-unlimited.co.uk/torrents-search.php?incldead=0&search=' + eng_title, selector: "table.ttable_headinner tr.t-row" },
  1012. { name: "FileList", link: 'https://filelist.ro/browse.php?searchin=3&search=' + imdb_id, selector: "div.torrentrow a[data-html='true']" },
  1013. { name: "HDB", link: 'https://hdbits.org/browse.php?&imdb=' + imdb_id, selector: "#torrent-list", selector_need_login: "a[href='/recover.php']" },
  1014. { name: "HDF", link: 'https://hdf.world/torrents.php?searchstr=' + ywm, selector: "#torrent_table > tbody > tr:gt(0)" },
  1015. { name: "HDME", link: 'http://hdme.eu/browse.php?incldead=1&blah=1&search=' + imdb_id, selector: "table:nth-child(13) > tbody > tr" },
  1016. { name: "HDMonkey", link: 'https://hdmonkey.org/torrents-search.php?incldead=0&search=' + ywm, selector: "table.ttable_headinner > tbody > tr:gt(0)" },
  1017. { name: "HDS", link: 'https://hd-space.org/index.php?page=torrents&active=1&options=2&search=' + imdb_id, selector: "table.lista:last > tbody > tr:gt(0)", selector_need_login: "form[name='login']" },
  1018. { name: "HDT", link: 'https://hd-torrents.org/torrents.php?active=1&options=2&search=' + imdb_id, selector: "table.mainblockcontenttt b", selector_need_login: "form[name='login']" },
  1019. { name: "IPT", link: 'https://iptorrents.com/t?qf=all&q=' + imdb_id, selector: "#torrents td.ac" },
  1020. { name: "MTV", link: 'https://www.morethan.tv/torrents.php?searchstr=' + eng_title_clean, selector: "table.torrent_table > tbody > tr:gt(0)" },
  1021. { name: "PTF", link: 'http://ptfiles.net/browse.php?incldead=0&title=0&search=' + ywm, selector: "#tortable > tbody > tr.rowhead:gt(0)" },
  1022. { name: "PTP", link: 'https://passthepopcorn.me/torrents.php?searchstr=' + imdb_id, selector: '#torrent-table tr.group_torrent.group_torrent_header:gt(0)', selector_need_login: "#loginform" },
  1023. { name: "RTF", link: 'https://retroflix.club/torrents1.php?incldead=1&spstate=0&inclbookmarked=0&search_area=4&search_mode=0&search=' + imdb_id, selector: "td table.torrentname" },
  1024. { name: "SC", link: 'https://secret-cinema.pw/torrents.php?cataloguenumber=' + imdb_id, selector: "div.torrent_card" },
  1025. { name: "SDB", link: 'http://sdbits.org/browse.php?incldead=0&imdb=' + imdb_id, selector: "#torrent-list tr.light" },
  1026. { name: "Speed", link: 'https://speed.cd/browse.php?d=on&search=' + imdb_id, selector: "div.boxContent > table:first >tbody > tr:gt(0)" },
  1027. { name: "TD", link: 'https://www.torrentday.com/t?q=' + imdb_id, selector: "#torrentTable td.torrentNameInfo" },
  1028. { name: "TS", link: 'https://www.torrentseeds.org/browse.php?searchin=title&incldead=0&search=%22' + eng_title + year + '%22', selector: "table.table.table-bordered > tbody > tr.browse_color:gt(0)" },
  1029. { name: "TT", link: 'https://revolutiontt.me/browse.php?search=' + imdb_id, selector: "table#torrents-table > tbody > tr:gt(0)" },
  1030. { name: "TL", type: "json", link: "https://www.torrentleech.org/torrents/browse/index/query/" + eng_title + nian, ajax: "https://www.torrentleech.org/torrents/browse/list/query/" + eng_title + year, selector: "numFound > 0" },
  1031. { name: "UHD", link: 'https://uhdbits.org/torrents.php?searchstr=' + imdb_id, selector: "table.torrent_table > tbody > tr.group" },
  1032. ]
  1033. });
  1034. if (is_india || is_pakistan) {
  1035. site_map.push({
  1036. name: "PT印度电影站",
  1037. label: [
  1038. { name: "BwT", link: "https://bwtorrents.tv/index.php?blah=0&cat=0&incldead=1&search=" + ywm, selector: "table.pager + table tr.browse" },
  1039. { name: "Hon3yHD", link: "https://hon3yhd.com/browse.php?searchin=title&incldead=0&search=" + eng_title, selector: "table tr.tt" },
  1040. { name: 'Desitor', method: "post", type: "json", link: 'https://desitorrents.tv/#search_' + ywm, ajax: 'https://desitorrents.tv/ajax.php?action=search_torrent_cats', data: `selected_group=&search_username=&selected_sorting=relevance&search_string=${ywm}`, headers: { "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8" }, selector: 'torrent_html.length > 0' },
  1041. ]
  1042. });
  1043. }
  1044. }
  1045.  
  1046. if (_version === "完整版" && has_imdb) {
  1047. site_map.push({
  1048. name: "NZB终身影视",
  1049. label: [
  1050. { name: "altHUB", link: 'https://althub.co.za/search/' + ywm, selector: "#browsetable a.title", selector_need_login: "#modalLogin" },
  1051. { name: "Crawler", link: 'https://www.usenet-crawler.com/advsearch?searchadvr=' + ywm, selector: "#browsetable a.title", selector_need_login: "#modalLogin" },
  1052. { name: "Miatrix", link: 'https://www.miatrix.com/search/' + ywm, selector: "#browsetable > tbody > tr:gt(0)", selector_need_login: "form[action='login']" },
  1053. { name: "Ninja", link: 'http://ninjacentral.co.za/search/' + ywm, selector: "#browsetable a.title", selector_need_login: "form[action='login']" },
  1054. { name: "NZBCat", link: 'https://nzb.cat/search/' + ywm, selector: "#browsetable > tbody > tr:gt(0)", selector_need_login: "form[action='login']" },
  1055. { name: "NZBgeek", link: 'https://nzbgeek.info/geekseek.php?movieid=' + imdb_id.slice(2), selector: "table > tbody > tr.HighlightTVRow2:gt(0)", selector_need_login: "input[value='do_login']" },
  1056. { name: "NZBGrab", link: 'https://www.nzbgrabit.xyz/nzbsearch.php?query=' + imdb_id, selector: "h3.threadtitle", selector_need_login: "form[action='login.php?do=login']" },
  1057. { name: "NZBP", link: 'https://nzbplanet.net/search/' + ywm, selector: "#browsetable > tbody > tr:gt(0)", selector_need_login: "form[action='login']" },
  1058. { name: "NZBs2GO", link: 'https://nzbs2go.com/search?id=' + ywm, selector: "#browsetable > tbody > tr:gt(0)", selector_need_login: "form[action='login']" },
  1059. { name: "Oznzb", link: 'https://www.oznzb.com/search/' + ywm, selector: "#browsetable > tbody > tr.ratingReportContainer:gt(0)", selector_need_login: "#login" },
  1060. { name: "SNZB", link: 'https://simplynzbs.com/search/' + ywm, selector: "#browsetable > tbody > tr:gt(0)", selector_need_login: "form[action='login']" },
  1061. ]
  1062. });
  1063. site_map.push({
  1064. name: "NZB年费影视",
  1065. label: [
  1066. { name: "abNZB", link: 'https://www.abnzb.com/search/' + ywm, selector: "#browsetable a.title", selector_need_login: "#modalLogin" },
  1067. { name: "DOGnzb", link: 'https://dognzb.cr/search?q=' + ywm, selector: "tr.odd a.link", selector_need_login: "#login" },
  1068. { name: "NZBFind", link: 'https://nzbfinder.ws/search?id=' + ywm, selector: "td.check + td a", selector_need_login: "div.account-form" },
  1069. { name: "NZBNDX", link: 'https://nzbndx.com/search/' + ywm, selector: "#browsetable a.title", selector_need_login: "#modalLogin" },
  1070. { name: "NzbNoob", link: 'https://nzbnoob.com/search/' + ywm, selector: "#browsetable a.title", selector_need_login: "#modalLogin" },
  1071. { name: "NZBSU", link: 'https://nzb.su/search/' + ywm, selector: "#browsetable a.title", selector_need_login: "#modalLogin" },
  1072. ]
  1073. });
  1074. site_map.push({
  1075. name: "NZB免费影视",
  1076. label: [
  1077. { name: "BiNZB", link: 'http://binzb.com/search?q=' + ywm, selector: ".list td .groups" },
  1078. { name: "Bsearch", link: 'http://binsearch.info/?q=' + ywm, selector: "td span.s" },
  1079. { name: "FindNZB", link: 'https://findnzb.net/?q=' + ywm, selector: ".results .big" },
  1080. { name: "FreeNZBs", link: 'https://freenzbs.com/?search%5Btree%5D=cat0_z0_a0&sortdir=ASC&sortby=&search%5Bvalue%5D%5B%5D=Title%3A%3D%3ADEF%3A' + eng_title_clean, selector: "#spots td.title" },
  1081. { name: "NewzNab", link: 'https://newz69.keagaming.com/search/' + ywm, selector: "#browsetable a.title", selector_need_login: "form[action='login']" },
  1082. { name: "NZBStar", link: 'https://nzbstars.com/?search%5Btree%5D=cat0_z0_a0&sortdir=ASC&sortby=&search%5Bvalue%5D%5B%5D=Title%3A%3D%3ADEF%3A' + eng_title_clean, selector: "#spots td.title" },
  1083. { name: "NZBXS", link: 'https://www.nzbxs.com/?search%5Btree%5D=cat0_z0_a0&sortdir=ASC&sortby=&search%5Bvalue%5D%5B%5D=Title%3A%3D%3ADEF%3A' + eng_title_clean, selector: "#spots td.title" },
  1084. { name: "SpotNZB", link: 'https://spotnzb.xyz/?search%5Btree%5D=cat0_z0_a0&sortdir=ASC&sortby=&search%5Bvalue%5D%5B%5D=Title%3A%3D%3ADEF%3A' + eng_title_clean, selector: "#spots td.title" },
  1085. ]
  1086. });
  1087. site_map.push({
  1088. name: "终生会员论坛",
  1089. label: [
  1090. { name: "古哥论坛", link: 'http://www.gudage.cc/search.php?mod=forum&searchsubmit=yes&srchtxt=' + gunititle, selector: "div.tl li.pbw" },
  1091. { name: "抱书吧", link: 'http://www.baoshu8.com/searcher.php?type=thread&keyword=' + gunititle, selector: "div.dlA dl" },
  1092. { name: "国配影迷", link: 'https://club.ccmnn.com/search.php?mod=forum&searchsubmit=yes&srchtxt=' + gunititle, selector: "div.tl li.pbw" },
  1093. { name: "慢慢游影", link: 'https://www.mmybt.com/search.php?mod=forum&searchsubmit=yes&srchtxt=' + unititle, selector: "div.tl li.pbw", selector_need_login: "#messagelogin" },
  1094. { name: "盘乐网影", link: 'http://www.haopanyou.com/search.php?mod=forum&searchsubmit=yes&srchtxt=' + unititle, selector: "div.tl li.pbw", selector_need_login: "#ls_username" },
  1095. { name: "印度电影", link: 'http://www.indmi.com/search.php?mod=forum&searchsubmit=yes&srchtxt=' + unititle, selector: "div.tl li.pbw" },
  1096. { name: "云中漫步", link: 'https://www.yunzmb.com/search.php?mod=forum&searchsubmit=yes&srchtxt=' + gunititle, selector: "div.tl li.pbw" },
  1097. ]
  1098. });
  1099. site_map.push({
  1100. name: "影视论坛资源",
  1101. label: [
  1102. { name: "网盘分享吧", link: 'http://www.wpfx8.com/search.php?mod=forum&searchsubmit=yes&srchtxt=' + unititle, selector: "div.tl li.pbw", selector_need_login: "#messagelogin" },
  1103. { name: "深影论坛", link: 'http://forum.shinybbs.vip/search.php?mod=forum&searchsubmit=yes&srchtxt=' + gunititle, selector: "div.tl li.pbw", selector_need_login: "#messagelogin" },
  1104. ]
  1105. });
  1106.  
  1107. if (_version === "完整版" && (!(is_mandarine) || (is_mandarine && is_otherlan))) {
  1108. site_map.push({
  1109. name: "PT影视字幕",
  1110. label: [
  1111. { name: "BTSchool®", link: 'http://pt.btschool.club/subtitles.php?notnewword=1&search=' + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)" },
  1112. { name: "BeiTai®", link: "https://www.beitai.pt/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)" },
  1113. { name: "CHDBits®", link: "https://chdbits.co/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table:last > tbody > tr:gt(1)" },
  1114. { name: "FRDS®", link: "http://pt.keepfrds.com/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)" },
  1115. { name: "GHTT®", link: 'https://www.hitpt.com/subtitles.php?notnewword=1&search=' + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)" },
  1116. { name: "Hares®", link: 'https://club.hares.top/subtitles.php?notnewword=1&search=' + ptzimu, selector: "table:last > tbody > tr:gt(1)" },
  1117. { name: "HD4FANS®", link: 'https://pt.hd4fans.org/subtitles.php?notnewword=1&search=' + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)" },
  1118. { name: "HDArea®", link: 'https://www.hdarea.co/subtitles.php?notnewword=1&search=' + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)", selector_need_login: "h1 span:contains('Checking your browser before accessing')" },
  1119. { name: "HDAtmos®", link: 'https://hdatmos.club/subtitles.php?notnewword=1&search=' + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)" },
  1120. { name: "HDChina®", link: "https://hdchina.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table.uploaded_sub_list > tbody > tr:gt(1)" },
  1121. { name: "HDCity®", link: "https://hdcity.city/subtitles?notnewword=1&search=" + ptzimu, selector: "center > div:nth-child(1) > table > tbody > tr:nth-child(2)" },
  1122. { name: "HDHome®", link: "https://hdhome.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table:last > tbody > tr:gt(1)" },
  1123. { name: "HDSky®", link: "https://hdsky.me/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table:last > tbody > tr:gt(1)" },
  1124. { name: "HDTime®", link: "https://hdtime.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='100%'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr" },
  1125. { name: "HDU®", link: "http://pt.upxin.net/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)" },
  1126. { name: "JoyHD®", link: "https://www.joyhd.net/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)" },
  1127. { name: "MTeam®", link: "https://kp.m-team.cc/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table.table-subtitle-list:last > tbody > tr" },
  1128. //{ name: "NPUBITS®", link: "https://npupt.com/subtitles.php?notnewword=1&search=" + ptzimu, selector: "#main > table > tbody > tr:nth-child(2)" },
  1129. { name: "NYPT®", link: "https://nanyangpt.com/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)" },
  1130. { name: "OurBits®", link: "https://ourbits.club/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)" },
  1131. { name: "PTHOME®", link: 'https://www.pthome.net/subtitles.php?notnewword=1&search=' + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)" },
  1132. { name: "PT之友®", link: 'https://pterclub.com/subtitles.php?notnewword=1&search=' + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)" },
  1133. { name: "SJTU®", link: "https://pt.sjtu.edu.cn/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)" },
  1134. { name: "Spring®", link: 'https://springsunday.net/subtitles.php?notnewword=1&search=' + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)" },
  1135. { name: "TCCF®", link: "https://et8.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)" },
  1136. { name: "TJUPT®", link: "https://www.tjupt.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)" },
  1137. { name: "TLFBits®", link: "http://pt.eastgame.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)" },
  1138. { name: "U2®", link: "https://u2.dmhy.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)" },
  1139. ]
  1140. });
  1141. }
  1142. }
  1143.  
  1144. site_map.push({
  1145. name: "云盘资源搜索",
  1146. label: [
  1147. { name: '云搜影视(夸克) ', link: 'https://yunsou.xyz/s/' + unititle, selector: 'ul.DiscussionList-discussions > li[data-id]' },
  1148. { name: 'AQ网盘论坛', link: 'https://wpzy.cc/?q=' + unititle, selector: 'ul.DiscussionList-discussions > li[data-id]' },
  1149. { name: 'AQ影视资源', link: 'https://wpzy.me/?q=' + unititle, selector: 'ul.DiscussionList-discussions > li[data-id]' },
  1150. { name: 'AQ网盘搜索', link: 'https://wpzy.vip/search/?kw=' + unititle, selector: 'ul.DiscussionList-discussions > li[data-id]' },
  1151. // { name: '分派电影', link: 'https://www.howgo.cc/forums/search/' + unititle, selector: '.page-title' },
  1152. ]
  1153. });
  1154. if (is_movie) {
  1155. site_map.push({
  1156. name: "网盘搜影视",
  1157. label: [
  1158. { name: 'AQ网盘搜索', link: 'https://wpzy.vip/search/?kw=' + unititle + '&currentPage=1&s=down&f=1', selector: `h4 a:contains(${unititle})` },
  1159. { name: 'Pan58电影', link: 'http://www.pan58.com/s?wd=' + unititle + '&s=2&t=0&p=1', selector: `.filetext p.fname:contains(${unititle})` },
  1160. ]
  1161. });
  1162. }
  1163. /** if (has_imdb || is_ywm) {
  1164. site_map.push({
  1165. name: "国外网盘精准",
  1166. label: [
  1167. { name: 'BestMovie✇', link: 'https://www.best-moviez.ws/?s=' + jingzhun, selector: '#content h1.entry-title', selector_need_login: "h1 span:contains('Checking your browser')" },
  1168. { name: 'DDLWare✇', link: 'https://ddl-warez.to/?search=' + jingzhun, selector: 'table.table-condensed td.no_overflow', selector_need_login: "h1 span:contains('Checking your browser')" },
  1169. { name: 'DL4ALL✇', link: 'http://dl4all.xyz/?do=search&subaction=search&story=' + jingzhun, selector: 'span.category h2', selector_need_login: "h1 span:contains('Checking your browser')" },
  1170. { name: 'Downtr✇', link: 'https://downtr.cc/?do=search&subaction=search&story=' + jingzhun, selector: '#dle-content div.title', selector_need_login: "h1 span:contains('Checking your browser')" },
  1171. { name: 'FilmSoft✇', link: 'http://filmsofts.com/?do=search&subaction=search&story=' + jingzhun, selector: '#dle-content div.story', selector_need_login: "h1 span:contains('Checking your browser')" },
  1172. { name: 'Freshwap✇', link: 'http://www.freshwap.cc/?do=search&subaction=search&story=' + jingzhun, selector: '#dle-content div.maincont', selector_need_login: "h1 span:contains('Checking your browser')" },
  1173. { name: 'MovieWBB✇', link: 'http://movieswbb.net/?s=' + jingzhun, selector: 'div.content.blog div.blogpostcategory', selector_need_login: "h1 span:contains('Checking your browser')" },
  1174. { name: 'OneDDL✇', link: 'https://oneddl.org/?do=search&subaction=search&story=' + jingzhun, selector: '#dle-content div.con', selector_need_login: "h1 span:contains('Checking your browser')" },
  1175. { name: 'WarezSer✇', link: 'http://warez-serbia.com/index.php?do=search&subaction=search&story=' + jingzhun, selector: '#dle-content div.post-info', selector_need_login: "h1 span:contains('Checking your browser')" },
  1176. { name: 'Win7DL✇', link: 'https://win7dl.org/?do=search&subaction=search&story=' + jingzhun, selector: '#dle-content td.block_head_2', selector_need_login: "h1 span:contains('Checking your browser')" },
  1177. ]
  1178. });
  1179. } **/
  1180. site_map.push({
  1181. name: "在线正版中文",
  1182. label: [
  1183. { name: '爱奇艺视频', link: 'https://so.iqiyi.com/so/q_' + unititle, selector: "div.mod_result span.play_source" },
  1184. { name: '哔哩哔哩', link: 'https://search.bilibili.com/all?keyword=' + unititle, selector: 'span.bangumi-label+a' },
  1185. { name: '乐视视频', link: 'http://so.le.com/s?wd=' + unititle, selector: `h1 > a.j-baidu-a[title*='${unititle}']` },
  1186. { name: '芒果TV', link: 'https://so.mgtv.com/so/k-' + unititle, selector: 'div.so-result-info.clearfix span.label' },
  1187. { name: '搜狐视频', link: 'https://so.tv.sohu.com/mts?wd=' + unititle, selector: 'div.wrap.cfix div.cfix.resource' },
  1188. { name: '腾讯视频', link: 'https://v.qq.com/x/search/?q=' + unititle, selector: 'div.wrapper_main div._infos' },
  1189. { name: '优酷视频', link: 'https://www.soku.com/nt/search/q_' + unititle, selector: 'div.s_intr span.intr_area.c_main' },
  1190. ]
  1191. });
  1192. site_map.push({
  1193. name: "在线正版英文",
  1194. label: [
  1195. { name: 'Amazon', link: 'https://instantwatcher.com/a/search?content_type=1+2&source=1+2+3&q=' + eng_title_clean, selector: `span.title a.title-link:contains(${eng_title_clean})` },
  1196. { name: 'Netflix', link: 'https://unogs.com/?q=' + eng_title_clean, ajax: 'https://flixable.com/?s=' + eng_title_clean, selector: ".card-header.card-header-image" },
  1197. ]
  1198. });
  1199. site_map.push({
  1200. name: "在线中文影视",
  1201. label: [
  1202. { name: '7080影视', link: 'https://7080.wang/so.html?mode=search&wd=' + unititle, ajax: "https://www.39kan.com/api.php/provide/vod/?ac=detail&wd=" + unititle, type: "json", selector: " list.length > 0" },
  1203. ]
  1204. });
  1205. if (has_entitle) {
  1206. site_map.push({
  1207. name: "在线英文影视",
  1208. label: [
  1209. { name: 'UniStream', link: 'https://uniquestream.net/?s=' + eng_title_clean, selector: 'div.result-item div.details' },
  1210. ]
  1211. });
  1212. }
  1213. if (is_anime) {
  1214. site_map.push({
  1215. name: "在线动漫视频",
  1216. label: [
  1217. { name: '9ANIME', link: 'https://9anime.to/search?keyword=' + eng_title, selector: "div.film-list a.name" },
  1218. { name: '爱看番', link: 'http://www.ikanfan.com/search/?wd=' + unititle, selector: '#listvod div.d-info' },
  1219. ]
  1220. });
  1221. }
  1222. if (is_anime) {
  1223. site_map.push({
  1224. name: "动漫国内网站",
  1225. label: [
  1226. { name: 'ACG.RIP', link: 'https://acg.rip/?term=' + unititle, selector: 'tbody tr' },
  1227. { name: 'ACG搜', link: 'https://www.36dm.club/search.php?keyword=' + unititle, selector: 'tbody span.bts_1' },
  1228. { name: 'Mikan', link: 'https://mikanani.me/Home/Search?searchstr=' + unititle, selector: 'table.table.table-striped.tbl-border.fadeIn a.magnet-link-wrap' },
  1229. { name: 'MioBT', link: 'http://www.miobt.com/search.php?keyword=' + unititle, selector: '#data_list tr[class*=alt]' },
  1230. { name: 'VCB-S', link: 'https://vcb-s.com/?s=' + unititle, selector: '#article-list div.title-article' },
  1231. { name: '爱恋动漫', link: 'http://www.kisssub.org/search.php?keyword=' + unititle, selector: 'tbody span.bts_1' },
  1232. { name: '动漫花园', link: 'https://share.dmhy.org/topics/list?keyword=' + unititle, selector: 'tbody span.btl_1' },
  1233. { name: '兜兜动漫网', link: 'http://www.doudoudm.com/Home/Index/search.html?searchText=' + unititle, selector: '#some_drama span.play_some' },
  1234. { name: '漫喵动漫', link: 'http://www.comicat.org/search.php?keyword=' + unititle, selector: '#data_list tr' },
  1235. { name: '漫相随', link: 'http://fodm.net/search.asp?searchword=' + gunititle, selector: 'div.page_content div.intro' },
  1236. { name: "萌番组", method: "post", type: "json", link: "https://bangumi.moe/search/title#search_" + unititle, ajax: "https://bangumi.moe/api/v2/torrent/search", data: `{"query":"${unititle}"}`, headers: { "Content-Type": "text/plain;charset=UTF-8" }, selector: "count > 0" },
  1237. { name: '末日动漫', link: 'https://share.acgnx.se/search.php?sort_id=0&keyword=' + unititle, selector: '#listTable tr[class*=alt]' },
  1238. { name: '魔法少女', link: 'https://www.mahou-shoujo.moe/?s=' + this_title, selector: '#main div.entry-summary' },
  1239. { name: '怡萱动漫', link: 'http://www.yxdm.tv/search.html?title=' + unititle, selector: 'div.main p.stars1' },
  1240. ]
  1241. });
  1242. }
  1243.  
  1244. if (is_anime && eng_title.trim().length > 0) {
  1245. site_map.push({
  1246. name: "动漫国外网站",
  1247. label: [
  1248. { name: 'AniDex', link: 'https://anidex.info/?q=' + eng_title, selector: 'div.table-responsive tr' },
  1249. { name: 'AniRena', link: 'https://www.anirena.com/?s=' + eng_title, selector: '#content table' },
  1250. { name: 'AniTosho', link: 'https://animetosho.org/search?q=' + eng_title, selector: '#content div.home_list_entry' },
  1251. { name: 'Nyaa', link: 'https://nyaa.si/?q=' + eng_title, selector: 'div.table-responsive tr.default' },
  1252. { name: 'ニャパンツ', link: 'https://nyaa.pantsu.cat/search?c=_&q=' + eng_title, selector: '#torrentListResults tr.torrent-info' },
  1253. { name: '东京図书馆', link: 'https://www.tokyotosho.info/search.php?terms=' + eng_title, selector: 'table.listing td.desc-top' },
  1254. ]
  1255. });
  1256. }
  1257. if (is_series && is_europe) {
  1258. site_map.push({
  1259. name: "欧美剧集下载",
  1260. label: [
  1261. { name: 'BT美剧', link: 'http://www.btmeiju.com/ustv_search.htm?title=' + unititle, selector: '#_container div.comm_box' },
  1262. { name: 'EZTV', link: 'https://eztv.ag/search/' + ywm.replace(/S\d+$/g, ''), selector: `td.forum_thread_post > a[title*='${ywm.replace(/S\d+$/g, '')}']` },
  1263. { name: 'KPPT', link: 'http://www.kppt.cc/search.php?q=' + unititle, selector: 'div.search span.SearchAlias' },
  1264. { name: '爱美剧', link: 'https://www.meiju22.com/search.php?searchword=' + unititle, selector: 'div.head h3' },
  1265. { name: '每日美剧', link: 'http://www.meirimeiju.com/search?words=' + unititle, selector: 'div.container div.movie-title' },
  1266. { name: '美剧迷', link: 'http://www.meijumi.vip/index.php?s=' + unititle + ' 下载', selector: `h2.entry-title > a:contains(${unititle})` },
  1267. { name: '美剧天堂', link: 'https://www.meijutt.tv/search/index.asp?searchword=' + gunititle, selector: 'div.list3_cn_box ul.list_20' },
  1268. { name: '人人影视', link: 'http://www.zmz2019.com/search?type=resource&keyword=' + unititle, selector: "div.search-result > ul > li" },
  1269. //{ name: '人人美剧', link: 'http://www.yyetss.com/Search/index/s_keys/' + unititle, selector: 'div.row div.col-xs-3' },
  1270. ]
  1271. });
  1272. }
  1273. if (is_series && is_japan && !is_anime) {
  1274. site_map.push({
  1275. name: "日剧资源下载",
  1276. label: [
  1277. { name: '91日剧', link: 'http://www.wwmulu.com/?s=' + unititle, selector: `h2.entry-title > a:contains(${unititle})` },
  1278. { name: "东京不够热", method: "post", link: "http://www.tokyonothot.com/search.php?mod=portal", data: `srchtxt=${gunititle}&searchsubmit=yes`, headers: { "Content-Type": "application/x-www-form-urlencoded" }, rewrite_href: true, selector: "div.tl li.pbw" },
  1279. { name: '花译工坊', link: 'https://discuss.huayiwork.com/?q=' + unititle, ajax: "https://discuss.huayiwork.com/api/xun/discussions?include=page%5Blimit%5D=3&include=mostRelevantPost&filter%5Bq%5D=" + unititle, type: "json", selector: 'data.length > 0' },
  1280. { name: '心动日剧', link: 'http://www.doki8.com/?s=' + unititle, selector: `h2.post-box-title > a:contains(${unititle})` },
  1281. // { name: '隐社', link: 'http://www.hideystudio.com/drama/' + release_year + drama_season + '.html', selector: `td > span.titles:contains(${unititle})` },
  1282. // { name: '猪猪日部落', link: 'http://www.zzrbl.com/?s=' + unititle, selector: 'div.section_body li' },
  1283. { name: '追新番', method: "post", link: 'http://www.zhuixinfan.com/search.php?searchsubmit=yes', data: `mod=tvplay&formhash=453fc7da&srchtype=title&srhfid=0&srhlocality=main%3A%3Aindex&srchtxt=${unititle}&searchsubmit=true`, headers: { "Content-Type": "application/x-www-form-urlencoded" }, rewrite_href: true, selector: '#wp td.td2' },
  1284. ]
  1285. });
  1286. }
  1287. if (is_series && is_korea && !is_anime) {
  1288. site_map.push({
  1289. name: "韩剧资源下载",
  1290. label: [
  1291. { name: '韩饭网', link: 'http://www.hanfan.cc/?s=下载 ' + unititle, selector: 'div.content p.meta' },
  1292. { name: '韩剧迷', link: 'http://www.aioio.cn/?s=下载 ' + unititle, selector: 'div.content p.meta' },
  1293. { name: '韩流韩剧网', link: 'http://www.hlhanju.com/index.php?s=vod-search-wd-' + unititle, selector: '#find-focus div.play-txt' },
  1294. { name: '韩迷', link: "http://www.hanmi520.com/search.php?mod=forum&searchsubmit=yes&srchtxt=" + unititle, selector: "div.tl li.pbw" },
  1295. ]
  1296. });
  1297. }
  1298. if (is_series && is_thai && !is_anime) {
  1299. site_map.push({
  1300. name: "泰剧资源下载",
  1301. label: [
  1302. { name: '97泰剧网', link: 'http://www.97taiju.com/index.php?s=vod-search&wd=' + unititle, selector: '#vodlist dd.title' },
  1303. { name: '泰剧资料馆', link: 'http://www.taijuzlg.com/?s=泰剧下载 ' + unititle, selector: '#main li.entry-title' },
  1304. ]
  1305. });
  1306. }
  1307. if (is_document) {
  1308. site_map.push({
  1309. name: "纪录片下载站",
  1310. label: [
  1311. { name: '盗火纪录片', link: 'http://www.daofire.com/search/titlesearch?keyword=' + unititle, selector: 'div.videos div.post_title' },
  1312. { name: '纪录片天地', link: 'https://www.bing.com/search?q=site%3Awww.jlpcn.net+intitle%3A' + unititle, selector: '#b_content div.b_title' },
  1313. { name: '熊猫盘纪录', link: 'http://xiongmaopan.com/search/' + unititle, selector: `h2 > a[title*='${unititle}']` },
  1314. ]
  1315. });
  1316. }
  1317. site_map.push({
  1318. name: "电影资源下载",
  1319. label: [
  1320. { name: '66影视网', method: "post", link: 'https://www.66e.cc/e/search/index.php', data: `show=title%2Csmalltext&tempid=1&tbname=Article&keyboard=${gunititle}&submit=`, headers: { "Content-Type": "application/x-www-form-urlencoded" }, rewrite_href: true, selector: "div.listBox li" },
  1321. { name: '6V电影网', method: "post", link: 'http://www.6vhao.tv/e/search/index.php', data: `show=title%2Csmalltext&tempid=1&tbname=Article&keyboard=${gunititle}&Submit22=%E6%90%9C%E7%B4%A2`, headers: { "Content-Type": "application/x-www-form-urlencoded" }, rewrite_href: true, selector: "div.listBox li" },
  1322. { name: 'LOL电影', link: 'http://www.993dy.com/index.php?m=vod-search&wd=' + unititle, selector: '.movielist h5' },
  1323. { name: 'MP4电影', link: 'http://www.domp4.cc/search/' + unititle + '-1.html', selector: `h2 a:contains(${unititle})` },
  1324. { name: 'SOZMZ', link: 'https://v.dsb.ink/#/#search_' + unititle, ajax: "https://v.dsb.ink/getinfo.php?page=1&search=" + unititle, type: "json", selector: 'count > 0' },
  1325. { name: '哔嘀影视', link: 'https://www.btbdys.com/search/' + unititle, selector: 'a.search-movie-title', selector_need_login: ".alert.alert-success p:contains('需要输入验证码')" },
  1326. { name: '电影港', method: "post", link: 'https://www.dygang.cc/e/search/index.php', data: `tempid=1&tbname=article&keyboard=${gunititle}&show=title%2Csmalltext&Submit=%CB%D1%CB%F7`, headers: { "Content-Type": "application/x-www-form-urlencoded" }, rewrite_href: true, selector: "table[width='100%'][border='0'][cellspacing='0'][cellpadding='0'] a.classlinkclass" },
  1327. { name: '电影天堂', method: "post", link: 'https://www.dy2018.com/e/search/index.php', data: `show=title&keyboard=${gunititle}`, headers: { "Content-Type": "application/x-www-form-urlencoded" }, rewrite_href: true, selector: 'b a.ulink' },
  1328. { name: '高清888', link: 'https://www.gaoqing888.com/search?kw=' + unititle, selector: 'div.wp-content div.video-row' },
  1329. { name: '高清电台', link: 'https://gaoqing.fm/s.php?q=' + unititle, selector: '#result1 div.row' },
  1330. ]
  1331. });
  1332.  
  1333. if (!(is_mandarine) || (is_mandarine && is_otherlan)) {
  1334. site_map.push({
  1335. name: "精准中文字幕",
  1336. label: [
  1337. { name: 'OpenSub', link: 'https://www.opensubtitles.org/zh/search/sublanguageid-chi,zht,zhe,eng/imdbid-' + imdb_id, selector: "#search_results tr.change", selector_need_login: "#recaptcha2" },
  1338. ]
  1339. });
  1340. }
  1341. if (!(is_mandarine) || (is_mandarine && is_otherlan)) {
  1342. site_map.push({
  1343. name: "中文影视字幕",
  1344. label: [
  1345. { name: 'A4k字幕', link: 'https://www.a4k.net/search?term=' + unititle, selector: "h3 a" },
  1346. { name: 'Sub HD', link: 'https://subhd.tv/search/' + unititle, selector: ".position-relative .float-start" },
  1347. { name: '伪射手', link: 'http://assrt.net/sub/?searchword=' + unititle, selector: "#resultsdiv a.introtitle" },
  1348. { name: '中文字幕网', link: 'https://cn.zimuzimu.net/so_zimu.htm?q=' + unititle, selector: "table.sublist a.othersub" },
  1349. ]
  1350. });
  1351. }
  1352. if (!(is_mandarine) || (is_mandarine && is_otherlan)) {
  1353. site_map.push({
  1354. name: "英文影视字幕",
  1355. label: [
  1356. { name: 'Addic7ed', link: 'http://www.addic7ed.com/srch.php?search=' + eng_title_clean + year, selector: "table.tabel tr" },
  1357. { name: 'iSubtitles', link: 'https://isubtitles.info/search?kwd=' + ywm, selector: "div.movie-list-info h3" },
  1358. { name: 'Podnapisi', link: 'https://www.podnapisi.net/zh/subtitles/search/?language=zh&language=en&keywords=' + eng_title_clean + '&' + year + '-' + year, selector: "table tr.subtitle-entry" },
  1359. { name: 'Subscene', link: 'https://subscene.com/subtitles/title?q=' + eng_title_clean, selector: "div.search-result div.title", selector_need_login: "h1 span:contains('Checking your browser')" },
  1360. { name: 'TVsubtitles', link: 'http://www.tvsubtitles.net/search.php?q=' + eng_title_clean, selector: "div.left_articles li" },
  1361. { name: 'YIFY', link: 'http://www.yifysubtitles.com/search?q=' + eng_title_clean, selector: "div.col-sm-12 div.col-xs-12" },
  1362. ]
  1363. });
  1364. }
  1365.  
  1366. site_map.push({
  1367. name: "BT国内网站",
  1368. label: [
  1369. { name: 'BT部落', link: 'http://www.btbuluo.net/s/' + unititle + '.html', selector: `h2 a:contains(${unititle})` },
  1370. { name: 'BT之家', link: 'https://www.btbtt12.com/search-index-keyword-' + unititle + '.htm', selector: '#threadlist table' },
  1371. { name: '查片源', link: 'https://www.chapianyuan.com/?keyword=' + unititle, selector: '.block-list li' },
  1372. // { name: 'MVCAT', link: 'http://www.mvcat.com/search/?type=Title,subTitle,Tags&word=' + unititle, selector: 'h3.title' },
  1373. ]
  1374. });
  1375. if (has_imdb) {
  1376. site_map.push({
  1377. name: "BT国外网站",
  1378. label: [
  1379. { name: '1337X', link: 'https://www.1337x.to/search/' + ywm + '/1/', selector: 'table.table-list.table.table-responsive.table-striped td.coll-1.name' },
  1380. //{ name: 'iDope', method: "post", link: 'https://idope.xyz/search-site/', data:`q=${ywm}&x=0&y=0`, headers: { "Content-Type": "application/x-www-form-urlencoded" }, rewrite_href: true, selector: 'div.container div.opt-text-w3layouts' },
  1381. { name: 'Lime', link: 'https://www.limetorrents.to/search/all/' + ywm, selector: 'table.table2 div.tt-name' },
  1382. { name: 'Rutrack影', link: 'http://rutracker.org/forum/search_cse.php?q=' + ywm, ajax: `https://www.google.com/search?q=allintitle:+${ywm}+site:rutracker.org`, selector: `a > h3:contains(${eng_title})` },
  1383. { name: 'TorLock', link: 'https://www.torlock2.com/all/torrents/' + ywm.replace(/ /g, "-") + '.html', selector: 'table.table.table-striped.table-bordered.table-hover.table-condensed td.td' },
  1384. { name: 'YTS', link: 'https://yts.am/browse-movies/' + eng_title, selector: 'div.row div.browse-movie-bottom' },
  1385. { name: 'Кинозал', link: 'http://kinozal.tv/browse.php?s=' + ywm, selector: 'table.t_peer.w100p td.nam' },
  1386. { name: '海盗湾', link: 'https://piratebay.live/search/' + ywm, selector: '#searchResult div.detName' },
  1387. ]
  1388. });
  1389. }
  1390. } else if (location.host === "book.douban.com") {
  1391. let title = $('#wrapper > h1 > span')[0].textContent.replace(/[:\(].*$/, "");
  1392. let original_anchor = $('#info span.pl:contains("原作名")');
  1393. let original = original_anchor[0] ? fetch_anchor(original_anchor) : '';
  1394. let title_eng = title.match(/([a-zA-Z :,\(\)])+/);
  1395. let original_eng = original.match(/([a-zA-Z :,\(\)])+/);
  1396. let ywm = "";
  1397. if (title_eng) {
  1398. ywm = title;
  1399. } else if (original_eng) {
  1400. ywm = original.replace(/[:\(].*$/, "");
  1401. }
  1402. let has_ywm = title_eng + original_eng;
  1403. let stitle = ywm.toLowerCase().replace(/ /g, "-");
  1404. let is_writer = $('#info span.pl:contains("作者")').length > 0;
  1405. let writer = is_writer ? ' ' + $('#info span.pl:contains("作者")')[0].nextSibling.nextSibling.textContent.replace(/\[[^\]]+\]/g, '').replace(/([^)]+)/g, '').replace(/^\s{1,}/g, '') : '';
  1406. let gtitle = _encodeToGb2312(title, true);
  1407. let ptitle = encodeURI(title).replace(/%/g, "%25");
  1408. let isbn_anchor = $('#info span.pl:contains("ISBN")');
  1409. let isbn = isbn_anchor[0] ? fetch_anchor(isbn_anchor) : '';
  1410.  
  1411. // 比较时无视英文名大小写
  1412. jQuery.expr[':'].Contains = function (a, i, m) {
  1413. return jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase()) >= 0;
  1414. };
  1415.  
  1416. function isbn13to10(str) {
  1417. //ISBN 10位和13位码互相转换
  1418. var s;
  1419. var c;
  1420. var checkDigit = 0;
  1421. var result = "";
  1422. s = str.substring(3, str.length);
  1423. for (let i = 10; i > 1; i--) {
  1424. c = s.charAt(10 - i);
  1425. checkDigit += (c - 0) * i;
  1426. result += c;
  1427. }
  1428. checkDigit = (11 - (checkDigit % 11)) % 11;
  1429. result += checkDigit == 10 ? 'X' : (checkDigit + "");
  1430. return (result);
  1431. }
  1432.  
  1433. let isbn10 = isbn13to10(isbn);
  1434.  
  1435. // 当前只对有isbn号的书籍开启中栏评分增强
  1436. if (isbn) {
  1437. let rating_more_hit = false;
  1438. $("div#interest_sectl").append(`<div class='rating_wrap clearbox' id='loading_more_rate'>加载第三方评价信息中.......</div>
  1439. <div class="rating_wrap clearbox rating_amazon_cn" rel="v:rating" style="display:none"></div>
  1440. <div class="rating_wrap clearbox rating_goodreads" style="display:none"></div>`);
  1441.  
  1442. if (GM_getValue("enable_book_amazon.cn_rate", true)) {
  1443. rating_more_hit = true;
  1444. // 通过ISBN信息在亚马逊中国上搜索
  1445. getDoc("https://www.amazon.cn/s/?url=search-alias%3Dstripbooks&field-keywords=" + isbn, null, function (doc) {
  1446. let result_0 = $('div[data-index="0"]', doc);
  1447. if (result_0.length > 0) { // 这本书在亚马逊中国上能搜索到
  1448. let book_id_in_amazon = result_0.attr("data-asin");
  1449. let book_url = "https://www.amazon.cn/dp/" + book_id_in_amazon;
  1450. let vote_text = result_0.text().replace(/\n/g, " ");
  1451.  
  1452. // 这是一个很取巧的获取方式,很可能因为页面结构更改而失效。 最近检查于 2019.09.25
  1453. let _group = vote_text.match(/([\d.]+?) 颗星,最多 5 颗星 +([\d,]+)/);
  1454. if (_group) {
  1455. let _rating = _group[1];
  1456. let _vote = _group[2];
  1457.  
  1458. $('#interest_sectl div.rating_amazon_cn').html(starBlock("亚马逊中国", book_url, _rating, _vote, 5)).show();
  1459. }
  1460. } else {
  1461. $('#interest_sectl div.rating_amazon_cn').append(`<br>搜索亚马逊中国: <a target='_blank' href='${`https://www.amazon.cn/s?k=${encodeURI(title)}&i=stripbooks`}'>${title}</a>`);
  1462. }
  1463. $('#loading_more_rate').hide();
  1464. });
  1465. }
  1466.  
  1467. if (GM_getValue('enable_book_goodreads', false) && GM_getValue('apikey_goodreads', false)) {
  1468. rating_more_hit = true;
  1469. getJSON(`https://www.goodreads.com/book/review_counts.json?key=${GM_getValue('apikey_goodreads', '')}&format=json&isbns=${isbn}`, function (data) {
  1470. try {
  1471. let book = data['books'][0];
  1472.  
  1473. let goodread_id = book['id'];
  1474. let goodread_url = `https://www.goodreads.com/book/show/${goodread_id}`;
  1475. let rating = book['average_rating'];
  1476. let vote = book['work_ratings_count'];
  1477. $('#interest_sectl div.rating_goodreads').html(starBlock("GoodReads", goodread_url, rating, vote, 5)).show();
  1478. } catch (e) {
  1479. $('#interest_sectl div.rating_goodreads').append(`<br>搜索GoodReads: <a target='_blank' href='${`https://www.goodreads.com/search?q=${encodeURI(title)}`}'>${title}</a>`);
  1480. }
  1481. $('#loading_more_rate').hide();
  1482. });
  1483. }
  1484.  
  1485. if (!rating_more_hit) {
  1486. $('#loading_more_rate').hide();
  1487. }
  1488. }
  1489.  
  1490. if (_version === "完整版") {
  1491. site_map.push({
  1492. name: "会员精准匹配",
  1493. label: [
  1494. { name: "mLook©", link: "http://plugin.mlook.mobi/search?q=" + isbn, selector: "div.books div.fl.meta" },
  1495. { name: 'Gold©', link: 'http://goldroom.top/book/search/?q=' + isbn, selector: 'i.glyphicon-download-alt:not(:contains("0"))' },
  1496. { name: 'Z-Lib©', link: 'https://book4you.org/s/?e=1&q=' + isbn, selector: '#searchResultBox div.authors' },
  1497. ]
  1498. });
  1499. site_map.push({
  1500. name: "图书会员网站",
  1501. label: [
  1502. { name: '33文库', link: 'http://www.33file.com/search.php?word=' + title, selector: `table.td_line span.txtred:contains(${title})` },
  1503. { name: 'Bookle', link: `http://www.x5v.net/#search_${title}`, ajax: 'http://www.x5v.net/bsearch', data: `searchType=search&searchText=${title}`, headers: { "Content-Type": "application/x-www-form-urlencoded" }, selector: 'a.book-link' },
  1504. { name: 'Goldroom', link: 'http://goldroom.top/book/search/?q=' + title, selector: 'i.glyphicon-download-alt:not(:contains("0"))' },
  1505. { name: 'IRead', link: 'http://www.iread.cf/?query=' + title, selector: 'li.book-item div.book-info' },
  1506. { name: "Kindle88", link: "http://www.kindle88.com/?s=" + title + writer, selector: "div.widget-content li.archive-thumb" },
  1507. { name: 'iamtxt', method: "post", link: 'https://www.iamtxt.com/e/search/index.php', data: `keyboard=${title}&show=title&tempid=2`, headers: { "Content-Type": "application/x-www-form-urlencoded" }, rewrite_href: true, selector: 'div.sResult div.title' },
  1508. { name: "mLook", link: "http://plugin.mlook.mobi/search?q=" + title, selector: "div.books div.fl.meta" },
  1509. { name: 'rejoice', link: 'http://www.rejoiceblog.com/article/search/page/1/?keyword=' + title, selector: 'div.article a.title' },
  1510. { name: 'Z-Libary', link: 'https://book4you.org/s/?e=1&q=' + title, selector: '#searchResultBox div.authors' },
  1511. { name: 'Zure', link: 'https://zure.fun/book/search/?q=' + title, selector: 'div.item a' },
  1512. { name: "点书网", method: "post", link: "http://www.gezhongshu.com/search.php?mod=forum", data: `srchtxt=${title}${writer}&searchsubmit=yes`, headers: { "Content-Type": "application/x-www-form-urlencoded" }, rewrite_href: true, selector: "div.tl li.pbw" },
  1513. { name: "慧眼看", link: "https://www.huiyankan.com/?s=" + title, selector: `h2.entry-title a:contains(${title})` },
  1514. { name: "精读", link: "https://www.jingdoo.net/?s=" + title, selector: `h3 a[title*='${title}']` },
  1515. { name: "慢慢游书", link: 'https://www.manmanyou.net/search.php?mod=forum&searchsubmit=yes&srchtxt=' + title, selector: "div.tl li.pbw", selector_need_login: "#messagelogin" },
  1516. { name: '偶书', link: 'https://obook.cc/index.php?app=search&ac=s&kw=' + title, selector: 'span.c9 + a' },
  1517. { name: "盘乐网书", link: 'https://www.panle.net/search.php?mod=forum&searchsubmit=yes&srchtxt=' + title, selector: "div.tl li.pbw" },
  1518. { name: "书点点", link: 'https://illumebook.com/?s=' + title, selector: 'a.ss_bt_a' },
  1519. { name: "书行万里", link: 'https://www.gpdf.net/?s=' + title, selector: `h2 a:contains(${title})` },
  1520. { name: "小书虫", link: 'https://www.wq1.net/?s=' + title, selector: `h3 a[title*='${title}']` },
  1521. { name: "星际图书", link: 'http://60.205.213.143:7743/find?q=' + title, selector: `h3.general_result_title a:contains(${title})` },
  1522. { name: "星空好书", link: 'https://www.goodepub.com/?s=' + title, selector: "h2.entry-title" },
  1523. { name: '雅书', method: "post", link: 'https://yabook.blog/e/search/index.php', data: `tbname=news&keyboard=${title}&show=title&tempid=1`, headers: { "Content-Type": "application/x-www-form-urlencoded" }, rewrite_href: true, selector: 'div.main div.postinfo' },
  1524. { name: "掌上书苑", link: 'https://www.soepub.com/search/index/?q=' + title, selector: "div.book-info-title" },
  1525. { name: "知识库", link: 'https://book.zhishikoo.com/?s=' + title, selector: `h3 a[title*='${title}']` },
  1526. ]
  1527. });
  1528. site_map.push({
  1529. name: "图书公众号站",
  1530. label: [
  1531. { name: '519资源网', link: 'https://book.519.best/?key=' + title, selector: 'span.book-name a' },
  1532. { name: 'AiBooks', link: 'https://www.aibooks.cc/search/' + title, selector: `h3 > a[title*='${title}']` },
  1533. { name: 'Kindle吧', link: 'https://www.kindle8.cc/?s=' + title, selector: `h2 > a:contains(${title})` },
  1534. { name: 'NMOD', link: 'https://www.nmod.net/search/' + title, selector: `h3 > a[title*='${title}']` },
  1535. { name: 'SoBooks', link: 'https://sobooks.cc/search/' + title, selector: `h3 > a[title*='${title}'], h1.article-title a` },
  1536. { name: '爱书小站', link: 'https://www.aishuchao.com/?s=' + title, selector: `h2 a:contains(${title})` },
  1537. { name: '电子书基地', link: 'http://www.dzs.so/Book/List?Keyword=' + title, selector: `h5 a:contains(${title})` },
  1538. { name: '读书达人', link: 'http://www.dushudaren.com/?s=' + title, selector: `h2 a:contains(${title})` },
  1539. { name: '读书小站', link: 'https://ibooks.org.cn/?s=' + title, selector: `h3.entry-title a:contains(${title})` },
  1540. { name: '跪读网', link: 'https://orzbooks.com/search.php?q=' + title, selector: `h2 a:contains(${title})` },
  1541. { name: '琳宝书屋', link: 'https://linbaoshuwu.com/search/' + title + '/', selector: `h2 a:contains(${title})` },
  1542. { name: "皮皮书屋", link: 'http://www.pipibook.com/?s=' + title, selector: "div.list-content div.list-body" },
  1543. { name: '书单', link: 'https://ebooklist.mobi/?s=' + title, selector: `h2 > a:contains(${title})` },
  1544. { name: '天浪书屋', link: 'https://www.tianlangbooks.com/?s=' + title, selector: `h3 > a[title*='${title}']` },
  1545. { name: '图书库', link: 'http://www.tbookk.com/?s=' + title, selector: `h2 > a[title*='${title}']` },
  1546. ]
  1547. });
  1548. }
  1549. site_map.push({
  1550. name: "图书在线试读",
  1551. label: [
  1552. { name: '多看阅读', link: `http://www.duokan.com/search/${title}`, selector: `div.wrap > a:contains(${title})` },
  1553. { name: '京东数字', link: `https://s-e.jd.com/Search?enc=utf-8&key=${title}${writer}`, selector: 'div.p-name a' },
  1554. { name: '亚马逊商店', link: 'https://www.amazon.cn/s?i=digital-text&k=' + isbn, selector: 'div.sg-col-inner h2' },
  1555. ]
  1556. });
  1557. site_map.push({
  1558. name: "图书精准匹配",
  1559. label: [
  1560. { name: "EBH", link: "http://ebookhunter.ch/search/?keyword=" + isbn, selector: "#mains_left div.index_box_title.list_title" },
  1561. { name: "LibGen", link: "http://libgen.rs/search.php?column=title&req=" + isbn, selector: "table[rules='rows'] td[width='500']" },
  1562. { name: '科学文库', link: 'http://book.sciencereading.cn/shop/book/Booksimple/list.do?showQueryModel.nameIsbnAuthor=' + isbn, selector: 'div.book_detail_title b.kc_title' },
  1563. { name: '图书馆联盟', link: 'http://book.ucdrs.superlib.net/search?Field=all&channel=search&sw=' + isbn, selector: '#leftcommon + td table.book1' },
  1564. ]
  1565. });
  1566. /** site_map.push({
  1567. name: "图书网盘精准",
  1568. label: [
  1569. { name: 'Downtr❏', link: 'https://downtr.cc/?do=search&subaction=search&story=' + isbn10, selector: '#dle-content div.title', selector_need_login: "h1 span:contains('Checking your browser')" },
  1570. { name: 'FilmSoft❏', link: 'http://filmsofts.com/?do=search&subaction=search&story=' + isbn10, selector: '#dle-content div.story', selector_need_login: "h1 span:contains('Checking your browser')" },
  1571. { name: 'Freshwap❏', link: 'http://www.freshwap.cc/?do=search&subaction=search&story=' + isbn10, selector: '#dle-content div.maincont', selector_need_login: "h1 span:contains('Checking your browser')" },
  1572. { name: 'OneDDL❏', link: 'https://oneddl.org/?do=search&subaction=search&story=' + isbn10, selector: '#dle-content div.con', selector_need_login: "h1 span:contains('Checking your browser')" },
  1573. { name: 'SoftArch❏', link: 'https://sanet.st/search/?category=any&filehosting=any&isbn=' + isbn10, selector: 'div.titles_list_box a.cellMainLink', selector_need_login: "h1 span:contains('Checking your browser')" },
  1574. { name: 'WarezSer❏', link: 'http://warez-serbia.com/index.php?do=search&subaction=search&story=' + isbn10, selector: '#dle-content div.post-info', selector_need_login: "h1 span:contains('Checking your browser')" },
  1575. { name: 'Win7DL❏', link: 'https://win7dl.org/?do=search&subaction=search&story=' + isbn10, selector: '#dle-content td.block_head_2', selector_need_login: "h1 span:contains('Checking your browser')" },
  1576. ]
  1577. }); **/
  1578. site_map.push({
  1579. name: "图书免费网站",
  1580. label: [
  1581. { name: '云搜资源(夸克) ', link: 'https://yunsou.xyz/s/' + unititle, selector: 'ul.DiscussionList-discussions > li[data-id]' },
  1582. { name: 'AQ网盘搜书', link: 'https://wpzy.cc/?q=' + title, ajax: "https://aliyunshare.cn/api/discussions?page%5Blimit%5D=3&include=mostRelevantPost&filter%5Bq%5D=" + title, type: "json", selector: 'data.length > 0' },
  1583. { name: 'LoreFree', link: 'https://ebook2.lorefree.com/site/index?s=' + title, selector: 'div.body-content div.caption.book-content' },
  1584. { name: 'SaltTiger', link: 'https://salttiger.com/?s=' + title, selector: `h1.entry-title > a:contains(${title})` },
  1585. { name: '爱悦读', link: 'https://www.iyd.wang/?s=' + title, selector: `h2.entry-title > a:contains(${title})` },
  1586. { name: '台大图书馆', link: 'http://ebooks.lib.ntu.edu.tw/Home/ListBooks?type=KeywordSearch&h_tag=&pageNumber=1&searchTopic=title&record_per_page=10&send=%E6%9F%A5%E8%A9%A2&keyword=' + title, selector: 'tbody td.content' },
  1587. { name: '中国哲学书', link: 'https://ctext.org/searchbooks.pl?if=gb&remap=gb&searchu=' + title, selector: 'ul.searchres div.ctext' },
  1588. ]
  1589. });
  1590. if (has_ywm) {
  1591. site_map.push({
  1592. name: "图书国外网站",
  1593. label: [
  1594. { name: 'BookFl', link: 'http://en.bookfi.net/s/?e=1&q=' + ywm, selector: `#searchResultBox h3.color1:Contains(${ywm})` },
  1595. { name: 'Booksee', link: 'http://en.booksee.org/s/?e=1&q=' + ywm, selector: `#searchResultBox h3.color1:Contains(${ywm})` },
  1596. { name: 'EPDF', link: 'https://epdf.tips/search/' + ywm, selector: `h3.note-title:Contains(${ywm})` },
  1597. { name: 'PDFDrive', link: 'https://www.pdfdrive.com/search?q=' + ywm, selector: `div.file-right a[href*='${stitle}']` },
  1598. ]
  1599. });
  1600. }
  1601. site_map.push({
  1602. name: "图书网盘搜索",
  1603. label: [
  1604. { name: 'AQ盘搜搜书', link: 'https://wpzy.vip/search/?kw=' + title, ajax: "http://alixiaozhan.com/api/discussions?page%5Blimit%5D=3&include=mostRelevantPost&filter%5Bq%5D=" + title, type: "json", selector: 'data.length > 0' },
  1605. { name: '爱问资料', link: `http://ishare.iask.sina.com.cn/search/home.html?ft=all&cond=${ptitle}`, selector: 'ul.landing-txt-list h4.data-name' },
  1606. { name: '小白盘图书', link: 'http://www.xiaobaipan.com/list-' + title + '.html?order=size', selector: 'h4.job-title a' },
  1607. ]
  1608. });
  1609. site_map.push({
  1610. name: "有声在线试听",
  1611. label: [
  1612. { name: '懒人听书', link: 'https://www.lrts.me/search/book/' + title, selector: 'ul li.book-item' },
  1613. { name: '评书吧', link: 'http://www.pingshu8.com/search/1.asp?keyword=' + gtitle, selector: "table.TableLine div[align='left']" },
  1614. { name: '天方听书网', link: 'https://www.tingbook.com/search/' + title, selector: 'ul.search_result_list h4.clearfix' },
  1615. { name: '中文听书网', link: 'https://www.tingzh.com/search.php?searchword=' + gtitle, selector: 'div.sear_height a.play' },
  1616. { name: '喜马有声', link: 'https://www.ximalaya.com/so/' + title + '/', selector: `div.xm-album-cover__wrapper + a[title*='${title}']` },
  1617. ]
  1618. });
  1619. site_map.push({
  1620. name: "图书有声网站",
  1621. label: [
  1622. { name: 'ABB', link: 'http://audiobookbay.nl/?s=' + title, selector: '#content div.postTitle' },
  1623. ]
  1624. });
  1625. } else if (location.host === "music.douban.com") {
  1626. // 页面元素定位
  1627. let album_anchor = $('#info span.pl:contains("专辑类型")'); //专辑类型
  1628. let medium_anchor = $('#info span.pl:contains("介质")'); //介质
  1629. let album = album_anchor[0] ? fetch_anchor(album_anchor) : '';
  1630. let is_single = album.match(/单曲/);
  1631. let title = $('#wrapper > h1 > span')[0].textContent.split(' ').shift().replace(/[,]/g, " ").replace(/:.*$/, "");
  1632. let gtitle = _encodeToGb2312(title, true);
  1633. let ptitle = encodeURI(title).replace(/%/g, "%25");
  1634. let singer = ' ' + $('#info > span > span.pl > a')[0].textContent;
  1635. let gsinger = _encodeToGb2312(singer, true);
  1636. if (_version === "完整版") {
  1637. site_map.push({
  1638. name: "PT音乐顶配",
  1639. label: [
  1640. { name: "CHDBits♬", link: 'https://chdbits.co/torrents.php?cat406=1&cat408=1&incldead=1&search_area=1&notnewword=1&search=' + title + singer, },
  1641. { name: "CMCT♬", link: "https://hdcmct.org/torrents.php?cat508=1&incldead=1&search_area=1&notnewword=1&search=" + title + singer, },
  1642. { name: "HDChina♬", link: 'https://hdchina.org/torrents.php?cat408=1&incldead=1&search_area=1&notnewword=1&search=' + title + singer, selector: "table.torrent_list:last > tbody > tr:gt(0)" },
  1643. { name: "HDSky♬", link: 'https://hdsky.me/torrents.php?cat408=1&incldead=1&search_area=1&notnewword=1&search=' + title + singer, },
  1644. { name: "MTeam♬", link: 'https://kp.m-team.cc/torrents.php?cat408=1&cat434=1&incldead=1&search_area=1&notnewword=1&search=' + title + singer, },
  1645. { name: "OpenCD♬", link: 'https://open.cd/torrents.php?incldead=1&search_area=0&notnewword=1&search=' + title + singer, selector: "table.torrents:last > tbody > tr:gt(0)" },
  1646. { name: "OurBits♬", link: 'https://ourbits.club/torrents.php?cat=416&incldead=1&search_area=1&notnewword=1&search=' + title + singer, },
  1647. { name: "TTG♬", link: 'https://totheglory.im/browse.php?c=M&notnewword=1&search_field=分类%3A%60无损音乐FLAC%26APE%60+分类%3A%60%28电影原声%26Game%29OST%60 ' + title + singer, selector: "table#torrent_table:last > tbody > tr:gt(0)" },
  1648. { name: "U2♬", link: 'https://u2.dmhy.org/torrents.php?cat30=1&incldead=1&search_area=0&notnewword=1&search=' + title.split(' ')[0], },
  1649. ]
  1650. });
  1651. site_map.push({
  1652. name: "PT音乐标配",
  1653. label: [
  1654. { name: "HDCity♬", link: 'https://hdcity.city/pt?cat408=1&incldead=1&search_area=1&notnewword=1&iwannaseethis=' + title + singer, selector: "center > div > div > div.text" },
  1655. { name: "HDHome♬", link: 'https://hdhome.org/torrents.php?cat439=1&cat440=1&incldead=1&search_area=1&notnewword=1&search=' + title + singer, },
  1656. { name: "HDTime♬", link: 'https://hdtime.org/torrents.php?cat=408&incldead=1&search_area=1&notnewword=1&search=' + title + singer, },
  1657. { name: "JoyHD♬", link: 'https://www.joyhd.net/torrents.php?cat=414&incldead=1&search_area=1&notnewword=1&search=' + title + singer, },
  1658. ]
  1659. });
  1660. site_map.push({
  1661. name: "PT音乐教育",
  1662. label: [
  1663. { name: "NYPT♬", link: 'https://nanyangpt.com/torrents.php?cat407=1&incldead=1&search_area=1&notnewword=1&search=' + title + singer, selector: "table.torrents:last > tbody > tr" },
  1664. { name: "SJTU♬", link: 'https://pt.sjtu.edu.cn/torrents.php?cat420=1&cat421=1&cat422=1&cat423=1&cat425=1&cat426=1&incldead=1&search_area=1&notnewword=1&search=' + title + singer, selector: "table.torrents:last > tbody > tr" },
  1665. ]
  1666. });
  1667. site_map.push({
  1668. name: "PT音乐外站",
  1669. label: [
  1670. { name: "JPOP♬", link: 'https://jpopsuki.eu/torrents.php?searchstr=' + title + singer, selector: "#torrent_table > tbody > tr:gt(0)" },
  1671. { name: "Orpheus♬", link: 'https://orpheus.network/torrents.php?searchstr=' + title + singer, selector: "#torrent_table:last > tbody > tr.group_torrent:gt(0)" },
  1672. { name: "Red♬", link: 'https://redacted.ch/torrents.php?searchstr=' + title + singer, selector: "#torrent_table > tbody > tr.group_torrent:gt(0)" },
  1673. { name: "Waffles♬", link: 'https://waffles.ch/browse.php?q=' + title + singer, selector: "#browsetable:last > tbody > tr:gt(0)" },
  1674. ]
  1675. });
  1676. site_map.push({
  1677. name: "音乐论坛资源",
  1678. label: [
  1679. { name: "AIPT♬", link: 'http://pt.aipt123.org/table_list.php?search_area=1&notnewword=1&search=' + title + singer, },
  1680. { name: "磨坊", method: "post", link: "http://www.moofeel.com/search.php?mod=forum", data: `srchtxt=${gtitle}${gsinger}&searchsubmit=yes`, headers: { "Content-Type": "application/x-www-form-urlencoded" }, rewrite_href: true, selector: "div.tl li.pbw" },
  1681. { name: "无损音乐网", link: 'https://www.so.com/s?q=site%3Awusunyinyue.cn+intitle:' + title + '%26%26' + singer.trim(), selector: 'ul.result li.res-list' },
  1682. { name: "盘乐网音", link: 'https://www.panle.net/search.php?mod=forum&searchsubmit=yes&srchtxt=' + title, selector: "div.tl li.pbw" },
  1683. { name: "炫音音乐", link: `http://so.musicool.cn/cse/search?s=10523158750213826925&q=${title}${singer}`, selector: "#results h3.c-title" },
  1684. ]
  1685. });
  1686. }
  1687. site_map.push({
  1688. name: "在线音乐播放",
  1689. label: [
  1690. { name: 'QQ音乐', link: 'https://y.qq.com/portal/search.html#page=1&searchid=1&remoteplace=txt.yqq.top&t=album&w=' + title + singer, ajax: "https://c.y.qq.com/soso/fcgi-bin/client_search_cp?t=8&format=json&w=" + title + singer, type: "json", selector: 'data.album.totalnum > 0' },
  1691. { name: '百度音乐', link: 'http://music.baidu.com/search/album?key=' + title + singer, selector: '#album_list div.album-info' },
  1692. { name: '酷我音乐', link: 'http://sou.kuwo.cn/ws/NSearch?type=album&key=' + title + singer, selector: 'div.album p.musicName' },
  1693. { name: '咪咕音乐', link: `http://music.migu.cn/v2/search?type=album&keyword=${title}${singer}`, selector: `div.album-name font:contains(${title})` },
  1694. { name: '虾米音乐', link: `https://www.xiami.com/search/album/?key=${title}${singer}`, selector: `p.name > a[title='${title}'] + a[title='${singer.trim()}']` },
  1695. { name: '网易云音乐', link: 'https://music.163.com/#/search/m/?type=10&s=' + title + singer, ajax: "https://api.imjad.cn/cloudmusic/?type=search&s=" + title + singer, type: "json", selector: 'result.songCount > 0' },
  1696. ]
  1697. });
  1698. if (is_single) {
  1699. site_map.push({
  1700. name: "单曲无损网站",
  1701. label: [
  1702. { name: '51Ape', link: 'https://www.bing.com/search?q=site%3Awww.51ape.com+intitle%3A' + title + '+intitle%3A' + singer, selector: '#b_content div.b_caption' },
  1703. ]
  1704. });
  1705. }
  1706. site_map.push({
  1707. name: "音乐免费网站",
  1708. label: [
  1709. { name: 'DTShot', link: 'http://www.dtshot.com/search/' + title + singer + '/', selector: `div.case_info div.meta-title:contains(${title})` },
  1710. { name: 'XZPC音乐', method: "post", link: 'http://www.xzpc6.com/#search_' + title, ajax: 'http://www.xzpc6.com/sou.php', data: `key=${title}`, headers: { "Content-Type": "application/x-www-form-urlencoded" }, selector: 'p a' },
  1711. { name: '爱无损', link: 'http://www.lovewusun.com/?s=' + title + singer, selector: '#main h2.entry-title' },
  1712. { name: '小浣熊音乐', link: `https://www.xiaohx.org/search?cat=5&key=${title}${singer}`, selector: `div.result_p a[title*='${title}']` },
  1713. ]
  1714. });
  1715. site_map.push({
  1716. name: "音乐国内网盘",
  1717. label: [
  1718. { name: 'AQ网盘音乐', link: 'https://wpzy.cc/?q=' + title , selector: 'h4.job-title a' },
  1719. { name: 'AQ盘搜音乐', link: 'https://wpzy.vip/search/?kw=' + title , selector: 'h4.job-title a' },
  1720. { name: '小白盘音乐', link: 'http://www.xiaobaipan.com/list-' + title + '.html?order=size', selector: 'h4.job-title a' },
  1721. ]
  1722. });
  1723. site_map.push({
  1724. name: "音乐国外网盘",
  1725. label: [
  1726. { name: 'AvaxHome♬', link: 'https://tavaz.xyz/search/?category_slug=music&query=' + title + singer, selector: 'div.col-xs-12.col-sm-8.col-md-8.col-lg-8 div.panel-heading' },
  1727. { name: 'Rutrack♬', link: 'http://rutracker.org/forum/search_cse.php?q=' + title, ajax: `https://www.google.com/search?q=allintitle:+${title}+site:rutracker.org`, selector: '`a > h3:contains(${title})`' },
  1728. ]
  1729. });
  1730. }
  1731.  
  1732. // 检查站点是否需要登陆的方法 res 应该是GM_xmlhttpRequests返回对象 ,返回bool值,true时为需要登陆
  1733. function login_check(res) {
  1734. let need_login = false;
  1735. if (/login|verify|checkpoint|returnto/ig.test(res.finalUrl)) {
  1736. need_login = true; // 检查最终的URL看是不是需要登陆
  1737. } else if (/refresh: \d+; url=.+login.+/ig.test(res.responseHeaders)) {
  1738. need_login = true; // 检查responseHeader有没有重定向
  1739. } else {
  1740. let responseText = res.responseText;
  1741. if (typeof responseText === "undefined") {
  1742. need_login = true; // 检查最终的Text,如果什么都没有也可能说明需要登陆
  1743. } else if (responseText.length < 800 && /login|not authorized/.test(responseText)) {
  1744. need_login = true; // 对Text进行检查,断言“过短,且中间出现login字段”即说明可能需要登陆
  1745. }
  1746. }
  1747. return need_login;
  1748. }
  1749.  
  1750. function Exist_check(label) {
  1751. let site = label.name;
  1752. let psite = $(`a[data-name="${site}"]`);
  1753.  
  1754. function HideTag() {
  1755. if (GM_getValue('enable_adv_auto_hide', false)) {
  1756. $(psite).hide();
  1757. }
  1758. }
  1759.  
  1760. function TagExist(link) {
  1761. $(psite).css("background-color", GM_getValue("tag_bcolor_exist", "#e3f1ed"));
  1762. $(psite).css("color", GM_getValue("tag_fcolor_exist", "#3377aa"));
  1763. $(psite).attr("title", "点击进入");
  1764. let storage_data = true;
  1765. if (label.rewrite_href && label.rewrite_href === true) { // 重写链接
  1766. storage_data = cache.get(site, link || $(psite).attr("href"));
  1767. $(psite).attr("href", storage_data);
  1768. }
  1769. cache.add(site, storage_data);
  1770. }
  1771.  
  1772. function TagNotExist() {
  1773. $(psite).css("background-color", GM_getValue("tag_bcolor_not_exist", "#f4eac2"));
  1774. $(psite).css("color", GM_getValue("tag_fcolor_not_exist", "#3377aa"));
  1775. $(psite).attr("title", "点击进入");
  1776. HideTag();
  1777. }
  1778.  
  1779. function TagNeedLogin() {
  1780. $(psite).css("background-color", GM_getValue("tag_bcolor_need_login", ""));
  1781. $(psite).css("color", GM_getValue("tag_fcolor_need_login", "#3377aa"));
  1782. need_login_cache.add(site, true);
  1783. $(psite).click(function () {
  1784. need_login_cache.del(site);
  1785. });
  1786. $(psite).attr("title", "站点需要登陆");
  1787. HideTag();
  1788. }
  1789.  
  1790. function TagError(errtype) {
  1791. $(psite).css("background-color", GM_getValue("tag_bcolor_error", ""));
  1792. $(psite).css("color", GM_getValue("tag_fcolor_error", "#3377aa"));
  1793. $(psite).attr("title", "遇到问题" + (errtype ? (" - " + errtype) : ""));
  1794. HideTag();
  1795. }
  1796.  
  1797. // 这里假定有这个资源的就一直都有,直接使用第一次请求成功的时候缓存信息
  1798. if (cache.get(site)) { TagExist(); return; }
  1799.  
  1800. // 如果前次检查到这个站点需要登陆
  1801. if (need_login_cache.get(site)) { TagNeedLogin(); return; }
  1802.  
  1803. // 不然,则请求相关信息
  1804.  
  1805. // 重写请求参数
  1806. //if (typeof label.data === "object") {
  1807. // let myData = new FormData();
  1808. // for (let k in label.data) {
  1809. // myData.append(k,label.data.k);
  1810. // }
  1811. // label.data = myData;
  1812. //}
  1813.  
  1814. // 请求核心方法
  1815. function check_core(label) {
  1816. GM_xmlhttpRequest({
  1817. method: label.method || "GET",
  1818. url: label.ajax || label.link,
  1819. data: label.data,
  1820. headers: label.headers,
  1821. timeout: 45e3, // 默认45s服务器无响应算超时
  1822. onload: function (res) {
  1823. if (login_check(res)) {
  1824. TagNeedLogin();
  1825. } else {
  1826. try { // 开始解析返回信息
  1827. let responseText = res.responseText;
  1828. if (label.type && ["json", "jsonp"].includes(label.type)) { // 如果前面定义了返回类型是"json'或者"jsonp"
  1829. if (label.type === "jsonp") {
  1830. responseText = responseText.match(/[^(]+\((.+)\)/)[1];
  1831. }
  1832. let par = JSON.parse(responseText);
  1833. if (eval("par." + label.selector)) {
  1834. TagExist();
  1835. } else {
  1836. TagNotExist(); // 所有情况都失败则未存在
  1837. }
  1838. } else { // 否则默认label.type的默认值为 html
  1839. let doc = page_parser(res.responseText);
  1840. let body = doc.querySelector("body");
  1841. // 因为jQuery的选择器丰富,故这里不用 dom.querySelector() 而用 jQuery.find()
  1842. if (label.selector_need_login && $(body).find(label.selector_need_login).length) {
  1843. TagNeedLogin(); // 如果存在selector_need_login选择器,则先判断是否存在以确定是否需要登录(不可用)
  1844. } else if ($(body).find(label.selector || "table.torrents:last > tbody > tr:gt(0)").length) {
  1845. TagExist(res.finalUrl); // 最后使用selector选择器判断资源是否存在
  1846. } else {
  1847. TagNotExist(); // 所有情况都失败则未存在
  1848. }
  1849. }
  1850. } catch (e) {
  1851. TagError("解析错误");
  1852. }
  1853. }
  1854. },
  1855. onerror: function () { TagError("请求故障"); },
  1856. ontimeout: function () { TagError("请求超时"); },
  1857. });
  1858. }
  1859.  
  1860. // 请求动作方法
  1861. function check_func() {
  1862. $(psite).attr("title", "正在请求信息中");
  1863. if (label.csrf) { // 对某些启用了csrf的站点,先使用正常方式请求一次获取csrf值
  1864. GM_xmlhttpRequest({
  1865. method: "GET",
  1866. url: label.link,
  1867. timeout: 45e3, // 默认45s服务器无响应算超时
  1868. onload: function (res) {
  1869. if (!login_check(res)) {
  1870. try {
  1871. let doc = page_parser(res.responseText);
  1872. let csrf_ = $(`input[name='${label.csrf.name}'`, doc);
  1873. let csrf_key = csrf_.attr("value"); // 获取csrf值
  1874. label[label.csrf.update] += `&${label.csrf.name}=${csrf_key}`; // 更新对应选项
  1875. check_core(label);
  1876. } catch (e) {
  1877. TagError("解析故障");
  1878. }
  1879. }
  1880. },
  1881. onerror: function () { TagError("请求错误"); },
  1882. ontimeout: function () { TagError("请求超时"); },
  1883. });
  1884. } else {
  1885. check_core(label);
  1886. }
  1887. }
  1888.  
  1889. // 根据设置,是自动请求还是鼠标移动时在做请求
  1890. if (GM_getValue("enable_adv_auto_search", true)) {
  1891. check_func();
  1892. } else {
  1893. $(psite).mouseenter(function (e) { // 鼠标进入时才自动搜索并反馈
  1894. if ($(psite).attr('title') == 'empty') { // 防止重复请求
  1895. check_func();
  1896. $(psite).unbind('mouseenter');
  1897. }
  1898. });
  1899. }
  1900. }
  1901.  
  1902. function site_exist_status() {
  1903. $("#drdm_req_status").show();
  1904. for (let i = 0; i < site_map.length; i++) {
  1905. let map_dic = site_map[i];
  1906. if (GM_getValue(delete_site_prefix + map_dic.name, false)) {
  1907. continue;
  1908. }
  1909. $('#drdm_sites').append(`<div class="c-aside name-offline" data-id="${i}"><h2><i>${map_dic.name}</i>· · · · · ·</h2><div class=c-aside-body style="padding: 0 12px;"> <ul class=bs > </ul> </div> </div>`);
  1910.  
  1911. let in_site_html = $(`div[data-id='${i}'] ul.bs`);
  1912. for (let j = 0; j < map_dic.label.length; j++) {
  1913. let label = map_dic.label[j];
  1914. if (GM_getValue(delete_site_prefix + label.name, false)) {
  1915. continue;
  1916. }
  1917. in_site_html.append(`<a href="${label.link}" data-name="${label.name}" target="_blank" rel="nofollow" class="name-offline" title="empty">${label.name}</a>`);
  1918. Exist_check(label);
  1919.  
  1920. }
  1921. }
  1922.  
  1923. update_status_interval = window.setInterval(update_req_status, 1e3);
  1924.  
  1925. if (!GM_getValue("enable_adv_auto_search", true)) {
  1926. $("#drdm_req_status_hide").click();
  1927. }
  1928. }
  1929. site_exist_status();
  1930. }
  1931.  
  1932. // 脚本页面切换方法
  1933. function wrapper_change(id, html, callback) {
  1934. if ($(`div#wrapper > div#${id}`).length === 0) {
  1935. $('div#wrapper').append(html);
  1936. if (typeof callback === "function") {
  1937. callback();
  1938. }
  1939. }
  1940. let ele_inst = $(`div#wrapper > div#${id}`);
  1941. let ele_other = $(`div#wrapper > div#content, div#footer`);
  1942. if (ele_other.is(':visible')) {
  1943. ele_other.hide(); ele_inst.show();
  1944. } else {
  1945. ele_other.show(); ele_inst.hide();
  1946. }
  1947. }
  1948.  
  1949. // 加载豆列搜索
  1950. if (GM_getValue("enable_doulist_search", true)) {
  1951. GM_addStyle('#db-nav-movie a.movieannual {margin-left: 350px !important;}');
  1952. $('div.nav-items ul').append('<li><a id="search_dlist" href="javascript:void(0);">豆列搜索</a></li>');
  1953. $("#search_dlist").click(function () {
  1954. let int_html = `<div id='drdm_doulist'><h1>豆列搜索</h1><div class="grid-16-8 clearfix"><div class="article"><div class="indent"><div class="movie-list"></div><a class="more" href="javascript:;" style="display:none">加载更多</a></div></div><div class="aside"><div><h2>豆列搜索 · · · · · ·</h2><div><span><p><div id="form-doulist"><input class="doulist" id="input-doulist" placeholder="Criterion, 46534919, ..." value=""</input><input type="submit" id="doulist-submit" value="search" /input></div></p></span><span style="" class="search_result c-aside-body"></span></div></div><div class="doulist_intro"><h2>豆列搜索说明 · · · · · ·</h2><p>输入你想搜的关键词,点击搜索。就这么简单。</p></div></div></div></div>`;
  1955. wrapper_change("drdm_doulist", int_html, function () {
  1956. let load_more = $("#drdm_doulist a.more");
  1957. $('#doulist-submit').click(function () {
  1958. let doulist = $("#input-doulist").val();
  1959. $('div.movie-list').html("");
  1960. let get_doulist = function (doulist, page) {
  1961. load_more.text("加载中......").show();
  1962. getDoc('https://cn.bing.com/search?q=site%3awww.douban.com%2fdoulist+' + doulist + '&first=' + page, null, function (doc, res, meta) {
  1963. let result = $('ol#b_results .b_algo', doc);
  1964. result = result.filter(function () {
  1965. return $("a[href^='https://www.douban.com/doulist/']", this).length > 0;
  1966. });
  1967. if (result.length === 0) {
  1968. load_more.text('没有找到相关豆列');
  1969. }
  1970. else {
  1971. result.each(function () {
  1972. let title = $(this).find("a[href^='https://www.douban.com/doulist/']");
  1973. let caption = $(this).find("div.b_caption");
  1974.  
  1975. let id = title.attr("href").match(/doulist\/(\d+)/)[1];
  1976. let title_clean = title.text().replace(/(\(豆瓣\)|\s-\s豆瓣电影|\s-\s豆瓣)/, '').replace(/ - douban.com/, '');
  1977. caption.find("div.b_attribution").remove();
  1978. let detail = caption.html();
  1979.  
  1980. if ($(`div.movie-list > div[data-dlist=${id}]`).length === 0) { // 重复的不再插入
  1981. $('div.movie-list').append(`<div data-dlist="${id}"><div><h2 style="font-size:13px;"><a href="https://www.douban.com/doulist/${id}" target="_blank">${title_clean}</a></h2><div></div></div><div class="tags">${detail}<p class="ul"></p></div></div>`);
  1982. }
  1983. });
  1984.  
  1985. // 更新加载信息
  1986. let load_id = page + 10;
  1987. load_more.text('加载更多');
  1988. load_more.one("click", function () {
  1989. get_doulist(doulist, load_id);
  1990. });
  1991. }
  1992. });
  1993. }
  1994. get_doulist(doulist, 1);
  1995. });
  1996. });
  1997. });
  1998. }
  1999.  
  2000.  
  2001. // 脚本设置
  2002. $("#db-global-nav > div > div.top-nav-info").append(`<a href="javascript:;" id="drdm_setting_btn">脚本设置</a>`);
  2003. $("#drdm_setting_btn").click(function () {
  2004. let int_html = `<div id='drdm_setting'><h2>脚本设置界面正在开发中,请等待完善......</h2></div>`;
  2005. wrapper_change("drdm_setting", int_html, function () {
  2006. // TODO 评分信息,豆列搜索等杂项功能启用情况
  2007. let config_setting = "<h1>脚本基本功能启用状况</h1><dl class='drdm-dl-horizontal'>";
  2008.  
  2009. function config_setting_gen(name, key, note, def = true) {
  2010. config_setting += `<dt>${name}</dt><dd><input type="checkbox" id="drdm_config_${key}" ${GM_getValue(key, def) ? 'checked' : ''} data-config="${key}"><label for="drdm_config_${key}"></label> ${note} </dd>`;
  2011. }
  2012.  
  2013. config_setting_gen("额外样式", "enable_extra_stylesheet", "注入一些额外的CSS样式屏蔽豆瓣广告等(注意:这会隐藏豆瓣自带的观影渠道)", true);
  2014. config_setting_gen("豆列搜索", "enable_doulist_search", "对豆列进行搜索(通过 \`cn.bing.com\` 搜索)");
  2015. config_setting_gen("电影简介生成", "enable_mediainfo_gen", "生成符合PT站点电影简介信息(Mediainfogen格式)", false);
  2016. config_setting_gen("各类排行榜", "enable_top_rang_tag", `显示来自 <a href="https://github.com/bimzcy/rank4douban">bimzcy/rank4douban</a> 的各种排行榜`);
  2017. config_setting_gen("启用全站自动搜索", "enable_adv_auto_search", "启用可让脚本自动搜索全部站点(会消耗CPU及网络资源),不启用则仅当鼠标移至对应站点时搜索");
  2018. config_setting_gen("搜索完成后隐藏提示条", "enalbe_adv_auto_tip_hide", "搜索结束后自动隐藏搜索情况提示条,默认关闭且不建议开启", false);
  2019. config_setting_gen("展示IMDB增强信息", "enable_imdb_ext_info", "展示制片成本、本国首周票房、北美首周票房、总票房等来自IMDb的影片增强信息");
  2020. config_setting_gen("烂番茄评分", "enable_tomato_rate", "展示烂番茄评分信息");
  2021. config_setting_gen("动漫评分", "enable_anime_rate", "展示动漫影视的AniDB、Bgm、Mal等评分");
  2022. config_setting_gen("蓝光发售日", "enable_blue_date", "展示蓝光的发售日期(来自IMDb)");
  2023. config_setting_gen("亚马逊图书评分", "enable_book_amazon.cn_rate", `展示在<a href="https://www.amazon.cn/" target="_blank">亚马逊中国</a> 上有对应ISBN信息的图书评分信息`);
  2024. config_setting_gen("GoodReads图书评分", "enable_book_goodreads", `展示在 <a href="https://www.goodreads.com" target="_blank">GoodReads</a> 上有对应ISBN信息的图书评分信息,设置你的APIKEY: <input id='drdm_setting_apikey_goodreads' type='text' value='${GM_getValue('apikey_goodreads', '')}'></input> (<a href='//blog.rhilip.info/archives/1124/' target='_blank'>说明</a>)`, false);
  2025.  
  2026. config_setting += `</dl><br>`;
  2027.  
  2028. // 构造站点启用信息
  2029. let setting_site = "<h1>搜索站点启用情况(在当前页面条件下)</h1>";
  2030. for (let i = 0; i < site_map.length; i++) {
  2031. let map_dic = site_map[i];
  2032. setting_site += `<div><h2>${map_dic.name} <input type="checkbox" id="${'drdm_config_site_' + map_dic.name}" ${GM_getValue(delete_site_prefix + map_dic.name, false) ? '' : 'checked'} data-config="${delete_site_prefix + map_dic.name}" data-par="${map_dic.name}" data-type="map"><label for="${'drdm_config_site_' + map_dic.name}"></label></h2><table><tbody><tr>`;
  2033. for (let j = 0; j < map_dic.label.length; j++) {
  2034. let label = map_dic.label[j];
  2035. setting_site += `<td style="text-align:right;"><span>${label.name}</span><input type="checkbox" id="${'drdm_config_site_' + label.name}" ${GM_getValue(delete_site_prefix + map_dic.name, false) || GM_getValue(delete_site_prefix + label.name, false) ? '' : 'checked'} ${GM_getValue(delete_site_prefix + map_dic.name, false) ? 'disabled' : ''} data-config="${delete_site_prefix + label.name}" data-par="${map_dic.name}" data-type="site"><label for="${'drdm_config_site_' + label.name}"></label></td>`;
  2036. if ((j + 1) % 7 === 0) {
  2037. setting_site += '</tr><tr>';
  2038. }
  2039. }
  2040. setting_site += "</tbody></table></div><hr>";
  2041. }
  2042. $("#drdm_setting").append(config_setting + setting_site);
  2043. $("input[id^='drdm_config_']").click(function () {
  2044. let that = $(this);
  2045. GM_setValue(that.attr("data-config"), that.attr("data-config").match(delete_site_prefix) ? !that.prop("checked") : that.prop("checked"));
  2046. if (that.attr("data-type") && that.attr("data-type") === "map") {
  2047. let par = that.attr("data-par");
  2048. $(`input[id^='drdm_config_site_'][data-type='site'][data-par='${par}']`).prop("disabled", !that.prop("checked")).prop("checked", that.prop("checked"));
  2049. }
  2050. });
  2051.  
  2052. // 其他回调
  2053. $('input#drdm_setting_apikey_goodreads').on('input change', function () {
  2054. let that = $(this);
  2055. GM_setValue('apikey_goodreads', that.val());
  2056. });
  2057. });
  2058. });
  2059. });

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址