Greasy Fork is available in English.

douban-info-for-pt

在PT站电影详情页展示部分中文信息

Инсталирай този скрипт?
Препоръчано от автора

Може да харесате и EasyUpload PT一键转种.

Инсталирай този скрипт
  1. // ==UserScript==
  2. // @name douban-info-for-pt
  3. // @namespace https://github.com/techmovie/DouBan-Info-for-PT
  4. // @version 1.7.6
  5. // @description 在PT站电影详情页展示部分中文信息
  6. // @author birdplane
  7. // @require https://s4.zstatic.net/ajax/libs/jquery/1.7.1/jquery.min.js
  8. // @match *://passthepopcorn.me/torrents.php?id=*
  9. // @match *://passthepopcorn.me/requests.php?action=view&id=*
  10. // @match *://anthelion.me/torrents.php?id=*
  11. // @match *://anthelion.me/requests.php?action=view&id=*
  12. // @match *://beyond-hd.me/torrents/*
  13. // @match *://beyond-hd.me/library/title/*
  14. // @match *://blutopia.xyz/torrents/*
  15. // @match *://asiancinema.me/torrents/*
  16. // @match *://hdbits.org/details.php?id=*
  17. // @match *://hdbits.org/requests/show_request?id=*
  18. // @match *://uhdbits.org/torrents.php?id=*
  19. // @match *://filelist.io/details.php?id=*
  20. // @match *://hd-torrents.org/details.php?id=*
  21. // @match *://karagarga.in/details.php?id=*
  22. // @match *://privatehd.to/torrent/*
  23. // @match *://broadcasthe.net/series.php?id=*
  24. // @match *://iptorrents.com/torrent.php?id=*
  25. // @match *://www.iptorrents.com/torrent.php?id=*
  26. // @match *://www.torrentleech.org/torrent/*
  27. // @match *://avistaz.to/torrent/*
  28. // @match *://secret-cinema.pw/torrents.php?id=*
  29. // @match *://aither.cc/torrents/*
  30. // @match *://shadowthein.net/details.php?id=*
  31. // @match *://shadowthein.net/details.php?id=*
  32. // @match *://baconbits.org/torrents.php?id=*
  33. // @match *://broadcity.in/details.php?id=*
  34. // @match *://www.morethantv.me/torrents.php?id=*
  35. // @match *://www.morethantv.me/show/*
  36. // @match *://tgx.rs/torrent/*
  37. // @grant GM_addStyle
  38. // @grant GM_xmlhttpRequest
  39. // @grant GM_openInTab
  40. // @grant GM_getValue
  41. // @grant GM_setValue
  42. // @license MIT
  43. // ==/UserScript==
  44. (() => {
  45. var __assign = Object.assign;
  46.  
  47. // src/config.json
  48. var PT_SITE = {
  49. "aither.cc": {
  50. url: "https://aither.cc",
  51. host: "aither.cc",
  52. siteName: "Aither",
  53. poster: "#meta-poster",
  54. imdb: '.badge-user a[href*="imdb.com/title"]:nth-child(1)',
  55. insertDomSelector: ".torrent-buttons",
  56. doubanContainerDom: '<div class="movie-wrapper"><div class="movie-overlay" style="background-color: rgba(81, 51, 40, 0.75);"></div><div class="douban-dom" style="position: relative;z-index: 2;"></div></div>'
  57. },
  58. "anthelion.me": {
  59. url: "https://anthelion.me",
  60. host: "anthelion.me",
  61. siteName: "ANT",
  62. siteType: "gazelle",
  63. imdb: {
  64. request: '.layout a[href*="imdb.com/title"]:first',
  65. torrent: '.torrent_ratings a[href*="imdb.com/title"]:first'
  66. }
  67. },
  68. "asiancinema.me": {
  69. url: "https://asiancinema.me",
  70. host: "asiancinema.me",
  71. siteName: "ACM",
  72. poster: "img.movie-poster",
  73. imdb: '.badge-user a[href*="imdb.com/title"]:nth-child(1)',
  74. insertDomSelector: "#vue",
  75. doubanContainerDom: '<div class="douban-dom" style="width: 1100px;"></div>'
  76. },
  77. "avistaz.to": {
  78. url: "https://avistaz.to",
  79. host: "avistaz.to",
  80. siteName: "AvistaZ",
  81. imdb: '.movie-details .badge-extra a[href*="imdb.com/title"]:first',
  82. titleDom: ".title .torrent-filename",
  83. poster: ".movie-poster img",
  84. insertDomSelector: ".movie-poster",
  85. doubanContainerDom: '<div class="douban-dom" style="justify-content: flex-start;"></div>'
  86. },
  87. "baconbits.org": {
  88. url: "https://baconbits.org",
  89. host: "baconbits.org",
  90. siteName: "bB",
  91. imdb: '.box .body a[href*="imdb.com/title"]:first',
  92. insertDomSelector: ".linkbox:first",
  93. titleDom: "h1:first",
  94. doubanContainerDom: '<div class="douban-dom bb"></div>'
  95. },
  96. "beyond-hd.me": {
  97. url: "https://beyond-hd.me",
  98. host: "beyond-hd.me",
  99. siteName: "BHD",
  100. imdb: '.movie-details a[href*="imdb.com/title"]:nth-child(1)',
  101. insertDomSelector: ".movie-wrapper",
  102. doubanContainerDom: '<div class="douban-dom bhd"></div>'
  103. },
  104. "blutopia.xyz": {
  105. url: "https://blutopia.xyz",
  106. host: "blutopia.xyz",
  107. siteName: "BLU",
  108. poster: "#meta-poster",
  109. imdb: '.badge-user a[href*="imdb.com/title"]:nth-child(1)',
  110. insertDomSelector: ".torrent-buttons",
  111. doubanContainerDom: '<div class="movie-wrapper"><div class="movie-overlay" style="background-color: rgba(81, 51, 40, 0.75);"></div><div class="douban-dom" style="position: relative;z-index: 2;"></div></div>'
  112. },
  113. "broadcasthe.net": {
  114. url: "https://broadcasthe.net",
  115. host: "broadcasthe.net",
  116. siteName: "BTN",
  117. imdb: '.stats td a[href*="imdb.com/title"]',
  118. insertDomSelector: "#content .linkbox",
  119. poster: ".sidebar .box img:first",
  120. doubanContainerDom: '<div class="douban-dom btn" style="display:flex;justify-content: center;width: 850px;margin-left: -20px;"></div>'
  121. },
  122. "broadcity.in": {
  123. url: "https://broadcity.in",
  124. host: "broadcity.in",
  125. siteName: "Bdc",
  126. imdb: '#imdbdetails a[href*="imdb.com/title"]',
  127. titleDom: "#details>table>tbody>tr:first",
  128. insertDomSelector: "#imdbdetails",
  129. poster: "#ts_show_preview img",
  130. doubanContainerDom: '<div class="douban-dom bdc" style="display:flex;justify-content: center;"></div>'
  131. },
  132. "filelist.io": {
  133. url: "https://filelist.io",
  134. host: "filelist.io",
  135. siteName: "FL",
  136. imdb: '.cblock-innercontent div a[href*="imdb.com/title"]:first',
  137. poster: 'img[width="300px"][src*="image.tmdb.org"]',
  138. titleDom: ".cblock-header h4",
  139. insertDomSelector: ".cblock-innercontent hr.separator:first",
  140. doubanContainerDom: '<div class="douban-dom" style="width: 100%;padding-top:20px;"></div>'
  141. },
  142. "hd-torrents.org": {
  143. url: "https://hd-torrents.org",
  144. host: "hd-torrents.org",
  145. siteName: "HDT",
  146. poster: "#IMDBDetailsInfoHideShowTR .imdbnew a img",
  147. imdb: '.imdbnew2 a[href*="imdb.com/title"]:first',
  148. insertDomSelector: "td.detailsleft:contains(IMDb)",
  149. doubanContainerDom: '<tr><td align="left" class="detailsleft">\u8C46\u74E3</td><td valign="top" align="left" class="detailshash douban-dom hdt"></td></tr>'
  150. },
  151. "hdbits.org": {
  152. url: "https://hdbits.org",
  153. host: "hdbits.org",
  154. siteName: "HDB",
  155. imdb: {
  156. movie: ".contentlayout h1 a",
  157. tv: "#details .showlinks li:nth-child(2) a",
  158. tvRequest: ".lottery_table2 .showlinks li:nth-child(2) a"
  159. },
  160. titleDom: "h1:first",
  161. insertDomSelector: "#details>tbody>tr:nth-child(2),.lottery_table2>tbody>tr:nth-child(1)",
  162. doubanContainerDom: '<tr><td><div id="l7829483" class="label collapsable" onclick="showHideEl(7829483);(7829483)"><span class="plusminus">- </span>\u8C46\u74E3\u4FE1\u606F</div><div id="c7829483" class="hideablecontent" ><div class="contentlayout douban-dom hdb"></div></td></tr>'
  163. },
  164. "iptorrents.com": {
  165. url: "https://iptorrents.com",
  166. host: "iptorrents.com",
  167. siteName: "IPT",
  168. imdb: '.main td a[href*="imdb.com/title"]',
  169. titleDom: ".dBox h1",
  170. insertDomSelector: ".dBox .info",
  171. doubanContainerDom: '<div class="douban-dom" style="display:flex;justify-content: center;"></div>'
  172. },
  173. "karagarga.in": {
  174. url: "https://karagarga.in",
  175. host: "karagarga.in",
  176. siteName: "KG",
  177. imdb: 'td a[href*="imdb.com/title"]:first',
  178. insertDomSelector: ".outer h1~table:first",
  179. doubanContainerDom: '<div class="douban-dom kg" style="width:1100px;padding-top:20px;"></div>'
  180. },
  181. "passthepopcorn.me": {
  182. url: "https://passthepopcorn.me",
  183. host: "passthepopcorn.me",
  184. siteName: "PTP",
  185. siteType: "gazelle",
  186. imdb: {
  187. request: '#request-table a[href*="imdb.com/title"]:first',
  188. torrent: "#imdb-title-link"
  189. }
  190. },
  191. "privatehd.to": {
  192. url: "https://privatehd.to",
  193. host: "privatehd.to",
  194. siteName: "PHD",
  195. imdb: '.movie-details .badge-extra a[href*="imdb.com/title"]:first',
  196. titleDom: ".title .torrent-filename",
  197. poster: ".movie-poster img",
  198. insertDomSelector: ".movie-poster",
  199. doubanContainerDom: '<div class="douban-dom" style="justify-content: flex-start;"></div>'
  200. },
  201. "secret-cinema.pw": {
  202. url: "https://secret-cinema.pw",
  203. host: "secret-cinema.pw",
  204. siteName: "SC",
  205. imdb: '.torrent_row a[href*="imdb.com/title"]:first',
  206. insertDomSelector: ".linkbox:first",
  207. doubanContainerDom: '<div class="douban-dom sc"></div>'
  208. },
  209. "shadowthein.net": {
  210. url: "http://shadowthein.net",
  211. host: "shadowthein.net",
  212. siteName: "iTS",
  213. imdb: '.IMDBtable a[href*="imdb.com/title"]:first',
  214. insertDomSelector: "h1+table.line",
  215. titleDom: "h1:first",
  216. doubanContainerDom: '<div class="douban-dom its"></div>'
  217. },
  218. "tgx.rs": {
  219. url: "https://tgx.rs",
  220. host: "tgx.rs",
  221. siteName: "TorrentGalaxy",
  222. poster: "#covercell img",
  223. imdb: '#imdbpage[href*="imdb.com/title"]',
  224. titleDom: ".torrentpagetable.limitwidth:first a.textshadow",
  225. insertDomSelector: ".buttonbox",
  226. doubanContainerDom: '<div class="douban-dom" style="display:flex;justify-content: center;"></div>'
  227. },
  228. "uhdbits.org": {
  229. url: "https://uhdbits.org",
  230. host: "uhdbits.org",
  231. siteName: "UHD",
  232. imdb: ".tooltip.imdb_icon",
  233. poster: ".poster_box .imgbox img",
  234. insertDomSelector: "div.head:contains(IMDB)",
  235. doubanContainerDom: '<div class="box"><div class="head"><a href="#">\u2191</a>&nbsp;<strong>\u8C46\u74E3</strong></div><div class="body douban-dom"></div></div>'
  236. },
  237. "www.morethantv.me": {
  238. url: "www.morethantv.me",
  239. host: "morethantv.me",
  240. siteName: "MTV",
  241. imdb: '.metalinks a[href*="imdb.com/title"]',
  242. insertDomSelector: "#content>.thin>div:first",
  243. poster: ".sidebar img:first",
  244. titleDom: ".details h2:first",
  245. doubanContainerDom: '<div class="douban-dom mtv"></div>'
  246. },
  247. "www.torrentleech.org": {
  248. url: "https://www.torrentleech.org",
  249. host: "torrentleech.org",
  250. siteName: "IPT",
  251. imdb: '.imdb-info a[href*="imdb.com/title"]',
  252. titleDom: "#torrentnameid",
  253. poster: ".imdb_cover img",
  254. insertDomSelector: ".torrent-info .torrent-info-details",
  255. doubanContainerDom: '<div class="douban-dom"></div>'
  256. }
  257. };
  258.  
  259. // src/const.js
  260. var host = location.host;
  261. var _a, _b;
  262. var siteInfo = (_b = (_a = PT_SITE) == null ? void 0 : _a[host]) != null ? _b : "";
  263. var _a2, _b2;
  264. if (host && host.match(/iptorrents/i)) {
  265. siteInfo = PT_SITE["iptorrents.com"];
  266. } else {
  267. siteInfo = (_b2 = (_a2 = PT_SITE) == null ? void 0 : _a2[host]) != null ? _b2 : "";
  268. }
  269. var CURRENT_SITE_INFO = siteInfo;
  270. var _a3;
  271. var CURRENT_SITE_NAME = (_a3 = CURRENT_SITE_INFO == null ? void 0 : CURRENT_SITE_INFO.siteName) != null ? _a3 : "";
  272. var DOUBAN_SUBJECT_URL = "https://movie.douban.com/subject/{doubanId}";
  273. var DOUBAN_API_URL = "https://api.douban.com/v2/movie";
  274. var PIC_URLS = {
  275. border: "https://ptpimg.me/zz4632.png",
  276. icon2x: "https://ptpimg.me/n74cjc.png",
  277. icon: "https://ptpimg.me/yze1gz.png",
  278. line: "https://ptpimg.me/e11hb1.png"
  279. };
  280.  
  281. // src/common.js
  282. var addToPtpPage = (data) => {
  283. console.log(data);
  284. $(".page__title").prepend(`<a target='_blank' href="${data.link}">[${data.chineseTitle}] </a>`);
  285. if (data.summary) {
  286. const synopsisDom = `
  287. <div class="panel" id="douban-synopsis">
  288. <div class="panel__heading"><span class="panel__heading__title">\u4E2D\u6587\u7B80\u4ECB</span></div>
  289. <div class="panel__body">
  290. <div id="synopsis">${data.summary}</div>
  291. </div>
  292. </div>`;
  293. $("#synopsis-and-trailer,#request-table").after(synopsisDom);
  294. }
  295. $("#movieinfo").before(`
  296. <div class="panel">
  297. <div class="panel__heading"><span class="panel__heading__title">\u7535\u5F71\u4FE1\u606F</span></div>
  298. <div class="panel__body">
  299. <div><strong>\u5BFC\u6F14:</strong> ${data.director}</div>
  300. <div><strong>\u7C7B\u578B:</strong> ${data.genre}</div>
  301. <div><strong>\u5236\u7247\u56FD\u5BB6/\u5730\u533A:</strong> ${data.region}</div>
  302. <div><strong>\u8BED\u8A00:</strong> ${data.language}</div>
  303. <div><strong>\u65F6\u957F:</strong> ${data.runtime}</div>
  304. <div><strong>\u53C8\u540D:</strong> ${data.aka}</div
  305. <div><strong>\u83B7\u5956\u60C5\u51B5:</strong> <br> ${data.awards}</div
  306. </div>`);
  307. if (data.average) {
  308. $("#movie-ratings-table tr").prepend(`<td colspan="1" style="width: 152px;">
  309. <center>
  310. <a target="_blank" class="rating" href="${data.link}" rel="noreferrer">
  311. <div style="font-size: 0;min-width: 105px;">
  312. <span class="icon-pt1">\u8C46</span>
  313. <span class="icon-pt2">\u8C46\u74E3\u8BC4\u5206</span>
  314. </div>
  315. </a>
  316. </center>
  317. </td>
  318. <td style="width: 153px;">
  319. <span class="rating">${data.average}</span>
  320. <span class="mid">/</span>
  321. <span class="outof"> 10</span>
  322. <br>(${data.votes} votes)</td>`);
  323. }
  324. };
  325. var addToANTPage = (data) => {
  326. console.log(data);
  327. $(".header h2").prepend(`<a target='_blank' href="${data.link}">[${data.chineseTitle}] </a>`);
  328. if (data.summary) {
  329. const synopsisDom = `
  330. <div class="box torrent_description">
  331. <div class="head"><a href="#">\u2191</a>&nbsp;<strong>\u4E2D\u6587\u7B80\u4ECB</strong></div>
  332. <div class="body" style="text-align:justify">${data.summary}</div>
  333. </div>`;
  334. $(".torrent_description,.box_request_desc").after(synopsisDom);
  335. }
  336. $(".box_details:first").before(`
  337. <div class="box box_details">
  338. <div class="head"><strong></strong>\u7535\u5F71\u4FE1\u606F</div>
  339. <div class="pad">
  340. <ul class="stats nobullet">
  341. <li><strong>\u5BFC\u6F14:</strong> ${data.director}</li>
  342. <li><strong>\u7C7B\u578B:</strong> ${data.genre}</li>
  343. <li><strong>\u5236\u7247\u56FD\u5BB6/\u5730\u533A:</strong> ${data.region}</li>
  344. <li><strong>\u8BED\u8A00:</strong> ${data.language}</li>
  345. <li><strong>\u65F6\u957F:</strong> ${data.runtime}</li>
  346. <li><strong>\u53C8\u540D:</strong> ${data.aka}</li
  347. <li><strong>\u83B7\u5956\u60C5\u51B5:</strong> <br> ${data.awards}</li
  348. </ul>
  349. </div>
  350. </div>`);
  351. if (data.average) {
  352. $(".box.torrent_ratings .body tr").prepend(`<td colspan="1">
  353. <center>
  354. <a target="_blank" class="rating ant" href="${data.link}" rel="noreferrer">
  355. <div style="font-size: 0;">
  356. <span class="icon-pt1">\u8C46</span>
  357. </div>
  358. </a>
  359. </center>
  360. </td>
  361. <td>
  362. <span class="rating">${data.average}</span>
  363. <span class="mid">/</span>
  364. <span class="outof"> 10</span>
  365. <br>(${data.votes} votes)</td>`);
  366. }
  367. };
  368. var getImdbId = () => {
  369. var _a4, _b3;
  370. let imdbLink = "";
  371. const imdbConfig = CURRENT_SITE_INFO.imdb;
  372. if (typeof imdbConfig === "object") {
  373. try {
  374. Object.keys(imdbConfig).forEach((key) => {
  375. if ($(`${imdbConfig[key]}`)[0]) {
  376. imdbLink = $(imdbConfig[key]).attr("href");
  377. throw new Error("end loop");
  378. }
  379. });
  380. } catch (error) {
  381. if (error.message !== "end loop") {
  382. console.log(error);
  383. }
  384. }
  385. } else {
  386. imdbLink = $(imdbConfig).attr("href");
  387. }
  388. console.log(imdbLink);
  389. return (_b3 = (_a4 = /tt\d+/.exec(imdbLink)) == null ? void 0 : _a4[0]) != null ? _b3 : "";
  390. };
  391. var getTvSeasonData = async (data) => {
  392. var _a4, _b3;
  393. const torrentTitle = getTorrentTitle();
  394. const {episodes = "", chineseTitle} = data;
  395. if (episodes) {
  396. const seasonNumber = (_b3 = (_a4 = torrentTitle.match(/S(?!eason)\s*?0?(\d+)\.?(EP?\d+)?/i)) == null ? void 0 : _a4[1]) != null ? _b3 : 1;
  397. if (parseInt(seasonNumber) === 1) {
  398. return data;
  399. } else {
  400. const query = `${chineseTitle} \u7B2C${seasonNumber}\u5B63`;
  401. const params = encodeURI("apikey=0ab215a8b1977939201640fa14c66bab");
  402. const searchData = await fetch(`${DOUBAN_API_URL}/search?q=${query}`, {
  403. data: params,
  404. method: "POST",
  405. headers: {
  406. "Content-Type": "application/x-www-form-urlencoded"
  407. }
  408. });
  409. if (searchData.count > 0) {
  410. return {id: searchData.subjects[0].id};
  411. }
  412. }
  413. }
  414. };
  415. var getDoubanInfo = async (doubanId, imdbId) => {
  416. try {
  417. const url = DOUBAN_SUBJECT_URL.replace("{doubanId}", doubanId);
  418. const data = await fetch(url, {
  419. responseType: "text"
  420. });
  421. if (data) {
  422. const doubanInfo = await formatDoubanInfo(data);
  423. const savedIds = GM_getValue("ids") || {};
  424. savedIds[imdbId] = __assign({
  425. doubanId,
  426. updateTime: Date.now()
  427. }, doubanInfo);
  428. GM_setValue("ids", savedIds);
  429. return doubanInfo;
  430. } else {
  431. console.log("\u8C46\u74E3\u6570\u636E\u83B7\u53D6\u5931\u8D25");
  432. }
  433. } catch (error) {
  434. console.log(error);
  435. }
  436. };
  437. var getDoubanInfoByIMDB = async (imdbId) => {
  438. var _a4, _b3, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
  439. try {
  440. const params = encodeURI("apikey=0ab215a8b1977939201640fa14c66bab");
  441. const doubanData = await fetch(`${DOUBAN_API_URL}/imdb/${imdbId}`, {
  442. data: params,
  443. method: "POST",
  444. headers: {
  445. "Content-Type": "application/x-www-form-urlencoded"
  446. }
  447. });
  448. const {title, attrs = {}, image, summary, rating, alt_title: altTitle, mobile_link: mobileLink} = doubanData;
  449. let chineseTitle = title;
  450. const isChineseReg = /[\u4e00-\u9fa5]+/;
  451. if (!isChineseReg.test(title) && !title.match(/^\d+$/)) {
  452. if (altTitle) {
  453. chineseTitle = altTitle.split("/")[0].trim();
  454. } else {
  455. chineseTitle = title;
  456. }
  457. }
  458. const subjectLink = mobileLink.replace("m.douban.com/movie", "movie.douban.com").replace(/\/$/, "");
  459. const doubanId = (_b3 = (_a4 = subjectLink.match(/subject\/(\d+)/)) == null ? void 0 : _a4[1]) != null ? _b3 : "";
  460. const awards = await getAwardInfo(subjectLink);
  461. const doubanInfo = {
  462. director: (_c = attrs.director) == null ? void 0 : _c.join(" / "),
  463. runtime: (_d = attrs.movie_duration) == null ? void 0 : _d.join(" / "),
  464. language: (_e = attrs.language) == null ? void 0 : _e.join(" / "),
  465. genre: (_g = (_f = attrs.movie_type) == null ? void 0 : _f.join(" / ")) != null ? _g : "",
  466. aka: altTitle || "",
  467. region: (_h = attrs.country) == null ? void 0 : _h.join(" / "),
  468. link: subjectLink,
  469. poster: image,
  470. summary,
  471. chineseTitle,
  472. votes: rating.numRaters,
  473. average: rating.average,
  474. awards,
  475. id: (_j = (_i = subjectLink.match(/subject\/(\d+)/)) == null ? void 0 : _i[1]) != null ? _j : "",
  476. episodes: (_l = (_k = attrs.episodes) == null ? void 0 : _k.join(" / ")) != null ? _l : ""
  477. };
  478. if (!attrs.episodes) {
  479. const savedIds = GM_getValue("ids") || {};
  480. savedIds[imdbId] = __assign({
  481. doubanId,
  482. updateTime: Date.now()
  483. }, doubanInfo);
  484. GM_setValue("ids", savedIds);
  485. }
  486. return doubanInfo;
  487. } catch (error) {
  488. console.log(error);
  489. }
  490. };
  491. var getAwardInfo = async (doubanLink) => {
  492. var _a4;
  493. const awardsPage = await fetch(`${doubanLink}/awards/`, {
  494. responseType: "text"
  495. });
  496. const awardsDoc = new DOMParser().parseFromString(awardsPage, "text/html");
  497. const awards = $("#content > div > div.article", awardsDoc).html().replace(/[ \n]/g, "").replace(/<\/li><li>/g, "</li> <li>").replace(/<\/a><span/g, "</a> <span").replace(/<(div|ul)[^>]*>/g, "\n").replace(/<[^>]+>/g, "").replace(/&nbsp;/g, " ").replace(/ +\n/g, "\n").trim();
  498. return (_a4 = awards == null ? void 0 : awards.replace(/\n/g, "<br>")) != null ? _a4 : "";
  499. };
  500. var formatDoubanInfo = async (domString) => {
  501. var _a4, _b3;
  502. const dom = new DOMParser().parseFromString(domString, "text/html");
  503. const chineseTitle = $("title", dom).text().replace("(\u8C46\u74E3)", "").trim();
  504. const jsonData = JSON.parse($('head > script[type="application/ld+json"]', dom).html().replace(/(\r\n|\n|\r|\t)/gm, ""));
  505. const fetchAnchor = function(anchor) {
  506. var _a5, _b4, _c, _d;
  507. return (_d = (_c = (_b4 = (_a5 = anchor == null ? void 0 : anchor[0]) == null ? void 0 : _a5.nextSibling) == null ? void 0 : _b4.nodeValue) == null ? void 0 : _c.trim()) != null ? _d : "";
  508. };
  509. const rating = jsonData.aggregateRating ? jsonData.aggregateRating.ratingValue : 0;
  510. const votes = jsonData.aggregateRating ? jsonData.aggregateRating.ratingCount : 0;
  511. const director = jsonData.director ? jsonData.director : [];
  512. const poster = jsonData.image.replace(/s(_ratio_poster|pic)/g, "l$1").replace(/img\d/, "img9");
  513. const link = `https://movie.douban.com${jsonData.url}`;
  514. const introductionDom = $('#link-report > span.all.hidden,#link-report-intra > [property="v:summary"], #link-report > [property="v:summary"]', dom);
  515. const summary = (introductionDom.length > 0 ? introductionDom.text() : "\u6682\u65E0\u76F8\u5173\u5267\u60C5\u4ECB\u7ECD").split("\n").map((a) => a.trim()).filter((a) => a.length > 0).join("\n");
  516. const genre = $('#info span[property="v:genre"]', dom).map(function() {
  517. return $(this).text().trim();
  518. }).toArray();
  519. const language = fetchAnchor($('#info span.pl:contains("\u8BED\u8A00")', dom));
  520. const region = fetchAnchor($('#info span.pl:contains("\u5236\u7247\u56FD\u5BB6/\u5730\u533A")', dom));
  521. const runtimeAnchor = $('#info span.pl:contains("\u5355\u96C6\u7247\u957F")', dom);
  522. const runtime = runtimeAnchor[0] ? fetchAnchor(runtimeAnchor) : $('#info span[property="v:runtime"]', dom).text().trim();
  523. const akaAnchor = $('#info span.pl:contains("\u53C8\u540D")', dom);
  524. let aka = [];
  525. if (akaAnchor.length > 0) {
  526. aka = fetchAnchor(akaAnchor).split(" / ").sort(function(a, b) {
  527. return a.localeCompare(b);
  528. }).join("/");
  529. aka = aka.split("/");
  530. }
  531. const awards = await getAwardInfo(link);
  532. return {
  533. director: director.map((item) => item.name),
  534. runtime,
  535. language,
  536. genre: (_a4 = genre == null ? void 0 : genre.join(" / ")) != null ? _a4 : "",
  537. aka: (_b3 = aka == null ? void 0 : aka.join(" / ")) != null ? _b3 : "",
  538. region,
  539. link,
  540. poster,
  541. summary,
  542. chineseTitle,
  543. votes,
  544. average: rating,
  545. awards
  546. };
  547. };
  548. var getTorrentTitle = () => {
  549. let {titleDom} = CURRENT_SITE_INFO;
  550. if (!titleDom) {
  551. if (CURRENT_SITE_NAME === "BHD") {
  552. titleDom = $(".dotborder").find("td:contains(Name)").next("td");
  553. } else if (CURRENT_SITE_NAME.match(/ACM|BLU/)) {
  554. const keyMap = {
  555. Name: "Name",
  556. \u540D\u79F0: "Name",
  557. \u540D\u7A31: "Name"
  558. };
  559. $("#vue+.panel table tr").each((index, element) => {
  560. const key = $(element).find("td:first").text().replace(/\s|\n/g, "");
  561. if (keyMap[key]) {
  562. titleDom = $(element).find("td:last");
  563. }
  564. });
  565. } else if (CURRENT_SITE_NAME === "UHD") {
  566. const torrentId = getUrlParam("torrentid");
  567. const torrentFilePathDom = $(`#files_${torrentId} .filelist_path`);
  568. const torrentFileDom = $(`#files_${torrentId} .filelist_table>tbody>tr:nth-child(2) td`).eq(0);
  569. titleDom = torrentFilePathDom || torrentFileDom;
  570. } else if (CURRENT_SITE_NAME === "HDT") {
  571. return document.title.replace(/HD-Torrents.org\s*-/ig, "").trim();
  572. }
  573. }
  574. return $(titleDom).text();
  575. };
  576. var getUrlParam = (key) => {
  577. const reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)");
  578. const regArray = location.search.substr(1).match(reg);
  579. if (regArray) {
  580. return unescape(regArray[2]);
  581. }
  582. return "";
  583. };
  584. var createDoubanDom = async (doubanId, imdbId, doubanInfo) => {
  585. const div = document.createElement("div");
  586. let {doubanContainerDom, insertDomSelector, siteName, poster} = CURRENT_SITE_INFO;
  587. if (siteName.match(/(HDT)$/)) {
  588. insertDomSelector = $(insertDomSelector).parent();
  589. }
  590. $(insertDomSelector).before(doubanContainerDom);
  591. const doubanLink = `https://movie.douban.com/subject/${doubanId}`;
  592. let htmlData = await fetch(`${doubanLink}/output_card`, {
  593. responseType: "text"
  594. });
  595. htmlData = htmlData.replace(/wrapper/g, "douban-wrapper").replace(/<script.+?script>/g, "");
  596. htmlData = htmlData.replace(/(html,)body,/, "$1");
  597. htmlData = htmlData.replace(/url\(.+?output_card\/border.png\)/g, `url(${PIC_URLS.border})`);
  598. htmlData = htmlData.replace(/src=.+?output_card\/line\.png/g, `src="${PIC_URLS.line}`);
  599. let headDom = htmlData.match(/<head>((.|\n)+)<\/head>/)[1];
  600. headDom = headDom.replace(/<link.+?>/g, "");
  601. const bodyDom = htmlData.match(/<body>((.|\n)+)<\/body>/)[1];
  602. div.insertAdjacentHTML("beforeend", headDom);
  603. div.insertAdjacentHTML("beforeend", bodyDom);
  604. $(".douban-dom").append(div).attr("douban-link", doubanLink);
  605. $(".douban-dom .grid-col4").after(`
  606. <div class="fix-col grid-col3">
  607. <div class="line-wrap">
  608. <img src="https://ptpimg.me/e11hb1.png">
  609. </div>
  610. </div>
  611. <div class="fix-col grid-col5"></div>`);
  612. const doubanData = doubanInfo || await getDoubanInfo(doubanId, imdbId);
  613. $(".douban-dom .grid-col5").html(`<div class="summary">${doubanData.summary || "\u6682\u65E0\u7B80\u4ECB"}</div>`);
  614. let posterStyle = $(".picture-douban-wrapper").attr("style");
  615. const posterImg = siteName === "MTV" ? $(poster).attr("src") : doubanData.poster;
  616. posterStyle = posterStyle == null ? void 0 : posterStyle.replace(/\(.+\)/, `(${posterImg})`);
  617. $(".picture-douban-wrapper").attr("style", posterStyle);
  618. $(".douban-dom").click(() => {
  619. GM_openInTab(doubanLink);
  620. });
  621. };
  622. function fetch(url, options = {}) {
  623. return new Promise((resolve, reject) => {
  624. GM_xmlhttpRequest(__assign(__assign({
  625. method: "GET",
  626. url,
  627. responseType: "json"
  628. }, options), {
  629. onload: (res) => {
  630. const {statusText, status, response} = res;
  631. if (status !== 200) {
  632. reject(new Error(statusText || status));
  633. } else {
  634. resolve(response);
  635. }
  636. },
  637. ontimeout: () => {
  638. reject(new Error("timeout"));
  639. },
  640. onerror: (error) => {
  641. reject(error);
  642. }
  643. }));
  644. });
  645. }
  646.  
  647. // src/style.js
  648. var style_default = GM_addStyle(`
  649. .bigstar50,.bigstar45,.bigstar40,.bigstar35,.bigstar30,.bigstar25,.bigstar20,.bigstar15,.bigstar10,.bigstar05,.bigstar00 {
  650. display: inline-block;
  651. *display: inline;
  652. zoom:1;background: https://ptpimg.me/yze1gz.png) no-repeat;
  653. background: -webkit-image-set(https://ptpimg.me/yze1gz.png) 1x, url(https://ptpimg.me/n74cjc.png) 2x) no-repeat;
  654. background: -moz-image-set(https://ptpimg.me/yze1gz.png) 1x, url(https://ptpimg.me/n74cjc.png) 2x) no-repeat;
  655. background: -o-image-set(https://ptpimg.me/yze1gz.png) 1x, url(https://ptpimg.me/n74cjc.png) 2x) no-repeat;
  656. background: -ms-image-set(https://ptpimg.me/yze1gz.png) 1x, url(https://ptpimg.me/n74cjc.png) 2x) no-repeat;
  657. width: 75px;
  658. height: 15px;
  659. margin: 1px 0 0 0;
  660. overflow: hidden
  661. }
  662.  
  663. .bigstar50+span.rating_num,.bigstar45+span.rating_num,.bigstar40+span.rating_num,.bigstar35+span.rating_num,.bigstar30+span.rating_num,.bigstar25+span.rating_num,.bigstar20+span.rating_num,.bigstar15+span.rating_num,.bigstar10+span.rating_num,.bigstar05+span.rating_num,.bigstar00+span.rating_num {
  664. font-size: 16px;
  665. line-height: 1
  666. }
  667.  
  668. .bigstar50 {
  669. background-position: 0 0px
  670. }
  671.  
  672. .bigstar45 {
  673. background-position: 0 -15px
  674. }
  675.  
  676. .bigstar40 {
  677. background-position: 0 -30px
  678. }
  679.  
  680. .bigstar35 {
  681. background-position: 0 -45px
  682. }
  683.  
  684. .bigstar30 {
  685. background-position: 0 -60px
  686. }
  687.  
  688. .bigstar25 {
  689. background-position: 0 -75px
  690. }
  691.  
  692. .bigstar20 {
  693. background-position: 0 -90px
  694. }
  695.  
  696. .bigstar15 {
  697. background-position: 0 -105px
  698. }
  699.  
  700. .bigstar10 {
  701. background-position: 0 -120px
  702. }
  703.  
  704. .bigstar05 {
  705. background-position: 0 -135px
  706. }
  707.  
  708. .bigstar00 {
  709. background-position: 0 -150px
  710. }
  711.  
  712. .allstar50,.allstar45,.allstar40,.allstar35,.allstar30,.allstar25,.allstar20,.allstar15,.allstar10,.allstar05,.allstar00,.rating1-t,.rating15-t,.rating2-t,.rating25-t,.rating3-t,.rating35-t,.rating4-t,.rating45-t,.rating5-t,.rating-t,.starb~.stars5,.starb~.stars4,.starb~.stars3,.starb~.stars2,.starb~.stars1,.collectors .stars5,.collectors .stars4,.collectors .stars3,.collectors .stars2,.collectors .stars1 {
  713. display: inline-block;
  714. *display: inline;
  715. zoom:1;background: url(/f/movie/b8f4c3672ef81106701071831e22422a745d3b74/pics/rating_icons/ic_rating_s.png) no-repeat;
  716. background: -webkit-image-set(url(/f/movie/b8f4c3672ef81106701071831e22422a745d3b74/pics/rating_icons/ic_rating_s.png) 1x, url(/f/movie/076dc86067c402ced53eee7c09cd45402235733c/pics/rating_icons/ic_rating_s@2x.png) 2x) no-repeat;
  717. background: -moz-image-set(url(/f/movie/b8f4c3672ef81106701071831e22422a745d3b74/pics/rating_icons/ic_rating_s.png) 1x, url(/f/movie/076dc86067c402ced53eee7c09cd45402235733c/pics/rating_icons/ic_rating_s@2x.png) 2x) no-repeat;
  718. background: -o-image-set(url(/f/movie/b8f4c3672ef81106701071831e22422a745d3b74/pics/rating_icons/ic_rating_s.png) 1x, url(/f/movie/076dc86067c402ced53eee7c09cd45402235733c/pics/rating_icons/ic_rating_s@2x.png) 2x) no-repeat;
  719. background: -ms-image-set(url(/f/movie/b8f4c3672ef81106701071831e22422a745d3b74/pics/rating_icons/ic_rating_s.png) 1x, url(/f/movie/076dc86067c402ced53eee7c09cd45402235733c/pics/rating_icons/ic_rating_s@2x.png) 2x) no-repeat;
  720. width: 55px;
  721. height: 11px;
  722. margin: 0 3px 0 0;
  723. overflow: hidden
  724. }
  725.  
  726. .status-item .allstar50,.status-item .allstar45,.status-item .allstar40,.status-item .allstar35,.status-item .allstar30,.status-item .allstar25,.status-item .allstar20,.status-item .allstar15,.status-item .allstar10,.status-item .allstar05,.status-item .allstar00,.status-item .rating1-t,.status-item .rating15-t,.status-item .rating2-t,.status-item .rating25-t,.status-item .rating3-t,.status-item .rating35-t,.status-item .rating4-t,.status-item .rating45-t,.status-item .rating5-t,.status-item .rating-t,.status-item .starb~.stars5,.status-item .starb~.stars4,.status-item .starb~.stars3,.status-item .starb~.stars2,.status-item .starb~.stars1,.status-item .collectors .stars5,.status-item .collectors .stars4,.status-item .collectors .stars3,.status-item .collectors .stars2,.status-item .collectors .stars1 {
  727. margin: 0 0 0 4px
  728. }
  729.  
  730. .allstar50 {
  731. background-position: 0 0px
  732. }
  733.  
  734. .allstar45 {
  735. background-position: 0 -11px
  736. }
  737.  
  738. .allstar40 {
  739. background-position: 0 -22px
  740. }
  741.  
  742. .allstar35 {
  743. background-position: 0 -33px
  744. }
  745.  
  746. .allstar30 {
  747. background-position: 0 -44px
  748. }
  749.  
  750. .allstar25 {
  751. background-position: 0 -55px
  752. }
  753.  
  754. .allstar20 {
  755. background-position: 0 -66px
  756. }
  757.  
  758. .allstar15 {
  759. background-position: 0 -77px
  760. }
  761.  
  762. .allstar10 {
  763. background-position: 0 -88px
  764. }
  765.  
  766. .allstar05 {
  767. background-position: 0 -99px
  768. }
  769.  
  770. .allstar00 {
  771. background-position: 0 -110px
  772. }
  773.  
  774. .rating5-t,.starb~.stars5,.collectors .stars5 {
  775. background-position: 0 0px
  776. }
  777.  
  778. .rating45-t {
  779. background-position: 0 -11px
  780. }
  781.  
  782. .rating4-t,.starb~.stars4,.collectors .stars4 {
  783. background-position: 0 -22px
  784. }
  785.  
  786. .rating35-t {
  787. background-position: 0 -33px
  788. }
  789.  
  790. .rating3-t,.starb~.stars3,.collectors .stars3 {
  791. background-position: 0 -44px
  792. }
  793.  
  794. .rating25-t {
  795. background-position: 0 -55px
  796. }
  797.  
  798. .rating2-t,.starb~.stars2,.collectors .stars2 {
  799. background-position: 0 -66px
  800. }
  801.  
  802. .rating15-t {
  803. background-position: 0 -77px
  804. }
  805.  
  806. .rating1-t,.starb~.stars1,.collectors .stars1 {
  807. background-position: 0 -88px
  808. }
  809.  
  810. .rating1-t,.rating15-t,.rating2-t,.rating25-t,.rating3-t,.rating35-t,.rating4-t,.rating45-t,.rating5-t,.rating-t {
  811. padding-left: 5px
  812. }
  813.  
  814. #stars {
  815. font-size: 0;
  816. vertical-align: text-bottom;
  817. cursor: pointer
  818. }
  819.  
  820. #stars a img {
  821. vertical-align: text-bottom
  822. }
  823.  
  824. .starstop,.stars {
  825. margin-right: 5px
  826. }
  827.  
  828. .starstop {
  829. float: left
  830. }
  831.  
  832. .rating_nums,.rating_num {
  833. color: #e09015;
  834. font-size: 12px;
  835. padding: 0 3px
  836. }
  837.  
  838. .status-item .rating_num {
  839. font-size: 14px
  840. }
  841.  
  842. .rating_nums {
  843. padding-left: 0
  844. }
  845.  
  846. .star .rating_num {
  847. color: #e09015;
  848. padding: 0 5px 0 0
  849. }
  850.  
  851. #interest_sect {
  852. overflow: hidden;
  853. word-wrap: break-word
  854. }
  855.  
  856. #interest_sectl {
  857. float: left;
  858. width: 155px;
  859. margin: 2px 0 0 0;
  860. padding: 0 0 0 15px;
  861. border-left: 1px solid #eaeaea;
  862. color: #9b9b9b
  863. }
  864.  
  865. #interest_sectl .rating_wrap {
  866. padding-bottom: 15px;
  867. font-size: 12px;
  868. line-height: 14px
  869. }
  870.  
  871. #interest_sectl .rating_wrap .rating_logo {
  872. line-height: 1
  873. }
  874.  
  875. #interest_sectl .rating_self {
  876. padding: 0;
  877. line-height: 2
  878. }
  879.  
  880. #interest_sectl .rating_self:before,#interest_sectl .rating_self:after {
  881. content: '';
  882. display: block;
  883. clear: both
  884. }
  885.  
  886. #interest_sectl .rating_self .rating_sum {
  887. clear: both
  888. }
  889.  
  890. #interest_sectl .rating_num {
  891. color: #494949;
  892. padding: 0;
  893. min-width: 30%;
  894. font-size: 28px
  895. }
  896.  
  897. #interest_sectl .rating_right {
  898. float: left;
  899. padding: 10px 0 10px 6px
  900. }
  901.  
  902. #interest_sectl .rating_right.not_showed {
  903. padding: 10px 0
  904. }
  905.  
  906. #interest_sectl .power {
  907. height: 10px;
  908. float: left;
  909. margin: 1px 4px;
  910. background: #ffd596 none repeat scroll 0 0
  911. }
  912.  
  913. #interest_sectl .power.color_gray {
  914. background: #ccc
  915. }
  916.  
  917. #interest_sectl .rating_per {
  918. font-size: 11px
  919. }
  920.  
  921. #interest_sectl .rating_betterthan {
  922. position: relative;
  923. padding: 15px 0;
  924. border-top: 1px solid #eaeaea;
  925. color: #9b9b9b;
  926. margin: 0
  927. }
  928.  
  929. .rating_logo_wrap .content {
  930. display: inline-block;
  931. *display: inline;
  932. zoom:1;vertical-align: top;
  933. font-size: 12px;
  934. line-height: 20px;
  935. color: #9b9b9b;
  936. margin-right: 4px
  937. }
  938.  
  939. .rating_helper_wrap {
  940. display: inline-block;
  941. *display: inline;
  942. zoom:1;vertical-align: top;
  943. position: relative;
  944. line-height: 18px
  945. }
  946.  
  947. .rating_helper_wrap:hover .rating_helper_icon {
  948. background-position: 0 -12px
  949. }
  950.  
  951. .rating_helper_wrap:hover .rating_helper_content {
  952. display: block
  953. }
  954.  
  955. .rating_helper_icon {
  956. background: url(/f/movie/16305b59f6b69b8acde51c880de2a5b6cde0155a/pics/icon/ic_qmark.png) no-repeat;
  957. background: -webkit-image-set(url(/f/movie/16305b59f6b69b8acde51c880de2a5b6cde0155a/pics/icon/ic_qmark.png) 1x, url(/f/movie/1fb4f85391f82c3286d7318d840577daae1c2eee/pics/icon/ic_qmark@2x.png) 2x) no-repeat;
  958. background: -moz-image-set(url(/f/movie/16305b59f6b69b8acde51c880de2a5b6cde0155a/pics/icon/ic_qmark.png) 1x, url(/f/movie/1fb4f85391f82c3286d7318d840577daae1c2eee/pics/icon/ic_qmark@2x.png) 2x) no-repeat;
  959. background: -o-image-set(url(/f/movie/16305b59f6b69b8acde51c880de2a5b6cde0155a/pics/icon/ic_qmark.png) 1x, url(/f/movie/1fb4f85391f82c3286d7318d840577daae1c2eee/pics/icon/ic_qmark@2x.png) 2x) no-repeat;
  960. background: -ms-image-set(url(/f/movie/16305b59f6b69b8acde51c880de2a5b6cde0155a/pics/icon/ic_qmark.png) 1x, url(/f/movie/1fb4f85391f82c3286d7318d840577daae1c2eee/pics/icon/ic_qmark@2x.png) 2x) no-repeat;
  961. display: inline-block;
  962. *display: inline;
  963. zoom:1;vertical-align: middle;
  964. width: 12px;
  965. height: 12px
  966. }
  967.  
  968. .rating_helper_content {
  969. z-index: 10;
  970. color: #494949;
  971. display: none;
  972. position: absolute;
  973. left: 12px;
  974. bottom: 3px;
  975. width: 96px;
  976. background: #fef6e9;
  977. border: 1px solid #e3d9ca;
  978. padding: 8px 10px;
  979. border-radius: 4px;
  980. box-shadow: 0 2px 5px rgba(0,0,0,0.1)
  981. }
  982.  
  983. .rating_content_wrap {
  984. width: 110%;
  985. padding-bottom: 8px
  986. }
  987.  
  988. .rating_content_wrap .rating_avg {
  989. float: left;
  990. font-size: 16px;
  991. line-height: 28px;
  992. color: #494949;
  993. margin-right: 12px
  994. }
  995.  
  996. .rating_content_wrap .friends {
  997. float: left;
  998. margin-right: 6px
  999. }
  1000.  
  1001. .rating_content_wrap .avatar {
  1002. float: left;
  1003. margin-top: 6px;
  1004. margin-right: 2px;
  1005. line-height: 0;
  1006. border-radius: 50%;
  1007. overflow: hidden;
  1008. cursor: default
  1009. }
  1010.  
  1011. .rating_content_wrap .avatar img {
  1012. width: 16px
  1013. }
  1014.  
  1015. .rating_content_wrap .friends_count {
  1016. float: left;
  1017. line-height: 14px;
  1018. margin-top: 7px
  1019. }
  1020.  
  1021. #screening .subject-rate {
  1022. color: #e09015;
  1023. font-size: 12px;
  1024. margin-left: 2px
  1025. }
  1026.  
  1027. #screening .rating {
  1028. display: inline-block;
  1029. *display: inline;
  1030. zoom:1;margin: 4px auto 2px;
  1031. height: 19px
  1032. }
  1033.  
  1034. #screening .rating span {
  1035. float: left
  1036. }
  1037.  
  1038. #screening .rating .rating-star {
  1039. margin: 3px 3px 0 0;
  1040. width: 55px
  1041. }
  1042.  
  1043. span.subject-rate,.rate,.subject-rating {
  1044. color: #e09015
  1045. }
  1046.  
  1047. img.rating {
  1048. vertical-align: text-bottom
  1049. }
  1050.  
  1051. img.rating:nth-child(1) {
  1052. padding-left: 10px
  1053. }
  1054.  
  1055. .rec-list .score {
  1056. color: #e09015
  1057. }
  1058.  
  1059. .album-item .star {
  1060. line-height: 1;
  1061. margin-top: 6px
  1062. }
  1063.  
  1064. .album-item .star .allstar50,.album-item .star .allstar45,.album-item .star .allstar40,.album-item .star .allstar35,.album-item .star .allstar30,.album-item .star .allstar25,.album-item .star .allstar20,.album-item .star .allstar15,.album-item .star .allstar10,.album-item .star .allstar05,.album-item .star .allstar00 {
  1065. float: left
  1066. }
  1067.  
  1068. .album-item .star .score {
  1069. color: #e09015
  1070. }
  1071.  
  1072. .game-ratings strong {
  1073. margin: 0 6px;
  1074. color: #e09015
  1075. }
  1076.  
  1077. .link-subject .rate-more span {
  1078. font-size: 10px;
  1079. color: #e09015
  1080. }
  1081.  
  1082. .rating-controversy-reason {
  1083. background-color: #FFFBF4;
  1084. color: #494949;
  1085. line-height: 14px;
  1086. margin: 15px 0px 0px 0px;
  1087. padding: 6px 20px 6px 35px;
  1088. font-size: 11px;
  1089. position: relative
  1090. }
  1091.  
  1092. .rating-controversy-reason:before {
  1093. content: '';
  1094. display: block;
  1095. width: 14px;
  1096. height: 14px;
  1097. position: absolute;
  1098. left: 12px;
  1099. top: 50%;
  1100. transform: translateY(-50%);
  1101. background-image: url("data:image/svg+xml, %3Csvg%20width%3D%2216%22%20height%3D%2216%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8%200a8%208%200%20110%2016A8%208%200%20018%200zm0%2010.667a1%201%200%20100%202%201%201%200%20000-2zm0-8a1.207%201.207%200%2000-1.2%201.326l.467%204.677a.737.737%200%20001.466%200l.468-4.677A1.207%201.207%200%20008%202.667z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");
  1102. background-size: contain
  1103. }
  1104.  
  1105. body #douban-wrapper {
  1106. width: 770px;
  1107. height: 345px;
  1108. margin: 0;
  1109. font: 12px Helvetica,Arial,sans-serif
  1110. }
  1111.  
  1112. #douban-wrapper .ll {
  1113. float: left
  1114. }
  1115.  
  1116. #douban-wrapper .col-container .fix-col {
  1117. float: left
  1118. }
  1119.  
  1120. #douban-wrapper #content {
  1121. background-repeat: no-repeat;
  1122. padding: 10px;
  1123. width: 750px;
  1124. height: 325px;
  1125. min-height: initial
  1126. }
  1127.  
  1128. #douban-wrapper #content h1 {
  1129. font-size: 20px
  1130. }
  1131.  
  1132. #douban-wrapper #content .grid {
  1133. width: 750px;
  1134. height: 325px;
  1135. border-radius: 9px
  1136. }
  1137.  
  1138. #douban-wrapper #content .grid .grid-col1 {
  1139. width: 225px
  1140. }
  1141.  
  1142. #douban-wrapper #content .grid .grid-col2 {
  1143. width: 254px;
  1144. padding: 24px 18px;
  1145. height: 277px;
  1146. overflow: hidden
  1147. }
  1148.  
  1149. #douban-wrapper #content .grid .grid-col3 {
  1150. width: 18px
  1151. }
  1152.  
  1153. #douban-wrapper #content .grid .grid-col4 {
  1154. font-size: 14px;
  1155. padding: 27px 14px 0 12px;
  1156. width: 190px
  1157. }
  1158.  
  1159. #douban-wrapper #content .picture-douban-wrapper{
  1160. width: 225px;
  1161. height: 325px;
  1162. border-top-left-radius: 9px;
  1163. border-bottom-left-radius: 9px;
  1164. background-size: cover;
  1165. background-position: center
  1166. }
  1167.  
  1168. #douban-wrapper #content .main-title h1,#douban-wrapper #content .sub-title h2 {
  1169. overflow: hidden;
  1170. word-break: break-all;
  1171. max-height: 2.5em;
  1172. line-height: 1.2;
  1173. display: -webkit-box;
  1174. -webkit-line-clamp: 2;
  1175. -webkit-box-orient: vertical
  1176. }
  1177.  
  1178. #douban-wrapper #content .main-title h1 {
  1179. font-weight: 500;
  1180. font-size: 30px;
  1181. color: #000000
  1182. }
  1183.  
  1184. #douban-wrapper #content .sub-title {
  1185. margin-top: 9px
  1186. }
  1187.  
  1188. #douban-wrapper #content .sub-title h2 {
  1189. font-size: 18px;
  1190. color: #ADADAD;
  1191. font-weight: normal
  1192. }
  1193.  
  1194. #douban-wrapper #content .baseinfo {
  1195. font-size: 16px;
  1196. color: #000000;
  1197. line-height: 25px;
  1198. margin-top: 18px;
  1199. letter-spacing: 1px;
  1200. word-break: break-all;
  1201. font-weight: 400;
  1202. display: -webkit-box;
  1203. overflow: hidden;
  1204. -webkit-line-clamp: 5;
  1205. -webkit-box-orient: vertical
  1206. }
  1207.  
  1208. #douban-wrapper #content .line-wrap {
  1209. width: 18px;
  1210. height: 100%;
  1211. position: relative
  1212. }
  1213.  
  1214. #douban-wrapper #content .line-wrap img {
  1215. width: 100%;
  1216. height: 100%
  1217. }
  1218.  
  1219. #douban-wrapper #content .douban-icon {
  1220. font-size: 0
  1221. }
  1222.  
  1223. #douban-wrapper #content .douban-icon>span {
  1224. font-size: 14px;
  1225. display: inline-block;
  1226. text-align: center;
  1227. border: 1px solid #41BE57
  1228. }
  1229.  
  1230. #douban-wrapper #content .douban-icon .icon-pt1 {
  1231. background-color: #41BE57;
  1232. color: white;
  1233. border-top-left-radius: 4px;
  1234. border-bottom-left-radius: 4px;
  1235. width: 24px;
  1236. height: 24px;
  1237. line-height: 24px
  1238. }
  1239.  
  1240. #douban-wrapper #content .douban-icon .icon-pt2 {
  1241. color: #3BA94D;
  1242. background: #FFFFFF;
  1243. border-top-right-radius: 4px;
  1244. border-bottom-right-radius: 4px;
  1245. width: 69px;
  1246. height: 24px;
  1247. line-height: 24px
  1248. }
  1249.  
  1250. #douban-wrapper #content .score-container .rating_self {
  1251. margin-top: 15px
  1252. }
  1253.  
  1254. #douban-wrapper #content .score-container .rating_self .rating_num {
  1255. font-size: 48px;
  1256. line-height: 1;
  1257. padding: 0;
  1258. color: black;
  1259. font-weight: normal
  1260. }
  1261.  
  1262. #douban-wrapper #content .score-container .rating_self .rating_right {
  1263. float: left;
  1264. padding-left: 10px;
  1265. padding-top: 5px
  1266. }
  1267.  
  1268. #douban-wrapper #content .score-container .rating_self .rating_right .ll {
  1269. float: none
  1270. }
  1271.  
  1272. #douban-wrapper #content .score-container .rating_self .rating_right .rating_sum {
  1273. color: #3B3B3B
  1274. }
  1275.  
  1276. #douban-wrapper #content .score-container .rating_self .rating_right .rating_sum .rating_people,#douban-wrapper #content .score-container .rating_self .rating_right .rating_sum .rating_people:hover,#douban-wrapper #content .score-container .rating_self .rating_right .rating_sum .rating_people:visited,#douban-wrapper #content .score-container .rating_self .rating_right .rating_sum .rating_people:link {
  1277. color: #3B3B3B;
  1278. background: none
  1279. }
  1280.  
  1281. #douban-wrapper #content .score-container .ratings-on-weight {
  1282. margin-top: 10px;
  1283. min-weight: 1px
  1284. }
  1285.  
  1286. #douban-wrapper #content .score-container .ratings-on-weight .item {
  1287. line-height: 1.5
  1288. }
  1289.  
  1290. #douban-wrapper #content .score-container .ratings-on-weight .item .starstop {
  1291. float: none;
  1292. margin-right: 0;
  1293. color: #3B3B3B
  1294. }
  1295.  
  1296. #douban-wrapper #content .score-container .ratings-on-weight .item>span,#douban-wrapper #content .score-container .ratings-on-weight .item>div {
  1297. display: inline-block
  1298. }
  1299.  
  1300. #douban-wrapper #content .score-container .ratings-on-weight .item .power {
  1301. height: 6px;
  1302. background: #FAA032;
  1303. border-radius: 3px;
  1304. vertical-align: middle
  1305. }
  1306.  
  1307. #douban-wrapper #content .bottom-row {
  1308. display: flex;
  1309. align-items: center;
  1310. justify-content: space-between
  1311. }
  1312.  
  1313. #douban-wrapper #content .bottom-row .rating-betterthan {
  1314. font-size: 14px;
  1315. color: #1C1C1C;
  1316. line-height: 21px;
  1317. width: 117px
  1318. }
  1319.  
  1320. #douban-wrapper #content .bottom-row .rating-betterthan .number {
  1321. font-size: 14px;
  1322. color: #41BE57
  1323. }
  1324.  
  1325. #douban-wrapper #content .bottom-row .qr-code {
  1326. width: 64px;
  1327. height: 64px;
  1328. overflow: hidden
  1329. }
  1330.  
  1331. #douban-wrapper #content .bottom-row .qr-code img {
  1332. width: 100%;
  1333. height: 100%
  1334. }
  1335.  
  1336. .contentlayout.douban-info {
  1337. display: flex;
  1338. justify-content: space-around;
  1339. }
  1340. .contentlayout.douban-info .detail{
  1341. flex:1;
  1342. }
  1343. .detail .title{
  1344. font-size: 26px;
  1345. font-weight: 600;
  1346. margin-bottom: 20px;
  1347. }
  1348. .detail .title a{
  1349. text-decoration: none;
  1350. }
  1351. .movie-detail{
  1352. display: flex;
  1353. justify-content: space-between;
  1354. }
  1355. .movie-detail .synopsis {
  1356. width: 60%;
  1357. }
  1358. .movie-detail .movieinfo {
  1359. margin-right: 20px;
  1360. max-width: 30%;
  1361. }
  1362. .icon-pt1{
  1363. font-size: 14px;
  1364. display: inline-block;
  1365. text-align: center;
  1366. border: 1px solid #41be57;
  1367. background-color: #41be57;
  1368. color: white;
  1369. border-top-left-radius: 4px;
  1370. border-bottom-left-radius: 4px;
  1371. width: 24px;
  1372. height: 24px;
  1373. line-height: 24px;
  1374. }
  1375. .ant .icon-pt1{
  1376. border-radius: 4px;
  1377. }
  1378.  
  1379. .icon-pt2{
  1380. display: inline-block;
  1381. text-align: center;
  1382. border: 1px solid #41be57;
  1383. color: #3ba94d;
  1384. background: #ffffff;
  1385. border-top-right-radius: 4px;
  1386. border-bottom-right-radius: 4px;
  1387. width: 69px;
  1388. height: 24px;
  1389. line-height: 24px;
  1390. font-size: 14px;
  1391. }
  1392. .douban-dom {
  1393. display: flex;
  1394. cursor: pointer;
  1395. }
  1396. .douban-dom {
  1397. text-align: left;
  1398. }
  1399. #douban-wrapper *{
  1400. box-sizing: content-box;
  1401. }
  1402. #douban-wrapper .clearfix:after {
  1403. content: ".";
  1404. display: block;
  1405. height: 0;
  1406. clear: both;
  1407. visibility: hidden
  1408. }
  1409. #douban-wrapper .clearfix {
  1410. zoom: 1;
  1411. display: inline-block;
  1412. _height: 1px;
  1413. }
  1414. #douban-wrapper .clearfix {
  1415. height: 1%
  1416. }
  1417. #douban-wrapper .clearfix {
  1418. display: block
  1419. }
  1420. #douban-wrapper .rating_per{
  1421. color: #111;
  1422. }
  1423. #douban-wrapper .grid{
  1424. overflow: initial;
  1425. }
  1426. .content-rounded #douban-wrapper div{
  1427. margin-left: 0;
  1428. }
  1429. #douban-wrapper #content .douban-icon .icon-pt1 {
  1430. background-image:none;
  1431. }
  1432. #douban-wrapper h2,#douban-wrapper h1{
  1433. border:none;
  1434. background-image: none;
  1435. background-color: transparent;
  1436. text-shadow: none;
  1437. padding: 0;
  1438. margin: 0
  1439. line-height: normal;
  1440. }
  1441. #douban-wrapper .grid-col5 {
  1442. font-size: 14px;
  1443. padding: 27px 14px 0 12px;
  1444. width: 190px;
  1445. overflow-y: auto;
  1446. height: 277px;
  1447. width: calc(100% - 225px - 254px - 36px - 280px);
  1448. }
  1449.  
  1450. #douban-wrapper .summary{
  1451. padding-top: 10px;
  1452. color: #000000;
  1453. line-height: 25px;
  1454. letter-spacing: 1px;
  1455. word-break: break-all;
  1456. font-weight: 400;
  1457. }
  1458. #douban-wrapper {
  1459. width: 100% !important;
  1460. }
  1461. .douban-dom>div{
  1462. width: 100%;
  1463. }
  1464. #douban-wrapper #content{
  1465. background-image:none !important;
  1466. background: #fff;
  1467. width: calc(100% - 20px) !important;
  1468. }
  1469. #douban-wrapper #content .grid{
  1470. width: 100% !important;
  1471. }
  1472. .bhd #douban-wrapper ::-webkit-scrollbar-track{
  1473. background-color: #fff;
  1474. }
  1475. .bhd #douban-wrapper ::-webkit-scrollbar-thumb{
  1476. background-color: #ddd;
  1477. }
  1478. .btn #douban-wrapper .grid-col1 {
  1479. display: none;
  1480. }
  1481. .hdb #douban-wrapper .grid-col1 {
  1482. display: none;
  1483. }
  1484. .hdt #douban-wrapper .grid-col1 {
  1485. display: none;
  1486. }
  1487. .sc #douban-wrapper .grid-col1 {
  1488. display: none;
  1489. }
  1490. .its #douban-wrapper .grid-col1 {
  1491. display: none;
  1492. }
  1493. .bb #douban-wrapper .grid-col1 {
  1494. display: none;
  1495. }
  1496. .btn #douban-wrapper .grid-col5 {
  1497. width: calc(100% - 254px - 36px - 280px);
  1498. }
  1499. .hdt #douban-wrapper .grid-col5 {
  1500. width: calc(100% - 254px - 36px - 280px);
  1501. }
  1502. .hdb #douban-wrapper .grid-col5 {
  1503. width: calc(100% - 254px - 36px - 280px);
  1504. }
  1505. .sc #douban-wrapper .grid-col5 {
  1506. width: calc(100% - 254px - 36px - 280px);
  1507. }
  1508. .its #douban-wrapper .grid-col5 {
  1509. width: calc(100% - 254px - 36px - 280px);
  1510. }
  1511. .bb #douban-wrapper .grid-col5 {
  1512. width: calc(100% - 254px - 36px - 280px);
  1513. }
  1514. .its #douban-wrapper {
  1515. background-color: #131313;
  1516. color: #fff;
  1517. }
  1518. `);
  1519.  
  1520. // src/index.js
  1521. (async () => {
  1522. if (CURRENT_SITE_INFO) {
  1523. const imdbId = getImdbId();
  1524. if (!imdbId) {
  1525. return;
  1526. }
  1527. try {
  1528. const savedIds = GM_getValue("ids") || {};
  1529. if (!savedIds[imdbId] || savedIds[imdbId] && savedIds[imdbId].updateTime && Date.now() - savedIds[imdbId].updateTime >= 30 * 24 * 60 * 60 * 1e3) {
  1530. let doubanId = "";
  1531. const movieData = await getDoubanInfoByIMDB(imdbId);
  1532. if (!movieData) {
  1533. throw new Error("\u6CA1\u6709\u627E\u5230\u8C46\u74E3\u6761\u76EE");
  1534. }
  1535. const {id = "", episodes = ""} = movieData;
  1536. doubanId = id;
  1537. if (episodes) {
  1538. const tvData = await getTvSeasonData(movieData);
  1539. doubanId = tvData.id;
  1540. }
  1541. if (CURRENT_SITE_NAME.match(/PTP/)) {
  1542. addToPtpPage(movieData);
  1543. } else if (CURRENT_SITE_NAME.match(/ANT/)) {
  1544. addToANTPage(movieData);
  1545. } else {
  1546. createDoubanDom(doubanId, imdbId);
  1547. }
  1548. } else {
  1549. const savedData = savedIds[imdbId];
  1550. if (CURRENT_SITE_NAME.match(/PTP/)) {
  1551. addToPtpPage(savedData);
  1552. } else if (CURRENT_SITE_NAME.match(/ANT/)) {
  1553. addToANTPage(savedData);
  1554. } else {
  1555. createDoubanDom(savedData.doubanId, imdbId, savedData);
  1556. }
  1557. }
  1558. } catch (error) {
  1559. console.log(error);
  1560. }
  1561. }
  1562. })();
  1563. })();