OneJAVOneWeb

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

Version vom 29.06.2022. Aktuellste Version

  1. /* globals $ */
  2. // ==UserScript==
  3. // @name OneJAVOneWeb
  4. // @namespace https://sleazyfork.org/zh-CN/scripts/428639-onejavoneweb
  5. // @version 2022.0629.2100
  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 *://*.n53i.com/*
  12. // @match *://onejav.com/*
  13. // @match *://*.141jav.com/*
  14. // @match *://*.jav321.com/*
  15. // @match *://*.javbus.com/*
  16. // @match *://hpjav.tv/*
  17. // @match *://hpav.tv/*
  18. // @match *://*.jav321.com/*
  19. // @match *://jable.tv/*
  20. // @match *://javdb.com/*
  21. // @include /^.*://.*?(busjav|buscdn|busdmm|dmmbus|seedmm|dmmsee).*?\..+$/
  22. // @include /^.*://.*?avmoo.*?\..+$/
  23. // @include /^.*://javdb3\d+\.com.+$/
  24. // @exclude *://*.javlibrary.com/*/login.php
  25. // @exclude *://*.javlibrary.com/login.php
  26. // @exclude *://*.n53i.com/*/login.php
  27. // @exclude *://*.n53i.com/login.php
  28. // @require https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js#sha256=668b046d12db350ccba6728890476b3efee53b2f42dbb84743e5e9f1ae0cc404
  29. // @connect pics.dmm.co.jp
  30. // @connect jp.netcdn.space
  31. // @run-at document-end
  32. // @grant window.close
  33. // @grant window.onurlchange
  34. // @grant GM_openInTab
  35. // @grant GM_xmlhttpRequest
  36. // @grant GM_registerMenuCommand
  37. // @grant GM_setValue
  38. // @grant GM_getValue
  39. // @grant GM_deleteValue
  40. // @grant GM_notification
  41. // @grant GM_getResourceURL
  42. // @grant GM_getResourceText
  43. // @grant GM_addStyle
  44. // @grant GM_info
  45. // ==/UserScript==
  46. (() => {
  47. 'use strict';
  48. // console.clear();
  49. console.time('JAV');
  50. console.info('老司机开车带你飞');
  51. console.info('%c ', "background:url('data:image/webp;base64,UklGRuwHAABXRUJQVlA4IOAHAADwPwCdASr6AMMAP73W42s+Mz+pJVNb8/A3iWluul/kqD+zFpTZw9sMvyF2y11qg8h2whWkpbWkvtEoaWWllpZaWR1OVKGZlnra5pOvQq7029DoqdKnSp0c78ZpY3HA+wn055XyL/m1dd7725iXfjDytfKSHSp0qdKd71ckRIpADV2m/Mkw8FwVeBM2XRrV0MJSRVbZfvDvgLh0LTsEqEyypZZqISINwf9ika2p4wRx1fMsnVI8U1QvK0XAv06K2I1ipt+M2ItuLhcsFV3QoBqW9l6nuP9s56mwdze7yGHwELVFJuZMivik5ythHrcjqIQVFMLkBPXMnVJJZRj4iSPYRCE8VMoGNe9e14cVjv9zXk25u11RWnn7Gpl28lncNDHKa3zhh8E1mT6kM0CLXK6g4SZMeZXtoBfWmYNnTqtBZztjUClntjbq8KeaypBOfKZj2FuQhniqnbf5+VF7Qygac942ifgAL8SUdTIOk2u73Yp+e4aSkWVEjeKiMkXGOxddnCxRyPUj1I9TCYM7CmdxgOakyZXfGdHUgeDU3CB5ijLTnILnP/QsgOgEvun/YK79fTns4MqUKOGep4U1QYFDji8k+iUzgdgkMM3m3QBGTXqnSCpAW3sc6Um3XiOKqN+Dre2u+w22aipm/x4UPCY0k3X2SatQG/GojaI9dkxPSH3+keTQbGUAAP7sjm1NTEhPA+8TIfKGmQAG7A2lTthdbtV59/Me/j5+hirPcPUYbLi6/ZIYL4NXX50yNQ7siOkgpTUdmkvYL9M3fcC+TLTWNtpvJ2kRHfEMYpIeAAbWoVhHlDh9U2IVF0Yw/dWOfLjXc+AfdMKg1je7+jGWyiLdAPe8DWl5rvuNmSQJ4WGchw3VTjF5TqRJE1J+XYdkexDfsNgBpDduRc6jEl7Ki3WoMvLaXg39p66FGxrqhLZSN6kWT++8FwBi3tG9Ax1s5xZEsggMnO5+TJbRkohd63GQIMB+fvfRNOu9D8+BRojbZGLE/JjEdjU4F8y/dLJsk+KhHDCd4bdMYnDOPV+U/8r8S9IqKXcrPLfjLyW+8txzhtveeM1mjAihAi8v66Niq/CU07vhLX3VFOqK6tSq1q0rjeeCGk1f0JyoyX6vUSZxrEJXzU1JByvOIJYeo/qCsUaSADc5Hwd9GOOJ14VBUtkv98l3l2d4BaMPT3Y+Cdmqrg/tSBa2AvUSYo/ge/cu8uCH6C50PDIscaZt8bRu6QjHf6raBFxYxzv1Ridgw+ocEqcrQOb7/fKYkBvlCLy+6YKQQTyDmdxwYkUBBazxJsFHEsAe5jS7/ZJtFR8LeQaME3NjorHBaPMQUpVMcw/lJXhN+EahmZ72ZwaP0ZqND3+K1iguFHbYkK72fQyD2hYyDpXCKQuYuMNTeEvCYPtaWKE/HxkypM0okkrcDYuYILd/pcSAAo2Fnityz3uHO/SX9hs1J5ADfrpgxo+UPo3z/Y63h5KTIG8T8r01MLekOJMLPeFN8k5LCwtTTvQ0gPYf6WHAdD0g8htz2dEeQ4458XdMV0FX89xRO7JjutezNTsI7pt29zZAe6YevYCxfJ9Mr3JOodrZ39daLfNb2bMEWMUyMrjcPbpbXg3p/7x7REBSxSDsznru8TDk9InE0ykIVMfJvC67oDiEEFCX1QLMDG18wOphsOVwveWQBL0v3TNkxmTE5Z3c0IjnM1zLFJclcLvc1unnY2ArjhZkpnxVV02rbAlN4Q4BEjsQAPjYR7+93zxsR9dQ/wsEP6BRHH5GqOqbqW6hJZEzXopZkiKxp3u1jPtmGZK3YsmA7ZuDQatzot6sjJgNobuT0rfBXmwO0e49TUFclvHWFuAJARVz5o9K/9iias70D4f5FrCWzLAF0iHByo+lGDTNjCCoA/rSaEZqFQRINJC/jj6+rVhbAE3MiyYlXNiI63n2hKkuf/HvTdhDOWFxY26Y1pK63ZIXhlcfP3ROgU6VwyQtlPzxB/3sgAMud9ajQhZCX+SzQNb2tz1SFGRIJNhrv40LNx+J3FwKQg9uZ4ma//EFMucQ0RgyQODB3XKhqKPD27MOgclZKHIYZxYUPrss+pmERSLVRAu8DzrvUR8kaFsWLJFOrK8DkwgRt5LeU9vMADz6E3x3pBCAvZ/Uod3HK5vNvLUtTEA4Wm/gL6AqjD84M1McsYYTT2csc0gAOjHyOQ1DC/67x+Vpu0znze2fpy4VWfuAjIXQQOY9p+s73sBWjZPDPb5zCiXgsF7FtY/fcuAjkbBVziDQrns0/+tKZ6+TGZ0y5OIz768RUSorrPbI9OThAoR+Fkn3IInVIMK3J1TS3/JioevCgXOQGspIa54BjljlAlOWBac8k5OkxlIMnJACfK1w618NVR4Vfveh1lc7e4NXcveC+WgMxIvDFSTnGintZDgFnTSgN0sXIQFl3LjWcWSjnCGSh3vS0pK9JOLlX02SKfoIQJTdPJ6/0RWLjOQQvuUGUtUK3BXzfBE8cxwnlKD/eb0CngFF4+x1sVZOkOtkoCj7oR8dtNO/bNq6WMsYQsti34hxeB2n1VgR7pb9nm4WSZ2C/8eooC/dxdAuaDf9IdcKxPeF0r7gM7ucC+YTPY7+rJZKOAJd786pPauUL2OmpXZhsYmdgSN+rueQJPjizg168L4aoMYwnQtWkFSTvQ00mB8y6FFCCDpCF5UCAAA=') no-repeat;padding:98px 125px;");
  52. 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;');
  53. //@ts-ignore
  54. if (GM_getValue('data', '') == '') {
  55. //@ts-ignore
  56. GM_setValue('data', [
  57. { name: 'JAV目錄大全', color: '#fe1773', website: 'https://freejavbt.com', path: '/{{fanHao}}' },
  58. { name: 'JAVMOVS', color: '#79c142', website: 'https://javmovs.com', path: '/{{fanHao}}' },
  59. { name: 'Javfree', color: '#df6e05', website: 'https://javfree.sh', path: '/search/movie/{{fanHao}}' },
  60. { name: 'HPJAV', color: '#f96364', website: 'https://hpjav.tv', path: '/?s={{fanHao}}' },
  61. { name: 'JAVHD', color: '#cb000d', website: 'https://javhd.today', path: '/search/video/?s={{fanHao}}' },
  62. { name: 'JAVTRUST', color: '#e38a5a', website: 'https://javtrust.com', path: '/search/movie/{{fanHao}}.html' },
  63. { name: 'JAVFUN', color: '#79c142', website: 'https://www3.javfun.me', path: '/search/{{fanHao}}' },
  64. { name: 'BEJAV', color: '#fd6500', website: 'https://bejav.net', path: '/search/{{fanHao}}' },
  65. { name: 'SEXTOP', color: '#c20001', website: 'https://sextop.net', path: '/?s={{fanHao}}&search=Search' },
  66. { name: 'JAVDISK', color: '#fe121e', website: 'https://javdisk.com', path: '/search.html?q={{fanHao}}' },
  67. { name: 'SUPJAV', color: '#d8201d', website: 'https://supjav.com', path: '/?s={{fanHao}}' },
  68. { name: 'SVJAV', color: '#cc2748', website: 'https://svjav.com', path: '/{{fanHao}}/' },
  69. { name: 'FBJAV', color: '#365899', website: 'https://fbjav.com', path: '/{{fanHao}}/' },
  70. { name: 'JAVUSA', color: '#0f0f0f', website: 'https://javusa.com', path: '/jav/{{fanHao}}/' },
  71. { name: 'JAVHDPorn', color: '#fa9f22', website: 'https://www2.javhdporn.net', path: '/video/{{fanHao}}/' },
  72. { name: 'JAVHHH', color: '#da2657', website: 'https://javhhh.com', path: '/video/{{fanHao}}/' },
  73. { name: 'KISSJAV', color: '#00a2e8', website: 'https://kissjav.com', path: '/search/video/?s={{fanHao}}' },
  74. { name: 'JAVSKY', color: '#ca6e00', website: 'https://javsky.tv', path: '/search/movie/{{fanHao}}' },
  75. { name: 'JavDragon', color: '#ec4caf', website: 'https://javdragon.com', path: '/{{bango}}/' },
  76. { name: 'JAVBEL', color: '#ff5b15', website: 'https://javbel.com', path: '/search.php?q={{fanHao}}' },
  77. { name: 'Javmix', color: '#f7c54c', website: 'https://javmix.tv', path: '/video/{{fanHao}}/' },
  78. { name: 'JAV-FOR', color: '#f0542e', website: 'https://jav-for.me', path: '/' },
  79. { name: 'av-Drive', color: '#8ce1f5', website: 'https://av-drive.blogspot.com', path: '/' },
  80. { name: 'GGJAV', color: '#2287f0', website: 'https://ggjav.com', path: '/ja/main/search?string={{fanHao}}' },
  81. { name: 'WideAV', color: '#3e7bee', website: 'https://wideav.com', path: '/search?keyword={{fanHao}}' },
  82. { name: 'JAVCL', color: '#ffcc00', website: 'https://javcl.com', path: '/search/{{fanHao}}/' },
  83. { name: 'JAV321', color: '#777', website: 'https://www.jav321.com', path: '/?bango={{fanHao}}' },
  84. { name: 'Jable', color: '#0077ac', website: 'https://jable.tv', path: '/search/{{fanHao}}/' },
  85. { name: 'JavDB', color: '#0a0a0a', website: 'https://javdb.com', path: '/search?q={{fanHao}}' },
  86. { name: 'OneJAV', color: '#f5da47', website: 'https://onejav.com', path: '/search/{{bango}}' },
  87. { name: 'AVMOO', color: '#cc0000', website: 'https://avmoo.click', path: '/cn/search/{{fanHao}}' },
  88. { name: 'JavBus', color: '#febe00', website: 'https://www.javbus.com', path: '/search/{{fanHao}}' },
  89. {
  90. name: 'JAVLibrary',
  91. color: '#f908bb',
  92. website: 'https://www.javlibrary.com',
  93. path: '/cn/vl_searchbyid.php?keyword={{fanHao}}'
  94. },
  95. { name: 'SEXTB', color: '#f5c823', website: 'https://sextb.net', path: '/{{fanHao}}' },
  96. { name: 'JAVGG', color: '#151515', website: 'https://javgg.net', path: '/jav/{{fanHao}}/' }
  97. ]);
  98. //@ts-ignore
  99. if (GM_getValue('version')) {
  100. //@ts-ignore
  101. GM_deleteValue('version');
  102. }
  103. }
  104. //@ts-ignore
  105. GM_registerMenuCommand('更新', () => {
  106. //@ts-ignore
  107. GM_openInTab('https://sleazyfork.org/zh-CN/scripts/428639-onejavoneweb', {
  108. active: true,
  109. insert: true,
  110. setParent: true
  111. });
  112. });
  113. //@ts-ignore
  114. GM_registerMenuCommand('下载思源黑体字体', () => {
  115. //@ts-ignore
  116. GM_openInTab('https://cdn.jsdelivr.net/gh/adobe-fonts/source-han-sans@release/OTF/SimplifiedChinese/SourceHanSansSC-Regular.otf', { active: true, insert: true, setParent: true });
  117. });
  118. // @ts-ignore basic style
  119. GM_addStyle(`.absolute{position:absolute}.relative{position:relative}.jav_tab{overflow:auto;width:410px;max-height:300px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:wrap;flex-wrap:wrap;text-align:start;font-family:'思源黑体';font-weight:700;font-size:18px;z-index:9999;background-color:#fff}.jav_tab .jav_web{line-height:1.6;cursor:pointer;border:1px solid #eee}.jav_mask{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;background-color:rgba(0,0,0,0.8)}.jav_mask .jav_setting_panel{width:760px;max-height:700px;padding:20px 0 20px 10px;background-color:#fff;color:#000;border-radius:20px;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%);position:fixed;top:50%;left:50%;overflow-y:auto;font-family:'思源黑体';font-size:16px;line-height:1.6;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;text-align:start}.jav_mask .jav_setting_panel .table{max-height:400px;overflow-y:auto}.jav_mask .jav_setting_panel .table table{border-collapse:collapse}.jav_mask .jav_setting_panel .table table tr{border:0;margin:0;padding:0}.jav_mask .jav_setting_panel .table table tr td{border:0;margin:0;padding:0 3px}.jav_mask .jav_setting_panel .table table tr td:last-child{text-align:center}.jav_mask .jav_setting_panel .table .remove{cursor:pointer}.jav_mask .jav_setting_panel .table .remove::after{content:'➖';background-color:red}.jav_mask .jav_setting_panel .table .add{cursor:pointer}.jav_mask .jav_setting_panel .table .add::after{content:'➕';background-color:greenyellow}.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;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:0.3s;transition-duration:0.3s;background-color:#1b9af7;border-color:#1b9af7;border-radius:4px;font-size:16px;height:30px;line-height:30px;padding:0 30px;margin:5px;color:#fff}`);
  120. class JAV {
  121. constructor(i) {
  122. [this.bango, this.fanHao] = (() => {
  123. const o = i.trim().replace(/ +/, '-');
  124. let t = o.match(/FC2-?PPV-?(\d+)/i);
  125. if ((t = o.match(/FC2-?PPV-?(\d+)/i))) {
  126. return [`FC2PPV${t[1]}`, `FC2PPV-${t[1]}`];
  127. }
  128. else if ((t = o.match(/([a-zA-Z]+)-?(\d+)/i))) {
  129. return [`${t[1].toUpperCase()}${t[2]}`, `${t[1].toUpperCase()}-${t[2]}`];
  130. }
  131. else {
  132. console.info(`JAV:${i}处理失败,反馈给作者修复bug`);
  133. return [i, i];
  134. }
  135. })();
  136. // @ts-ignore
  137. this.data = GM_getValue('data');
  138. }
  139. render(i) {
  140. return i.replace('{{fanHao}}', this.fanHao).replace('{{bango}}', this.bango);
  141. }
  142. create_table(position = 0) {
  143. let html = ``;
  144. for (let index in this.data) {
  145. let i = Number(index);
  146. this.data[i].url = `${this.data[i].website}${this.render(this.data[i].path)}`;
  147. 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>`;
  148. }
  149. html += `<div id="jav_setting_button" class="jav_web">🛠设置</div>`;
  150. if (position == 0) {
  151. // absolute
  152. html = `<div id="jav_table" class="jav_tab absolute">${html}</div>`;
  153. }
  154. else {
  155. // inherit
  156. html = `<div id="jav_table" class="jav_tab">${html}</div>`;
  157. }
  158. return html;
  159. }
  160. setting_init() { }
  161. }
  162. $('body').on('click', '#jav_setting_button', () => {
  163. let settingHtml = `<div id="jav_mask" class="jav_mask">
  164. <div id="jav_setting_panel" class="jav_setting_panel">
  165. <div class="table">
  166. <table>
  167. <tr>
  168. <th>名称</th>
  169. <th>颜色</th>
  170. <th>网站</th>
  171. <th>路径</th>
  172. <th>操作</th>
  173. </tr>
  174. </table>
  175. </div>
  176. <div>
  177. <label for="auto_jump">自动跳转</label>
  178. <input type="radio" name="auto_jump" value="true">开
  179. <input type="radio" name="auto_jump" value="false">关
  180. </div>
  181. <div>
  182. <button id="jav_setting_save">保存并退出</button>
  183. </div>
  184. </div>
  185. </div>`;
  186. $('body').append(settingHtml);
  187. // @ts-ignore
  188. let auto_jump = GM_getValue('auto_jump', true);
  189. $('input[name="auto_jump"]')
  190. .eq(0)
  191. .prop('checked', auto_jump ? true : false);
  192. $('input[name="auto_jump"]')
  193. .eq(1)
  194. .prop('checked', auto_jump ? false : true);
  195. // @ts-ignore
  196. let data = GM_getValue('data');
  197. for (let row of data) {
  198. $('#jav_setting_panel>.table>table').append(`<tr data>
  199. <td name><input type="text" value="${row.name}"></td>
  200. <td color><input type="text" value="${row.color}"></td>
  201. <td website><input type="text" value="${row.website}"></td>
  202. <td path><input type="text" value="${row.path}"></td>
  203. <td class="remove" remove></td>
  204. </tr>`);
  205. }
  206. $('#jav_setting_panel>.table>table').append(`<tr add>
  207. <td name><input type="text" placeholder="name"></td>
  208. <td color><input type="text" placeholder="color"></td>
  209. <td website><input type="text" placeholder="website"></td>
  210. <td path><input type="text" placeholder="path"></td>
  211. <td class="add" add></td>
  212. </tr>`);
  213. });
  214. $('body').on('click', 'td[remove]', function () {
  215. $(this).parent().remove();
  216. });
  217. $('body').on('click', 'td[add]', function () {
  218. let name = $(this).siblings('td[name]').find('input').eq(0).val().toString().trim();
  219. let color = $(this).siblings('td[color]').find('input').eq(0).val().toString().trim();
  220. let website = $(this).siblings('td[website]').find('input').eq(0).val().toString().trim();
  221. let path = $(this).siblings('td[path]').find('input').eq(0).val().toString().trim();
  222. if (name == '' || color == '' || website == '' || path == '') {
  223. alert('填入内容不能为空');
  224. return false;
  225. }
  226. let htmlString = `<tr data>
  227. <td name><input type="text" value="${name}"></td>
  228. <td color><input type="text" value="${color}"></td>
  229. <td website><input type="text" value="${website}"></td>
  230. <td path><input type="text" value="${path}"></td>
  231. <td class="remove" remove></td>
  232. </tr>`;
  233. $('tr[add]').before(htmlString);
  234. $('tr[add]').find('input').val('');
  235. });
  236. $('body').on('click', '#jav_setting_save', () => {
  237. let data = new Array();
  238. for (let e of $('tr[data]')) {
  239. let name = $(e).find('input[type="text"]').eq(0).val().toString();
  240. let color = $(e).find('input[type="text"]').eq(1).val().toString();
  241. let website = $(e).find('input[type="text"]').eq(2).val().toString();
  242. let path = $(e).find('input[type="text"]').eq(3).val().toString();
  243. data.push({ name, color, website, path });
  244. }
  245. let auto_jump = $('input[name="auto_jump"]:checked').val() == 'true' ? true : false;
  246. $('#jav_mask').remove();
  247. // @ts-ignore save configuration
  248. GM_setValue('data', data);
  249. // @ts-ignore save configuration
  250. GM_setValue('auto_jump', auto_jump);
  251. });
  252. /* OneJAV 141jav */
  253. if (null != location.hostname.match(/onejav.com|141jav.com/)) {
  254. (() => {
  255. $('body').on('mouseenter', '.card.mb-3>.container>.columns>.column:even', function () {
  256. const bango = $(this).parents('.columns').find('.title.is-spaced>a').text().trim();
  257. const jav = new JAV(bango);
  258. $(this).prepend(jav.create_table());
  259. jav.setting_init();
  260. return false;
  261. });
  262. $('body').on('mouseleave', '.card.mb-3>.container>.columns>.column:even', function () {
  263. $(this).find('#jav_table').remove();
  264. return false;
  265. });
  266. // Show a table without no search reasult
  267. if (null != location.pathname.match(/\/search\/[a-zA-Z0-9-]/) && 0 == $('div.card.mb-3').length) {
  268. const jav = new JAV(location.pathname.substr(8));
  269. $('body>div.container').append(jav.create_table(1));
  270. }
  271. })();
  272. }
  273. /* avmoo javbus */
  274. if (null != location.hostname.match(/avmoo|javbus|busjav|buscdn|busdmm|dmmbus|seedmm|dmmsee/)) {
  275. (() => {
  276. const showBoxes = $('.movie-box');
  277. // @ts-ignore
  278. if (showBoxes.length == 1 && Number(GM_getValue('auto_jump', '1'))) {
  279. location.href = showBoxes[0].href;
  280. }
  281. $('body').on('mouseenter', '.col-md-9.screencap', function () {
  282. const bango = $('body > div.container > h3').text().trim().split(' ')[0];
  283. const jav = new JAV(bango);
  284. $(this).prepend(jav.create_table());
  285. jav.setting_init();
  286. return false;
  287. });
  288. $('body').on('mouseleave', '.col-md-9.screencap', function () {
  289. $(this).find('#jav_table').remove();
  290. return false;
  291. });
  292. $('#sample-waterfall > a').each((_, a) => {
  293. // @ts-ignore
  294. GM_xmlhttpRequest({
  295. method: 'GET',
  296. url: a.href,
  297. responseType: 'blob',
  298. onload: (res) => {
  299. const blob = new Blob([res.response], { type: 'image/jpeg' });
  300. a.href = URL.createObjectURL(blob);
  301. }
  302. });
  303. });
  304. })();
  305. }
  306. /* javlibarary */
  307. if (null != location.hostname.match(/javlibrary|n53i/)) {
  308. (() => {
  309. const style = `.pointer,#onejav_modal *{cursor:pointer}#onejav_modal{color:#dcdcdc;font-size:64px;font-weight:700;font-family:'思源黑体';background-color:rgba(0,0,0,0.8);position:fixed;top:0;right:0;bottom:0;left:0;z-index:99}#onejav_modal img{cursor:default;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%);position:absolute;top:50%;right:auto;bottom:auto;left:50%}#onejav_modal #left{-webkit-transform:translateY(-50%);transform:translateY(-50%);position:absolute;top:50%;right:auto;bottom:auto;left:10px}#onejav_modal #left::after{content:"◀"}#onejav_modal #left:hover{color:#fff}#onejav_modal #right{-webkit-transform:translateY(-50%);transform:translateY(-50%);position:absolute;top:50%;right:10px;bottom:auto;left:auto}#onejav_modal #right::after{content:"▶"}#onejav_modal #right:hover{color:#fff}#onejav_modal #close{position:absolute;top:0;right:10px;bottom:auto;left:auto}#onejav_modal #close::after{content:"✖"}#onejav_modal #close:hover{color:#fff}`;
  310. $('head').append(`<style>${style}</style>`);
  311. const sourceArr = $('#rightcolumn > div.previewthumbs > img').map((_, img) => img.src);
  312. const srcArr = sourceArr.map((_, source) => {
  313. const match = source.match(/digital\/video\/(\w+)\/\1-(\d+.jpg)/i);
  314. const src = source.replace(match[0], `digital/video/${match[1]}/${match[1]}jp-${match[2]}`);
  315. return src;
  316. });
  317. srcArr.each((index, src) => {
  318. // @ts-ignore
  319. GM_xmlhttpRequest({
  320. method: 'GET',
  321. url: src,
  322. responseType: 'blob',
  323. onload: (res) => {
  324. const blob = new Blob([res.response], { type: 'image/jpeg' });
  325. srcArr[index] = URL.createObjectURL(blob);
  326. }
  327. });
  328. });
  329. const modal = $(`<div id="onejav_modal"><img src="" alt="预览大图"/><div id="left"></div><div id="right"></div><div id="close"></div></div>`);
  330. $('#rightcolumn > div.previewthumbs > img').each(function (index, img) {
  331. $(img).addClass('pointer');
  332. $(img).on('click', () => {
  333. modal.find('img')[0].src = srcArr[index];
  334. $('body').append(modal);
  335. let i = 0;
  336. $('body').on('click', '#onejav_modal>#left', () => {
  337. i -= 1;
  338. if (i < 0) {
  339. i = srcArr.length - 1;
  340. }
  341. $('#onejav_modal>img')[0].src = srcArr[i];
  342. return false;
  343. });
  344. $('body').on('click', '#onejav_modal>#right', () => {
  345. i += 1;
  346. if (i > srcArr.length - 1) {
  347. i = 0;
  348. }
  349. $('#onejav_modal>img')[0].src = srcArr[i];
  350. return false;
  351. });
  352. $('body').on('click', '#onejav_modal>img', () => {
  353. return false;
  354. });
  355. $('body').on('click', '#onejav_modal', () => {
  356. $('#onejav_modal').remove();
  357. $('body').off('keydown.onejav');
  358. return false;
  359. });
  360. $('body').on('keydown.onejav', (event) => {
  361. if (event.key == 'ArrowLeft') {
  362. $('#onejav_modal>#left').trigger('click');
  363. }
  364. else if (event.key == 'ArrowRight') {
  365. $('#onejav_modal>#right').trigger('click');
  366. }
  367. else if (event.key == 'Escape') {
  368. $('#onejav_modal').trigger('click');
  369. }
  370. return false;
  371. });
  372. return false;
  373. });
  374. });
  375. $('body').on('mouseenter', '.video', function () {
  376. const bango = $(this).find('.id').text().trim().split(' ')[0];
  377. const jav = new JAV(bango);
  378. const html = `<div class="newBox" style="position:absolute;z-index:9999;top:0;right:0;"><button style="display:block;" link="${jav.data[29].url}">${jav.data[29].name}</button><button style="display:block;" link="${jav.data[30].url}">${jav.data[30].name}</button><button style="display:block;" link="${jav.data[27].url}">${jav.data[27].name}</button></div>`;
  379. $(this).prepend(html);
  380. $('.newBox>button').on('click', function () {
  381. window.open($(this).attr('link'));
  382. return false;
  383. });
  384. });
  385. $('body').on('mouseleave', '.video', function () {
  386. $(this).find('.newBox').remove();
  387. return false;
  388. });
  389. $('body').on('mouseenter', '#video_jacket', function () {
  390. const bango = $('#video_title > h3').text().trim().split(' ')[0];
  391. const jav = new JAV(bango);
  392. $(this).prepend(jav.create_table());
  393. jav.setting_init();
  394. return false;
  395. });
  396. $('body').on('mouseleave', '#video_jacket', function () {
  397. $(this).find('#jav_table').remove();
  398. return false;
  399. });
  400. })();
  401. }
  402. /* jav321 */
  403. if (null != location.hostname.match(/jav321/)) {
  404. (() => {
  405. if (location.pathname.match(/\/video\/[a-zA-Z0-9-]+/i)) {
  406. const hinban = $('body > div:nth-child(3) > div.col-md-7.col-md-offset-1.col-xs-12 > div:nth-child(1) > div.panel-body > div:nth-child(1) > div.col-md-9')
  407. .text()
  408. .match(/品番: ([a-zA-Z0-9-]+)/i);
  409. const jav = new JAV(hinban[1]);
  410. $('body > div:nth-child(3) > div.col-md-7.col-md-offset-1.col-xs-12 > div:nth-child(1) > div.panel-body').append(jav.create_table(1));
  411. }
  412. const searchParams = new URLSearchParams(location.search.substr(1));
  413. if (undefined != searchParams.get('bango')) {
  414. $('body > div:nth-child(2) > div > nav > div > form:nth-child(2) > div > input')[0].value =
  415. searchParams.get('bango');
  416. $('body > div:nth-child(2) > div > nav > div > form:nth-child(2) > div > span > button')[0].click();
  417. window.close();
  418. }
  419. })();
  420. }
  421. /* hpjav */
  422. if (null != location.hostname.match(/hpj?av/)) {
  423. (() => {
  424. $('body > div.video-box-ather.container > div:nth-child(1) > div > div.col-md-5').on('mouseenter', function () {
  425. const bango = location.pathname.slice(location.pathname.lastIndexOf('/') + 1).toUpperCase();
  426. const jav = new JAV(bango);
  427. $(this).prepend(jav.create_table());
  428. jav.setting_init();
  429. return false;
  430. });
  431. $('body > div.video-box-ather.container > div:nth-child(1) > div > div.col-md-5').on('mouseleave', function () {
  432. $(this).find('#jav_table').remove();
  433. return false;
  434. });
  435. })();
  436. }
  437. /* jable */
  438. if (null != location.hostname.match(/jable/i)) {
  439. (() => {
  440. const matches = location.pathname.match(/\/videos\/([a-zA-Z0-9-]+)\//i);
  441. if (matches) {
  442. const jav = new JAV(matches[1]);
  443. $('#site-content > div > div > div:nth-child(1) > section.video-info.pb-3').append(jav.create_table(1));
  444. jav.setting_init();
  445. }
  446. })();
  447. }
  448. /* javdb */
  449. if (null != location.hostname.match(/javdb/i)) {
  450. const bango = $('div.panel-block.first-block > span').text().trim().split(' ')[0];
  451. const jav = new JAV(bango);
  452. $('div.video-meta-panel').after(jav.create_table(1));
  453. jav.setting_init();
  454. }
  455. console.timeEnd('JAV');
  456. })();