Sleazy Fork is available in English.

OneJAVOneWeb

老司机开车带你飞,一个插件畅览几大JAV网站

  1. /* globals $ */
  2. // ==UserScript==
  3. // @name OneJAVOneWeb
  4. // @namespace https://sleazyfork.org/zh-CN/scripts/428639-onejavoneweb
  5. // @version 2022.0703.1500
  6. // @description 老司机开车带你飞,一个插件畅览几大JAV网站
  7. // @author 匿名老司机
  8. // @license GPL
  9. // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAAAAAAAAQCEeRdzAAAC1klEQVR4nK1V/U+NYRg+/4kxHylUxsx8bD4yH7PxAxmzMfO9qemkcyo5NX1wyEhD6WSpOSXmGG1+UBZJ0rA5FErIGbIoSowu9/1e7znvOfNbvNuznef+uO7rvp/reY4N9f7VWFLQjbh0YHrG6JbmKoZg2ZBQEEB0Kh3xowTUNVkwBMtmoMc6gakOc6Uhgq3+jkljTNCmMVNkxadbMWqTfBti9gEOL/D4NdDaCTS/AFYeAaaZBZYeApqeA2tPEESTL9wFqu8RUGOWHQYedAEpVQI4yQ5U3kHEt70MxhjihNXFFtqKbsCIVabtAdq02MQUYE8F9/k+AdSA5VLBc4vGknpg9gG2sDgPGPpB+/WHnFOUnQz123wGGJsMHK3jfuMpAdQZaOX1J2nc6WGSzm3TaYu1v4ctqi+zhjbXJWBMEnC1DRj+CSw4aALqHLeUMCj5vLQr+yhhk3sF+PUb6JAWv34HFuaSZWIRYytuAxP2Ak+l2LN3xjgswK2lfwNebgUCfUBpA30bigk4NxvoHwIa24FZWcC3YaC2xWBvAW47awFqkp6yVm7qkGKmL6OGhfRkH3UDXR+BdSbbrFojj4DKaIfHAtSZzs8BBqTNm09EDpX0nWvkDHV5m8UvLN3X6DNlZQHuKrcAx8tcEiVgZCRSTtqiHpay1ANRf9sr4EO/KMNlaJSyUUZJppZ2l1MKTi/32raKfVDk8+YTZ6YERCKhr8HPsQk5m1xqXp8yU4c6k3HJbE+/FW5Kw9dm7RVwkWj0yyBtx+o4BgNQgXoH6Ah8pqg14X4nT3JONqVRWBem01Qy7emjTfUaYhhsTb88H4NnZALdvSLmt7x+0WEqcFZzRAr48j1ZzssJPR42I9lexcpq1Nugz9iqQrmSbj4Gup+5H1hzXBi7GKOFEvLlhhVbr44BGGsyMClbT5SDWgzuNSn8ydKluWoLe+oiH9h/WdHBB/Y//wX8ASlYtkPZ5uteAAAAAElFTkSuQmCC
  10. // @match *://*.javlibrary.com/*
  11. // @match *://onejav.com/*
  12. // @match *://*.141jav.com/*
  13. // @match *://*.jav321.com/*
  14. // @match *://*.javbus.com/*
  15. // @match *://hpjav.tv/*
  16. // @match *://hpav.tv/*
  17. // @match *://*.jav321.com/*
  18. // @match *://jable.tv/*
  19. // @match *://javdb.com/*
  20. // @match *://freejavbt.com/*
  21. // @match *://avmoo.click/*
  22. // @exclude *://*.javlibrary.com/*/login.php
  23. // @exclude *://*.javlibrary.com/login.php
  24. // @require https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js
  25. // @connect pics.dmm.co.jp
  26. // @connect jp.netcdn.space
  27. // @run-at document-idle
  28. // @grant window.close
  29. // @grant window.onurlchange
  30. // @grant GM_openInTab
  31. // @grant GM_xmlhttpRequest
  32. // @grant GM_registerMenuCommand
  33. // @grant GM_setValue
  34. // @grant GM_getValue
  35. // @grant GM_deleteValue
  36. // @grant GM_notification
  37. // @grant GM_getResourceURL
  38. // @grant GM_getResourceText
  39. // @grant GM_addStyle
  40. // @grant GM_info
  41. // ==/UserScript==
  42. (() => {
  43. 'use strict';
  44. // console.clear();
  45. console.time('JAV');
  46. console.info('老司机开车带你飞');
  47. console.info('%c ', "background:url('data:image/webp;base64,UklGRuwHAABXRUJQVlA4IOAHAADwPwCdASr6AMMAP73W42s+Mz+pJVNb8/A3iWluul/kqD+zFpTZw9sMvyF2y11qg8h2whWkpbWkvtEoaWWllpZaWR1OVKGZlnra5pOvQq7029DoqdKnSp0c78ZpY3HA+wn055XyL/m1dd7725iXfjD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R+Fkn3IInVIMK3J1TS3/JioevCgXOQGspIa54BjljlAlOWBac8k5OkxlIMnJACfK1w618NVR4Vfveh1lc7e4NXcveC+WgMxIvDFSTnGintZDgFnTSgN0sXIQFl3LjWcWSjnCGSh3vS0pK9JOLlX02SKfoIQJTdPJ6/0RWLjOQQvuUGUtUK3BXzfBE8cxwnlKD/eb0CngFF4+x1sVZOkOtkoCj7oR8dtNO/bNq6WMsYQsti34hxeB2n1VgR7pb9nm4WSZ2C/8eooC/dxdAuaDf9IdcKxPeF0r7gM7ucC+YTPY7+rJZKOAJd786pPauUL2OmpXZhsYmdgSN+rueQJPjizg168L4aoMYwnQtWkFSTvQ00mB8y6FFCCDpCF5UCAAA=') no-repeat;padding:98px 125px;");
  48. console.info('%cOneJAV插件使用了“思源黑体”字,请确保你的计算机安装了该字体\nhttps://github.com/adobe-fonts/source-han-sans/tree/release/OTF/SimplifiedChinese', 'margin:1px;border:3px solid orange;border-radius:5px;padding:3px;line-height:1.8;');
  49. console.info(`jQuery版本: ${$.fn.jquery}`);
  50. // @ts-ignore
  51. if (GM_getValue('data', '') != '') {
  52. let data = [];
  53. // @ts-ignore
  54. for (let item of GM_getValue('data')) {
  55. item.path = item.path.replace('{{fanHao}}', '{{fanhao}}');
  56. data.push(item);
  57. }
  58. // @ts-ignore
  59. GM_setValue('data', data);
  60. }
  61. const jav_configuration = {
  62. // @ts-ignore data
  63. data: GM_getValue('data', [
  64. { name: 'JAV目錄大全', color: '#fe1773', website: 'https://freejavbt.com', path: '/{{fanhao}}' },
  65. { name: '字幕', color: '#fdba29', website: 'https://www.subtitlecat.com', path: '/index.php?search={{fanhao}}' },
  66. { name: 'JAVMOVS', color: '#79c142', website: 'https://javmovs.com', path: '/{{fanhao}}' },
  67. { name: 'Javfree', color: '#df6e05', website: 'https://javfree.sh', path: '/search/movie/{{fanhao}}' },
  68. { name: 'HPJAV', color: '#f96364', website: 'https://hpjav.tv', path: '/?s={{fanhao}}' },
  69. { name: 'JAVHD', color: '#cb000d', website: 'https://javhd.today', path: '/search/video/?s={{fanhao}}' },
  70. { name: 'JAVTRUST', color: '#e38a5a', website: 'https://javtrust.com', path: '/search/movie/{{fanhao}}.html' },
  71. { name: 'JAVFUN', color: '#79c142', website: 'https://www3.javfun.me', path: '/search/{{fanhao}}' },
  72. { name: 'BEJAV', color: '#fd6500', website: 'https://bejav.net', path: '/search/{{fanhao}}' },
  73. { name: 'SEXTOP', color: '#c20001', website: 'https://sextop.net', path: '/?s={{fanhao}}&search=Search' },
  74. { name: 'JAVDISK', color: '#fe121e', website: 'https://javdisk.com', path: '/search.html?q={{fanhao}}' },
  75. { name: 'SUPJAV', color: '#d8201d', website: 'https://supjav.com', path: '/?s={{fanhao}}' },
  76. { name: 'SVJAV', color: '#cc2748', website: 'https://svjav.com', path: '/{{fanhao}}/' },
  77. { name: 'FBJAV', color: '#365899', website: 'https://fbjav.com', path: '/{{fanhao}}/' },
  78. { name: 'JAVPLAYER', color: '#2a6fd1', website: 'https://javplayer.org', path: '/v/{{fanhao}}/' },
  79. { name: 'JAVHDPorn', color: '#fa9f22', website: 'https://www2.javhdporn.net', path: '/video/{{fanhao}}/' },
  80. { name: 'JAVHHH', color: '#da2657', website: 'https://javhhh.com', path: '/video/{{fanhao}}/' },
  81. { name: 'KISSJAV', color: '#00a2e8', website: 'https://kissjav.com', path: '/search/video/?s={{fanhao}}' },
  82. { name: 'JAVSKY', color: '#ca6e00', website: 'https://javsky.tv', path: '/search/movie/{{fanhao}}' },
  83. { name: 'JavDragon', color: '#ec4caf', website: 'https://javdragon.com', path: '/{{bango}}/' },
  84. { name: 'JAVBEL', color: '#ff5b15', website: 'https://javbel.com', path: '/search.php?q={{fanhao}}' },
  85. { name: 'Javmix', color: '#f7c54c', website: 'https://javmix.tv', path: '/video/{{fanhao}}/' },
  86. { name: 'JAV-FOR', color: '#f0542e', website: 'https://jav-for.me', path: '/' },
  87. { name: 'GGJAV', color: '#2287f0', website: 'https://ggjav.com', path: '/ja/main/search?string={{fanhao}}' },
  88. { name: 'JavOnline', color: '#29bac6', website: 'https://www.onejav.online', path: '/?s={{fanhao}}' },
  89. { name: 'JAVCL', color: '#ffcc00', website: 'https://javcl.com', path: '/search/{{fanhao}}/' },
  90. { name: 'JAV321', color: '#777', website: 'https://www.jav321.com', path: '/?bango={{fanhao}}' },
  91. { name: 'Jable', color: '#0077ac', website: 'https://jable.tv', path: '/search/{{fanhao}}/' },
  92. { name: 'JavDB', color: '#0a0a0a', website: 'https://javdb.com', path: '/search?q={{fanhao}}' },
  93. { name: 'OneJAV', color: '#f5da47', website: 'https://onejav.com', path: '/search/{{bango}}' },
  94. { name: 'AVMOO', color: '#cc0000', website: 'https://avmoo.click', path: '/cn/search/{{fanhao}}' },
  95. { name: 'JavBus', color: '#febe00', website: 'https://www.javbus.com', path: '/search/{{fanhao}}' },
  96. {
  97. name: 'JAVLibrary',
  98. color: '#f908bb',
  99. website: 'https://www.javlibrary.com',
  100. path: '/cn/vl_searchbyid.php?keyword={{fanhao}}'
  101. },
  102. { name: 'SEXTB', color: '#f5c823', website: 'https://sextb.net', path: '/{{fanhao}}' },
  103. { name: 'JAVGG', color: '#151515', website: 'https://javgg.net', path: '/jav/{{fanhao}}/' }
  104. ]),
  105. // @ts-ignore auto_jump
  106. auto_jump: GM_getValue('auto_jump', true)
  107. };
  108. const html_table_tr_remove = (row) => `<tr data>
  109. <td name><input type="text" style="color:${row.color};" value="${row.name}"></td>
  110. <td color><input type="text" value="${row.color}"></td>
  111. <td website><input type="text" value="${row.website}"></td>
  112. <td path><input type="text" value="${row.path}"></td>
  113. <td class="jav_remove" remove></td>
  114. </tr>`;
  115. const html_table_tr_add = () => `<tr add>
  116. <td name><input type="text" title="名称"></td>
  117. <td color><input type="text" title="颜色"></td>
  118. <td website><input type="text" title="网站"></td>
  119. <td path><input type="text" title="路径"></td>
  120. <td class="jav_add" add></td>
  121. </tr>`;
  122. const jav_open_setting_panel = () => {
  123. let settingHtml = `<div id="jav_mask" class="jav_mask">
  124. <div id="jav_setting_panel" class="jav_setting_panel">
  125. <div class="jav_table">
  126. <table>
  127. <thead>
  128. <tr>
  129. <th>名称</th>
  130. <th>颜色</th>
  131. <th>网站</th>
  132. <th>路径</th>
  133. <th>⚙</th>
  134. </tr>
  135. </thead>
  136. <tbody></tbody>
  137. </table>
  138. </div>
  139. <div class="info">
  140. <span>{{fanhao}}:abc-123型番号</span>
  141. <span>{{FANHAO}}:ABC-123型番号</span>
  142. <span>{{bango}}:abc123型番号</span>
  143. <span>{{BANGO}}:ABC123型番号</span>
  144. <span><a target="_blank" href="https://sleazyfork.org/zh-CN/scripts/428639-onejavoneweb">添加镜像站点支持方法</a></span>
  145. </div>
  146. <div>
  147. <label for="auto_jump">一个查询结果时自动跳转</label>
  148. <input type="radio" name="auto_jump" value="true">开
  149. <input type="radio" name="auto_jump" value="false">关
  150. </div>
  151. <div>
  152. <button id="jav_setting_save" class="jav_button_ok">保存并退出</button>
  153. <button id="jav_setting_cancel" class="jav_button_cancel">取消并退出</button>
  154. </div>
  155. </div>
  156. </div>`;
  157. $('body').append(settingHtml);
  158. $('input[name="auto_jump"]')
  159. .eq(0)
  160. .prop('checked', jav_configuration.auto_jump ? true : false);
  161. $('input[name="auto_jump"]')
  162. .eq(1)
  163. .prop('checked', jav_configuration.auto_jump ? false : true);
  164. for (let row of jav_configuration.data) {
  165. $('#jav_setting_panel>.jav_table>table').append(html_table_tr_remove(row));
  166. }
  167. $('#jav_setting_panel>.jav_table>table').append(html_table_tr_add());
  168. };
  169. // @ts-ignore
  170. GM_registerMenuCommand('🛠设置', jav_open_setting_panel);
  171. // @ts-ignore
  172. GM_registerMenuCommand('更新', () => {
  173. // @ts-ignore
  174. GM_openInTab('https://sleazyfork.org/zh-CN/scripts/428639-onejavoneweb', {
  175. active: true,
  176. insert: true,
  177. setParent: true
  178. });
  179. });
  180. // @ts-ignore
  181. GM_registerMenuCommand('下载思源黑体字体', () => {
  182. // @ts-ignore
  183. GM_openInTab('https://cdn.jsdelivr.net/gh/adobe-fonts/source-han-sans@release/OTF/SimplifiedChinese/SourceHanSansSC-Regular.otf', { active: true, insert: true, setParent: true });
  184. });
  185. // @ts-ignore basic style
  186. GM_addStyle(`.absolute{position:absolute}.relative{position:relative}.jav_tab{overflow:auto;width:410px;max-height:300px;display:flex;flex-direction:column;flex-wrap:wrap;text-align:start;font-family:"思源黑体";font-weight:700;font-size:18px;z-index:999;background-color:#fff}.jav_tab .jav_web{line-height:1.6;cursor:pointer;box-sizing:border-box;border:1px solid #eee}.jav_tab .jav_web:hover{box-shadow:-1px -1px 2px #acacac,1px 1px 2px #acacac}.jav_tab .jav_web:last-child{color:#000}.jav_mask{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;background-color:rgba(0,0,0,.8)}.jav_mask .jav_setting_panel{width:800px;max-height:700px;padding:20px 0 20px 10px;background-color:#fff;color:#000;border-radius:20px;transform:translateX(-50%) translateY(-50%);position:fixed;top:50%;left:50%;overflow-y:auto;font-family:"思源黑体";font-size:16px;line-height:1.6;display:flex;flex-direction:column;text-align:start}.jav_mask .jav_setting_panel .jav_table{max-height:400px;overflow-y:auto}.jav_mask .jav_setting_panel .jav_table table{border-collapse:collapse}.jav_mask .jav_setting_panel .jav_table table thead th{height:40px;border:0;margin:0;padding:1px 2px;text-align:center}.jav_mask .jav_setting_panel .jav_table table tbody td{border:0;margin:0;padding:1px 2px}.jav_mask .jav_setting_panel .jav_table table tbody td>input{font-size:16px;width:180px;height:32px}.jav_mask .jav_setting_panel .jav_table table tbody td:nth-child(1)>input{width:140px;font-weight:700}.jav_mask .jav_setting_panel .jav_table table tbody td:nth-child(2)>input{width:90px}.jav_mask .jav_setting_panel .jav_table table tbody td:nth-child(4)>input{width:290px}.jav_mask .jav_setting_panel .jav_table table tbody td:last-child{text-align:center}.jav_mask .jav_setting_panel .jav_table .jav_remove{cursor:pointer}.jav_mask .jav_setting_panel .jav_table .jav_remove::after{content:"➖";background-color:red}.jav_mask .jav_setting_panel .jav_table .jav_add{cursor:pointer}.jav_mask .jav_setting_panel .jav_table .jav_add::after{content:"➕";background-color:#adff2f}.jav_mask .jav_setting_panel>.info{padding:8px 0;display:flex;flex-direction:row;justify-content:space-around}.jav_mask .jav_setting_panel>.info>span{color:#000;font-size:12px}.jav_mask .jav_setting_panel button{font-weight:500;text-decoration:none;text-align:center;display:inline-block;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;border:none;box-sizing:border-box;transition-property:all;transition-duration:.3s;border-radius:4px;font-size:16px;height:30px;line-height:30px;padding:0 30px;margin:5px;color:#fff}.jav_mask .jav_setting_panel button.jav_button_ok{background-color:#1b9af7;border-color:#1b9af7}.jav_mask .jav_setting_panel button.jav_button_cancel{background-color:#a5a5a5;border-color:#a5a5a5}.jav_anima_remove{-webkit-animation:jav_anima_remove .7s forwards;animation:jav_anima_remove .7s forwards}@-webkit-keyframes jav_anima_remove{from{opacity:1}to{opacity:0}}@keyframes jav_anima_remove{from{opacity:1}to{opacity:0}}`);
  187. // @ts-ignore basic data
  188. class JAV {
  189. constructor(i) {
  190. this.data = [];
  191. [this.bango, this.fanhao, this.BANGO, this.FANHAO] = (() => {
  192. const o = i.trim().replace(/ +/, '-');
  193. let t = o.match(/FC2-?PPV-?(\d+)/i);
  194. if ((t = o.match(/FC2-?PPV-?(\d+)/i))) {
  195. return [`FC2PPV${t[1]}`, `FC2PPV-${t[1]}`];
  196. }
  197. else if ((t = o.match(/([a-zA-Z]+)-?(\d+)/i))) {
  198. return [
  199. `${t[1].toLowerCase()}${t[2]}`,
  200. `${t[1].toLowerCase()}-${t[2]}`,
  201. `${t[1].toUpperCase()}${t[2]}`,
  202. `${t[1].toUpperCase()}-${t[2]}`
  203. ];
  204. }
  205. else {
  206. console.info(`JAV:${i}处理失败,反馈给作者修复bug`);
  207. return [i, i, i, i];
  208. }
  209. })();
  210. for (let item of jav_configuration.data) {
  211. item.url = this.render(`${item.website}${item.path}`);
  212. this.data.push(item);
  213. }
  214. }
  215. render(i) {
  216. return i
  217. .replace('{{fanhao}}', this.fanhao)
  218. .replace('{{bango}}', this.bango)
  219. .replace('{{FANHAO}}', this.FANHAO)
  220. .replace('{{BANGO}}', this.BANGO);
  221. }
  222. create_table(position = 0) {
  223. let html = ``;
  224. for (let index in this.data) {
  225. let i = Number(index);
  226. html += `<div class="jav_web"><a style="text-decoration:none;color:${this.data[i].color};" target="_blank" href="${this.data[i].url}">${this.data[i].name}</a></div>`;
  227. }
  228. html += `<div id="jav_setting_button" class="jav_web">🛠设置</div>`;
  229. if (position == 0) {
  230. // absolute
  231. html = `<div id="jav_tab" class="jav_tab absolute">${html}</div>`;
  232. }
  233. else {
  234. // inherit
  235. html = `<div id="jav_tab" class="jav_tab">${html}</div>`;
  236. }
  237. return html;
  238. }
  239. }
  240. $('body').on('click', '#jav_setting_button', jav_open_setting_panel);
  241. $('body').on('input', 'td[color]>input', function () {
  242. $(this).parents('tr').find('td[name]>input').eq(0).css('color', $(this).val().toString());
  243. return false;
  244. });
  245. $('body').on('click', 'td[remove]', function () {
  246. let parent = $(this).parent();
  247. parent.addClass('jav_anima_remove');
  248. setTimeout(() => {
  249. parent.remove();
  250. }, 500);
  251. return false;
  252. });
  253. $('body').on('click', 'td[add]', function () {
  254. let name = $(this).siblings('td[name]').find('input').eq(0).val().toString().trim();
  255. let color = $(this).siblings('td[color]').find('input').eq(0).val().toString().trim();
  256. let website = $(this).siblings('td[website]').find('input').eq(0).val().toString().trim();
  257. let path = $(this).siblings('td[path]').find('input').eq(0).val().toString().trim();
  258. if (name == '' || color == '' || website == '' || path == '') {
  259. alert('填入内容不能为空');
  260. return false;
  261. }
  262. $('tr[add]').before(html_table_tr_remove({ name, color, website, path }));
  263. $('tr[add]').find('input').val('');
  264. $('.jav_table')[0].scrollTo(0, $('.jav_table')[0].scrollHeight);
  265. return false;
  266. });
  267. $('body').on('click', '#jav_setting_save', () => {
  268. let data = new Array();
  269. for (let e of $('tr[data]')) {
  270. let name = $(e).find('input[type="text"]').eq(0).val().toString();
  271. let color = $(e).find('input[type="text"]').eq(1).val().toString();
  272. let website = $(e).find('input[type="text"]').eq(2).val().toString();
  273. let path = $(e).find('input[type="text"]').eq(3).val().toString();
  274. data.push({ name, color, website, path });
  275. }
  276. let auto_jump = $('input[name="auto_jump"]:checked').val() == 'true' ? true : false;
  277. $('#jav_mask').remove();
  278. // @ts-ignore save configuration
  279. GM_setValue('data', data);
  280. // @ts-ignore save configuration
  281. GM_setValue('auto_jump', auto_jump);
  282. return false;
  283. });
  284. $('body').on('click', '#jav_setting_cancel', () => {
  285. $('#jav_mask').remove();
  286. return false;
  287. });
  288. /* OneJAV 141jav */
  289. if ($('body div.container div.card.mb-3 div.container div.columns div.column:even')[0]) {
  290. (() => {
  291. console.info('适配OneJAV 141jav');
  292. $('body').on('mouseenter', 'div.container div.card.mb-3 div.container div.columns div.column:even', function () {
  293. const bango = $(this)
  294. .siblings('div.column.is-5')
  295. .find('div.card-content.is-flex h5.is-4.is-spaced.title a')
  296. .text()
  297. .trim();
  298. const jav = new JAV(bango);
  299. $(this).prepend(jav.create_table());
  300. return false;
  301. });
  302. $('body').on('mouseleave', 'div.container div.card.mb-3 div.container div.columns div.column:even', function () {
  303. $(this).find('#jav_tab').remove();
  304. return false;
  305. });
  306. })();
  307. }
  308. else if ($('body div.container nav.box.breadcrumb ul li.is-active')[0]) {
  309. (() => {
  310. console.info('适配OneJAV 141jav');
  311. // Show a table without no search reasult
  312. const jav = new JAV(location.pathname.substr(8));
  313. $('body>div.container').append(jav.create_table(1));
  314. })();
  315. }
  316. /* avmoo javbus */
  317. if ($('body div.container div.movie.row div.col-md-9.screencap')[0]) {
  318. (() => {
  319. console.info('适配avmoo javbus');
  320. $('body').on('mouseenter', 'div.container div.movie.row div.col-md-9.screencap', function () {
  321. const bango = $('body div.container h3').text().trim().split(' ')[0];
  322. const jav = new JAV(bango);
  323. $(this).prepend(jav.create_table());
  324. return false;
  325. });
  326. $('body').on('mouseleave', 'div.container div.movie.row div.col-md-9.screencap', function () {
  327. $(this).find('#jav_tab').remove();
  328. return false;
  329. });
  330. $('body div.container div#sample-waterfall a.sample-box').each((_, a) => {
  331. // @ts-ignore
  332. GM_xmlhttpRequest({
  333. method: 'GET',
  334. url: a.href,
  335. responseType: 'blob',
  336. onload: (res) => {
  337. const blob = new Blob([res.response], { type: 'image/jpeg' });
  338. a.href = URL.createObjectURL(blob);
  339. }
  340. });
  341. });
  342. })();
  343. }
  344. else if ($('body div.container-fluid div.row div div.item a.movie-box').length == 1 &&
  345. jav_configuration.auto_jump) {
  346. (() => {
  347. location.href = $('body div.container-fluid div.row div div.item a.movie-box')[0].href;
  348. })();
  349. }
  350. /* javlibarary */
  351. if ($('body.main div#content div#rightcolumn table#video_jacket_info tbody tr td div#video_jacket')[0]) {
  352. (() => {
  353. console.info('适配javlibrary');
  354. const style = `.pointer,#javlibrary_modal *{cursor:pointer}#javlibrary_modal{color:#dcdcdc;font-size:64px;font-weight:700;font-family:"思源黑体";background-color:rgba(0,0,0,.8);position:fixed;top:0;right:0;bottom:0;left:0;z-index:99}#javlibrary_modal img{cursor:default;transform:translateX(-50%) translateY(-50%);position:absolute;top:50%;right:auto;bottom:auto;left:50%}#javlibrary_modal #left{transform:translateY(-50%);position:absolute;top:50%;right:auto;bottom:auto;left:10px}#javlibrary_modal #left::after{content:"◀"}#javlibrary_modal #left:hover{color:#fff}#javlibrary_modal #right{transform:translateY(-50%);position:absolute;top:50%;right:10px;bottom:auto;left:auto}#javlibrary_modal #right::after{content:"▶"}#javlibrary_modal #right:hover{color:#fff}#javlibrary_modal #close{position:absolute;top:0;right:10px;bottom:auto;left:auto}#javlibrary_modal #close::after{content:"✖"}#javlibrary_modal #close:hover{color:#fff}`;
  355. $('head').append(`<style>${style}</style>`);
  356. const sourceArr = $('body.main div#content div#rightcolumn div.previewthumbs>img').map((_, img) => {
  357. return img.src;
  358. });
  359. const srcArr = sourceArr.map((_, source) => {
  360. const match = source.match(/digital\/video\/(\w+)\/\1-(\d+.jpg)/i);
  361. if (match != null) {
  362. return source.replace(match[0], `digital/video/${match[1]}/${match[1]}jp-${match[2]}`);
  363. }
  364. else {
  365. return source;
  366. }
  367. });
  368. srcArr.each((index, src) => {
  369. // @ts-ignore
  370. GM_xmlhttpRequest({
  371. method: 'GET',
  372. url: src,
  373. responseType: 'blob',
  374. onload: (res) => {
  375. const blob = new Blob([res.response], { type: 'image/jpeg' });
  376. srcArr[index] = URL.createObjectURL(blob);
  377. }
  378. });
  379. });
  380. const modal = $(`<div id="javlibrary_modal"><img src="/img/logo-top.png" alt="预览大图"/><div id="left"></div><div id="right"></div><div id="close"></div></div>`);
  381. $('body.main div#content div#rightcolumn div.previewthumbs>img').each(function (index, img) {
  382. $(img).addClass('pointer');
  383. $(img).on('click', () => {
  384. modal.find('img')[0].src = srcArr[index];
  385. $('body').append(modal);
  386. let i = 0;
  387. $('body').on('click', '#javlibrary_modal>#left', () => {
  388. i -= 1;
  389. if (i < 0) {
  390. i = srcArr.length - 1;
  391. }
  392. $('#javlibrary_modal>img')[0].src = srcArr[i];
  393. return false;
  394. });
  395. $('body').on('click', '#javlibrary_modal>#right', () => {
  396. i += 1;
  397. if (i > srcArr.length - 1) {
  398. i = 0;
  399. }
  400. $('#javlibrary_modal>img')[0].src = srcArr[i];
  401. return false;
  402. });
  403. $('body').on('click', '#javlibrary_modal>img', () => {
  404. return false;
  405. });
  406. $('body').on('click', '#javlibrary_modal', () => {
  407. $('#javlibrary_modal').remove();
  408. $('body').off('keydown.onejav');
  409. return false;
  410. });
  411. $('body').on('keydown.onejav', (event) => {
  412. if (event.key == 'ArrowLeft') {
  413. $('#javlibrary_modal>#left').trigger('click');
  414. }
  415. else if (event.key == 'ArrowRight') {
  416. $('#javlibrary_modal>#right').trigger('click');
  417. }
  418. else if (event.key == 'Escape') {
  419. $('#javlibrary_modal').trigger('click');
  420. }
  421. return false;
  422. });
  423. return false;
  424. });
  425. });
  426. $('body').on('mouseenter', '#video_jacket', function () {
  427. const bango = $('#video_title > h3').text().trim().split(' ')[0];
  428. const jav = new JAV(bango);
  429. $(this).prepend(jav.create_table());
  430. return false;
  431. });
  432. $('body').on('mouseleave', '#video_jacket', function () {
  433. $(this).find('#jav_tab').remove();
  434. return false;
  435. });
  436. })();
  437. }
  438. else if ($('body.main div#content div#rightcolumn div.videothumblist div.videos div.video')[0]) {
  439. (() => {
  440. console.info('适配javlibrary');
  441. $('body').on('mouseenter', 'div#content div#rightcolumn div.videothumblist div.videos div.video', function () {
  442. const bango = $(this).find('.id').text().trim().split(' ')[0];
  443. const jav = new JAV(bango);
  444. const html = `<div class="jav_library_newBox" style="position:absolute;z-index:9999;top:0;right:0;"></div>`;
  445. let jav_library_newBox = $(html);
  446. const list = ['onejav', 'avmoo', 'javdb', 'jable'];
  447. // @ts-ignore
  448. for (let row of jav.data) {
  449. if (list.includes(row.name.toLowerCase())) {
  450. jav_library_newBox.append(`<button style="display:block;" link="${row.url}">${row.name}</button>`);
  451. }
  452. }
  453. $(this).prepend(jav_library_newBox);
  454. return false;
  455. });
  456. $('body').on('click', 'div#content div#rightcolumn div.videothumblist div.videos div.video div.jav_library_newBox button', function () {
  457. window.open($(this).attr('link'));
  458. return false;
  459. });
  460. $('body').on('mouseleave', 'div#content div#rightcolumn div.videothumblist div.videos div.video', function () {
  461. $(this).find('.jav_library_newBox').remove();
  462. return false;
  463. });
  464. })();
  465. }
  466. /* jav321 */
  467. if ($('body div.row div.col-md-7.col-md-offset-1.col-xs-12 div.panel.panel-info div.panel-body div.row div.col-md-9')[0]) {
  468. (() => {
  469. console.info('适配jav321');
  470. if (location.pathname.match(/\/video\/[a-zA-Z0-9-]+/i)) {
  471. const hinban = $('body div.row div.col-md-7.col-md-offset-1.col-xs-12 div.panel.panel-info div.panel-body div.row div.col-md-9')
  472. .text()
  473. .match(/品番: ([a-zA-Z0-9-]+)/i);
  474. const jav = new JAV(hinban[1]);
  475. $('body div.row div.col-md-7.col-md-offset-1.col-xs-12 div.panel.panel-info div.panel-body')
  476. .eq(0)
  477. .append(jav.create_table(1));
  478. }
  479. })();
  480. }
  481. else if ($("body div.row div.col-md-10.col-md-offset-1.col-xs-12 nav.navbar.navbar-default div.container-fluid form.navbar-form.navbar-left div.form-group.input-group input.form-control[placeholder='品番']")[0]) {
  482. (() => {
  483. const searchParams = new URLSearchParams(location.search.substr(1));
  484. if (undefined != searchParams.get('bango')) {
  485. $("body div.row div.col-md-10.col-md-offset-1.col-xs-12 nav.navbar.navbar-default div.container-fluid form.navbar-form.navbar-left div.form-group.input-group input.form-control[placeholder='品番']")
  486. .eq(0)
  487. .val(searchParams.get('bango'));
  488. $('body > div:nth-child(2) > div > nav > div > form:nth-child(2) > div > span > button')[0].click();
  489. window.close();
  490. }
  491. })();
  492. }
  493. /* hpjav */
  494. if ($('body div.container.video-box-ather div.container div.col-md-12.video-countext div.col-md-5')[0]) {
  495. (() => {
  496. console.info('适配hpjav');
  497. $('body div.container.video-box-ather div.container div.col-md-12.video-countext div.col-md-5').on('mouseenter', function () {
  498. const bango = location.pathname.slice(location.pathname.lastIndexOf('/') + 1).toUpperCase();
  499. const jav = new JAV(bango);
  500. $(this).prepend(jav.create_table());
  501. return false;
  502. });
  503. $('body div.container.video-box-ather div.container div.col-md-12.video-countext div.col-md-5').on('mouseleave', function () {
  504. $(this).find('#jav_tab').remove();
  505. return false;
  506. });
  507. })();
  508. }
  509. /* jable */
  510. if ($('body.no-touch div#site-content.site-content div.container div.row div.col section.pb-3.video-info')[0]) {
  511. (() => {
  512. console.info('适配jable');
  513. const matches = location.pathname.match(/\/videos\/([a-zA-Z0-9-]+)\//i);
  514. if (matches) {
  515. const jav = new JAV(matches[1]);
  516. $('body.no-touch div#site-content.site-content div.container div.row div.col section.pb-3.video-info')
  517. .eq(0)
  518. .append(jav.create_table(1));
  519. }
  520. })();
  521. }
  522. /* javdb */
  523. if ($('body section.section div.container div.video-detail div.video-meta-panel div.columns.is-desktop div.column nav.movie-panel-info.panel div.first-block.panel-block span.value')[0]) {
  524. (() => {
  525. console.info('适配javdb');
  526. const bango = $('body section.section div.container div.video-detail div.video-meta-panel div.columns.is-desktop div.column nav.movie-panel-info.panel div.first-block.panel-block span.value')
  527. .eq(0)
  528. .text()
  529. .trim()
  530. .split(' ')[0];
  531. const jav = new JAV(bango);
  532. $('body section.section div.container div.video-detail div.video-meta-panel').eq(0).after(jav.create_table(1));
  533. })();
  534. }
  535. /* Free JAV BT */
  536. if ($('body div.col-lg-10.col-md-10.col-sm-12.col-xl-8.container div.pb-4.video-all-info-wrapper div.col-lg-12.col-md-12.col-sm-12.container.single-video div.row div.col-lg-4.col-md-4.col-sm-12.p-lg-4.p-md-1.single-video-info div.code.d-flex.single-video-meta')[0]) {
  537. (() => {
  538. console.info('适配freejavbt');
  539. const hinban = $('body div.col-lg-10.col-md-10.col-sm-12.col-xl-8.container div.pb-4.video-all-info-wrapper div.col-lg-12.col-md-12.col-sm-12.container.single-video div.row div.col-lg-4.col-md-4.col-sm-12.p-lg-4.p-md-1.single-video-info div.code.d-flex.single-video-meta').eq(0);
  540. const bango = `${hinban.children('a').eq(0).text()}${hinban.children('span:last-child').eq(0).text()}`;
  541. const jav = new JAV(bango);
  542. $('body div.col-lg-10.col-md-10.col-sm-12.col-xl-8.container div.pb-4.video-all-info-wrapper')
  543. .eq(0)
  544. .append(jav.create_table(1));
  545. })();
  546. }
  547. console.timeEnd('JAV');
  548. })();