Sleazy Fork is available in English.

blogjav.net老司机步兵辅助

blogjav.net网站重新排版,浏览图片下载内容更方便,是时候和封面杀手说88了。

질문, 리뷰하거나, 이 스크립트를 신고하세요.
  1. // ==UserScript==
  2. // @name blogjav.net老司机步兵辅助
  3. // @namespace http://greasyfork.org/zh-CN/users/25794
  4. // @version 1.3.1
  5. // @description blogjav.net网站重新排版,浏览图片下载内容更方便,是时候和封面杀手说88了。
  6. // @author Hobby
  7. // @require http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.4.min.js
  8. // @require http://cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.min.js
  9. // @include http://www.imagebam.com/image/*?url=maddawgjav.net
  10. // @include http://blogjav.net/*
  11. // @include http://115.com/*
  12.  
  13. // @resource icon http://geekdream.com/image/115helper_icon_001.jpg
  14.  
  15. // @run-at document-idle
  16. // @grant GM_xmlhttpRequest
  17. // @grant GM_addStyle
  18. // @grant GM_getValue
  19. // @grant GM_setValue
  20. // @grant GM_notification
  21. // @grant GM_setClipboard
  22. // @grant GM_getResourceURL
  23.  
  24. // @connect *
  25. // @copyright hobby 2016-04-02
  26.  
  27. // 交流QQ群:273406036
  28. // 内地用户推荐Chrome + Tampermonkey(必须扩展) + V2ray(代理) + Proxy SwitchyOmega(扩展)的环境下配合使用。
  29.  
  30. // v1.3.1 修复了已知问题。
  31. // v1.3.0 优化了整个脚本,修复了已知问题。
  32. // v1.2.4 增加了avgle链接跳转,修复了bug
  33. // v1.2.3 修复原站更新后的已知问题
  34. // v1.2.2 修复了bug
  35. // v1.2.1 修复了bug
  36. // v1.2.0 增加JAV列表无限滚动自动加载,增加导航栏右上角统计已阅JAV数量和只看已阅功能。修改首页及栏目jav列表的预览图默认加载为小图,搜索入口jav列表的预览图默认加载为大图。
  37. // v1.1.1 代码优化,体验细节优化
  38. // v1.1.0 重大更新!排版优化改进!
  39. // v1.0.8 合成“挊”的自动获取JAV磁链接,一键自动115离线下载
  40. // v1.0.7 代码精简改进,修改部分内容
  41. // v1.0.6 修复原站更新后的已知问题
  42. // v1.0.5 改进性能,修复已知问题
  43. // v1.0.4 修复了站点子目录支持的问题
  44. // v1.0.3 修复了bug
  45. // v1.0.2 修复了部分排版问题
  46. // v1.0.1 增加内容大图加载失败后有缓存,点击能重新加载,以及修复了bug
  47. // v1.0.0 针对blogjav.net网站的支持,支持方便浏览图片
  48.  
  49. // ==/UserScript==
  50.  
  51. (function() {
  52.  
  53. // 115用户ID
  54. var jav_userID = GM_getValue('jav_user_id', 0);
  55. //i con图标
  56. const icon = GM_getResourceURL('icon');
  57.  
  58. //过滤文字单词的数组
  59. const filterWordsArray = new Array(
  60. 'UNCENSORED','CENSORED','IDOL','Caribbeancompr','Caribbeancom','Gachinco','10musume','天然むすめ','カリビアンコム プレミアム','カリビアンコム','FC2-PPV',
  61. 'GALAPAGOS','Mesubuta','1000人斬り','Tokyo Hot','AV志向','アジア天国','キャットウォーク ポイズン','G-AREA','','ABBY','エッチな4610','H4610',
  62. '金8天国','av9898','エッチな4610','エッチな0930','15-daifuku','','ハメる','The 変態','人妻斬り','娘姦白書','','1pondo','Kin8tengoku','Pacopacomama','Lesshin',
  63. 'Heydouga','Nyoshin','Unkotare','','Muramura','H0930','C0930','1000giri','XXX-AV','Kt-joker','<strong>','FC2','PPV','Leaked','41Ticket','Real Street Angels',
  64. '\\[FHD\\]','\\[HD\\]','\\[D9ISO\\]','\\[FHD60fps\\]','Leak','1pon','Caribpr','Carib','SM-miracle'
  65. );
  66.  
  67. //不过滤用于判断截取字符位置的单词
  68. const wordsArray = new Array(
  69. 'S-Cute','Asiatengoku','Real-diva','Jukujo-club','\[julesjordan\]','\[colette\]','Mywife-No','Roselip','Zipang','HEYZO','1919gogo','\[DDF\] ','\[Wow\]',
  70. 'Blacked','\[21members\]','\[sexart\]','Heyzo', 'X1X','\[babes\]','Mywife-NO','Peepsamurai','Honnamatv','Spermmania'
  71. );
  72.  
  73. //多文字过滤的月份字典定义,前为替换前字符,后为替换后字符
  74. const replaceMonth = {
  75. "January" : "一月","February" : "二月","March": "三月","April" : "四月","May": "五月","June" : "六月",
  76. "July": "七月","August" : "八月","September": "九月","October" : "十月","November": "十一月","December": "十二月"
  77. };
  78.  
  79. class Common {
  80. /**
  81. * 过滤字典方法
  82. * @param str 输入原字符
  83. * @param replacements 替换字典
  84. * @returns {void | string}
  85. */
  86. static filterDict(str,replacements){
  87. //以下同时替换多个字符串使用到的代码,如123-->abc,456-->xyz
  88. Array.prototype.each = function(trans) {
  89. for (let i=0; i<this.length; i++)
  90. this[i] = trans(this[i], i, this);
  91. return this;
  92. };// todo 此方法导致115.com有问题.
  93. Array.prototype.map = function(trans) {
  94. return [].concat(this).each(trans);
  95. };
  96. RegExp.escape = function(str) {
  97. return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
  98. };
  99. function properties(obj) {
  100. var props = [];
  101. for (var p in obj) props.push(p);
  102. return props;
  103. }
  104. var regex = new RegExp(properties(replacements).map(RegExp.escape).join("|"), "g");
  105. str = str.replace(regex, function($0) { return replacements[$0]; });
  106. return str;
  107. }// end 替换多个字符串代码结束
  108. /**
  109. * 过滤文字单词函数
  110. * @param srcString 需过滤字符串
  111. * @returns {*|string} 过滤后的字符串
  112. */
  113. static filterWords(srcString){
  114. for(var i = 0; i < filterWordsArray.length ; i ++){
  115. if(filterWordsArray[i] !== ""){
  116. srcString = srcString.replace(new RegExp(filterWordsArray[i],'ig'),"").replace(/(^\s*)/g, "");
  117. }
  118. }
  119. return srcString;
  120. }
  121. /**
  122. * 判断字符串是否包含单词字典的内容
  123. * @param srcString 需判断字符串
  124. * @param wordsArr 单词字典
  125. * @returns {boolean}
  126. */
  127. static hasWords(srcString,wordsArr){
  128. for(let i = 0; i < wordsArr.length ; i ++){
  129. if(wordsArr[i] !== ""){
  130. srcString = $.trim(srcString);
  131. // if(srcString.split(" ")[0] === wordsArr[i]){
  132. if(srcString.indexOf(wordsArr[i]) > -1){
  133. return true;
  134. }
  135. }
  136. }
  137. return false;
  138. }
  139. static parsetext(text) {
  140. let doc = null;
  141. try {
  142. doc = document.implementation.createHTMLDocument('');
  143. doc.documentElement.innerHTML = text;
  144. return doc;
  145. }
  146. catch (e) {
  147. alert('parse error');
  148. }
  149. }
  150. //方法: 通用chrome通知
  151. static notifiy (title, body, icon, click_url){
  152. let notificationDetails = {
  153. text: body,
  154. title: title,
  155. timeout: 10000,
  156. image: icon,
  157. onclick: function() {
  158. window.open(click_url);
  159. }
  160. };
  161. GM_notification(notificationDetails);
  162. }
  163. /**
  164. * 创建查找av的外链html内容元素P
  165. * @param avCode av番号
  166. * @returns {*} 外链html内容元素P
  167. */
  168. static crtOutLink(avCode){
  169. var p = $(`
  170. <p style="text-align: center;color: blue;margin: 0 auto;clear: both;">他站查找 [${avCode}]:
  171. <a target="_blank" href="https://avgle.com/search/videos?search_query=${avCode}" title="搜 ${avCode}" class="link">avgle</a>&nbsp;&nbsp;&nbsp;&nbsp;
  172. <a target="_blank" href="http://www.javlibrary.com/cn/vl_searchbyid.php?keyword=${avCode}" title="搜 ${avCode}" class="link">javlibrary</a>&nbsp;&nbsp;&nbsp;&nbsp;
  173. <a target="_blank" href="https://www.javbus.com/search/${avCode}" title="搜 ${avCode}" class="link">javbus</a>&nbsp;&nbsp;&nbsp;&nbsp;
  174. <a target="_blank" href="http://maddawgjav.net/?s=${avCode}" title="搜 ${avCode}" class="link">maddawgjav</a>&nbsp;&nbsp;&nbsp;&nbsp;
  175. <a target="_blank" href="http://javbest.net/?s=${avCode}" title="搜 ${avCode}" class="link">javbest</a>&nbsp;&nbsp;&nbsp;&nbsp;
  176. <a target="_blank" href="http://javpop.com/index.php?s=${avCode}" title="搜 ${avCode}" class="link">javpop</a>&nbsp;&nbsp;&nbsp;&nbsp;留种:
  177. <a target="_blank" href="https://btos.pw/search/${avCode}" title="搜 ${avCode}" class="link">btsow</a>&nbsp;&nbsp;&nbsp;&nbsp;
  178. <a target="_blank" href="https://btdb.in/q/${avCode}" title="搜 ${avCode}" class="link">btdb</a>&nbsp;&nbsp;&nbsp;&nbsp;
  179. <a target="_blank" href="http://sukebei.nyaa.si/?f=0&c=0_0&q=${avCode}" title="搜 ${avCode}" class="link">sukebei.nyaa</a>&nbsp;&nbsp;&nbsp;&nbsp;
  180. <a target="_blank" href="https://www.limetorrents.cc/search/all/${avCode}" title="搜 ${avCode}" class="link">limetorrents</a>&nbsp;&nbsp;&nbsp;&nbsp;
  181. </p>'
  182. `)[0];
  183. return p;
  184. }
  185. /**
  186. * http地址get方式访问
  187. * @param url 请求地址
  188. * @returns {Promise<any>} 返回Promise,可以用于同步处理。
  189. */
  190. static request (url) {
  191. return new Promise(resolve => {
  192. //let time1 = new Date();
  193. GM_xmlhttpRequest({
  194. url,
  195. method: 'GET',
  196. headers: {
  197. "Cache-Control": "no-cache"
  198. },
  199. timeout: 30000,
  200. onload: response => { //console.log(url + " reqTime:" + (new Date() - time1));
  201. resolve(response);
  202. },
  203. onabort: (e) =>{
  204. console.log(url + " abort");
  205. resolve("wrong");
  206. },
  207. onerror: (e) =>{
  208. console.log(url + " error");
  209. console.log(e);
  210. resolve("wrong");
  211. },
  212. ontimeout: (e) =>{
  213. console.log(url + " timeout");
  214. resolve("wrong");
  215. },
  216. });
  217. });
  218. }
  219. static addJavMovieImg(smallImgUrl,imgUrl,insertImgFunc){
  220. //创建新img元素
  221. var $img = $('<img name="javRealImg" width="66px" title="点击可放大缩小 (图片正常时)"></img>');
  222. //$img.attr("id",moreId);//例如:more-265519
  223. $img.attr("style","border: 1px solid #DDD;min-height: 233px;height:auto;cursor: pointer;float: left;");
  224.  
  225. // 判断是否搜索地址进入
  226. let reg = new RegExp(/\?s=/);
  227. let reg1 = new RegExp(/&no/);
  228. //console.log(location.href + " 网址 " + reg.test(location.href));
  229. if(reg.test(location.href) && !reg1.test(location.href)){
  230. $img.attr("src",imgUrl);
  231. }
  232. else{
  233. $img.attr("src",smallImgUrl);
  234. }
  235.  
  236. //插入图片函数,将图片插入到某个位置
  237. insertImgFunc($img);
  238.  
  239. if(reg.test(location.href) && !reg1.test(location.href)){
  240. $($img[0].parentElement).attr('bigImg', '1');
  241. }
  242.  
  243. $img.click(function(){
  244. let bigImgFlag = $(this.parentElement).attr('bigImg');
  245. //3为超时,2为异常
  246. if($(this).attr("loadRes") == '2' || ($(this).attr("loadRes") == '3'&& !this.complete)){
  247. //debugger;
  248. //$(this).attr("src",":0");
  249. Common.addJavMovieImg(smallImgUrl,imgUrl+'hobby',insertImgFunc);
  250. $(this).remove();
  251. }
  252.  
  253. //如果存在(不存在)就删除(添加)一个类 'max'。
  254. $(this).toggleClass('max');
  255.  
  256. if(!$(this).attr("class")){
  257. this.parentElement.parentElement.scrollIntoView();
  258. $(this).after(this.previousElementSibling);
  259. }
  260. else{
  261. $(this).before(this.nextElementSibling);
  262. }
  263.  
  264. if(!$(this).parents(".single").attr('isView')){
  265. // 设置jav为已阅
  266. $(this).parents(".single").attr('isView','1');
  267.  
  268. // 已阅JAV数+1
  269. $("#viewJavNbr").text(parseInt($("#viewJavNbr").text()) + 1);
  270. }
  271.  
  272. if(!bigImgFlag){
  273. let $imgParentEle = $(this.parentElement);
  274. $imgParentEle.attr('bigImg', '1');
  275.  
  276. Common.addJavMovieImg(imgUrl,imgUrl+'hobby',insertImgFunc);
  277. $(this).remove();
  278. //$imgParentEle.find('img[name="javRealImg"]').click();
  279. }
  280. if(!$(this).attr("loadMagnet")){
  281. $(this).attr('loadMagnet', '1');
  282. let rd = parseInt(Math.random()*100000000);
  283. new BlogjavNong($img.attr("vid"),rd,$img);
  284. }
  285.  
  286. });
  287.  
  288. $img.load(function(){
  289. console.log("加载完成");
  290. $img.attr('loadRes', '1');
  291. });
  292. $img.error(function(){
  293. console.log("加载异常");
  294. $img.attr('loadRes', '2');
  295. });
  296. setTimeout(function(){
  297. var res = $img.attr('loadRes');
  298. if(!res){
  299. console.log("加载超时");
  300. $img.attr('loadRes', '3');//加载超时
  301. }
  302. }, 30000);
  303. }
  304. };
  305.  
  306. //第三方脚本
  307. class ThridpartyScript {}
  308.  
  309. ThridpartyScript.Waterfall = class {
  310. /**
  311. * 构造函数
  312. * @param columnNum 瀑布流列数
  313. * @param selectorNext 选择下一页元素
  314. * @param selectorItem 选择加载页面元素
  315. */
  316. constructor(columnNum,selectorNext,selectorItem) {
  317. this.COL_CNT = columnNum ? columnNum : 1;
  318. this.global = {
  319. pageCount: 0,
  320. itemCount: 0,
  321. parent: $('#waterfall'),
  322. columnParents: Array(columnNum).fill().map(() => $('<div class="column">')),
  323. columnHeights: Array(columnNum).fill(0),
  324. nextURL: location.href,
  325. locked: false,
  326. baseURI: location.origin,
  327. selector: {
  328. next: selectorNext ? selectorNext : 'a#next',
  329. item: selectorItem ? selectorItem : '.item',
  330. },
  331. };
  332. this.intersectionObserverOptions = {
  333. rootMargin: `900px 0px 2000px 0px`,
  334. threshold: Array(5).fill().map((_, index, arr) => index / arr.length),//[0, 0.2, 0.4, 0.6, 0.8]
  335. };
  336. }
  337.  
  338. // /**
  339. // * 处理当前页面加载项
  340. // * @param item 当前页面加载元素
  341. // */
  342. // processItem(item){}
  343.  
  344. getNextURL(href){
  345. const a = document.createElement('a');
  346. a.href = href;
  347. return `${this.global.baseURI}${a.pathname}${a.search}`;
  348. }
  349.  
  350. fetchURL(url){
  351. let todo = async() => {
  352. console.log(`fetchUrl = ${url}`);
  353. const resp = await fetch(url, { credentials: 'same-origin' });
  354. console.log(new Date());
  355. const html = await resp.text();
  356. console.log(new Date());
  357. const doc = new DOMParser().parseFromString(html, 'text/html');
  358. const href = $(doc).find(this.global.selector.next).attr('href');
  359. const nextURL = href ? this.getNextURL(href) : null;
  360. const elems = $(doc).find(this.global.selector.item);
  361.  
  362. return {
  363. nextURL,
  364. elems,
  365. };
  366. };
  367. return todo();
  368. }
  369.  
  370. intersectionObserver(){
  371. let server = new IntersectionObserver(async() => {
  372. let global = this.global;
  373. if (global.locked) { return; }
  374. global.locked = true;
  375. const { nextURL, elems } = await this.fetchURL(global.nextURL);
  376.  
  377. if (global.pageCount === 0) {
  378. global.parent.empty().append(global.columnParents);
  379. }
  380.  
  381. const items = elems.toArray();
  382. if (global.pageCount > 0 && location.pathname.includes('/star/')) {
  383. items.shift();
  384. }
  385.  
  386. for (const item of items) {
  387. this.processItem(item);
  388. global.columnParents[global.itemCount % this.COL_CNT].append(item);
  389. global.itemCount += 1;
  390. }
  391.  
  392. // finally
  393. // 已加载页数+1 页面存在20分钟自动刷新机制
  394. $("#addPageNbr").text(parseInt($("#addPageNbr").text()) + 1);
  395. $("#hisUrl").attr("href",GM_getValue("hisNextPageUrl","#"));
  396. global.pageCount += 1;
  397. global.nextURL = nextURL;
  398. // 设置显示当前读取到第几页。
  399. let currPageNbr = parseInt(nextURL.substring(nextURL.lastIndexOf('page/') + 5,nextURL.lastIndexOf('/'))) - 1;
  400. $("#currNextPageNbr").text(currPageNbr);
  401. // 加载页数大于5页,把加载到第几页的url保存到历史缓存中,同时把历史超链接移除
  402. if(global.pageCount > 5){
  403. GM_setValue("hisNextPageUrl",nextURL);
  404. $("#hisli").remove();
  405. }
  406. global.locked = false;
  407.  
  408. if (!global.nextURL) {
  409. console.info('The End');
  410. global.parent.after($('<h1 id="end">The End</h1>'));
  411. server.disconnect();
  412. return;
  413. }
  414. }, this.intersectionObserverOptions);
  415. return server;
  416. }
  417. };
  418.  
  419. ThridpartyScript.Nong = class {
  420.  
  421. constructor(keyword,randomNum,$locateObj) {
  422. this.full_url = '';
  423. this.keyword = keyword ? keyword : "";
  424. this.randomNum = randomNum ? randomNum : "0";
  425. //初始化table
  426. let temp = this;
  427. this.cur_tab = this.full();
  428. this.processMagnetTab($locateObj);
  429. let t = $(`#jav-nong-head-${this.randomNum}`)[0].firstChild;
  430. t.firstChild.addEventListener('change', function (e) {
  431. GM_setValue('search_index', e.target.value);
  432. let s = $(`#nong-table-new-${temp.randomNum}`)[0];
  433. s.parentElement.removeChild(s);
  434. new BlogjavNong(temp.keyword,temp.randomNum,$locateObj);
  435. });
  436.  
  437. if (GM_getValue('search_index', null) === null) {
  438. GM_setValue('search_index', Object.keys(this.resource_sites)[0]);
  439. }
  440.  
  441. this.cur_engine(this.keyword, function (src, data) {
  442. if (data.length === 0) {
  443. let url = temp.full_url;
  444. $(`#nong-table-new-${temp.randomNum} #notice`).text('No search result! ');
  445. $(`#nong-table-new-${temp.randomNum} #notice`)
  446. .append(`<a href="${url}" target="_blank" style="color: red;">&nbsp;Go</a>`);
  447. }
  448. else {
  449. temp.updata_table(src, data, 'full');
  450. /*display search url*/
  451. let y = $(`#jav-nong-head-${temp.randomNum} th`)[1].firstChild;
  452. y.href = temp.full_url;
  453. }
  454. });
  455. }
  456.  
  457. /**
  458. * 处理加载磁链搜索列表的位置
  459. */
  460. processMagnetTab(){}
  461.  
  462. cur_engine(kw, cb) {
  463. let ops = Object.keys(ThridpartyScript.Nong.resource_sites);
  464. //let z = this.resource_sites[GM_getValue('search_index', ops[0])];
  465. let z = ThridpartyScript.Nong.resource_sites[GM_getValue('search_index', ops[0])];
  466. if (!z) {
  467. GM_setValue('search_index', ops[0]);
  468. z = ThridpartyScript.Nong.resource_sites[GM_getValue('search_index')];
  469. }
  470. return z(kw, cb);
  471. }
  472.  
  473. create_empty_table() { //有用 hobby
  474. return ThridpartyScript.Nong.template.creteDomElement(
  475. `<table class="nong-table-new" id="nong-table-new-${this.randomNum}" rd="${this.randomNum}"></table>`);
  476. }
  477.  
  478. updata_table(src, data, type) {
  479. if (type == 'full') {
  480. let tab = $('#nong-table-new-'+ this.randomNum)[0];//"<table class="nong-table-new" id="nong-table-new-37331102" rd="37331102"></table>"
  481. tab.removeChild(tab.querySelector("#notice").parentElement.parentElement);
  482. for (let i = 0; i < data.length; i++) {
  483. tab.appendChild(ThridpartyScript.Nong.template.create_row(data[i]));
  484. }
  485. }
  486. this.reg_event();
  487. }
  488.  
  489. full() {
  490. let tab = this.create_empty_table();
  491. tab.appendChild(ThridpartyScript.Nong.template.create_head(this.randomNum));
  492. tab.appendChild(ThridpartyScript.Nong.template.create_loading());
  493. return tab;
  494. }
  495.  
  496. handle_event(event) {
  497. let maglink = event.target.parentElement.parentElement.getAttribute('maglink')
  498. || event.target.parentElement.parentElement.parentElement.getAttribute('maglink');
  499. if (event.target.className == 'nong-copy') {
  500. event.target.innerHTML = '成功';
  501. maglink = maglink.substr(0,60);
  502. GM_setClipboard(maglink);
  503. setTimeout(function () {
  504. event.target.innerHTML = '复制';
  505. }, 1000);
  506. event.preventDefault(); //阻止跳转
  507. }
  508. else if (event.target.className == 'nong-offline-download') {
  509. maglink = maglink.substr(0,60);
  510. GM_setValue('magnet', maglink);
  511. //获取115 token接口
  512. let promise = Common.request('http://115.com/?ct=offline&ac=space&_='+ new Date().getTime());
  513. promise.then((responseDetails) => {
  514. if (responseDetails.responseText.indexOf('html') >= 0) {
  515. //未登录处理
  516. Common.notifiy("115还没有登录",
  517. '请先登录115账户后,再离线下载!',
  518. icon,
  519. 'http://115.com/?mode=login'
  520. );
  521. return false;
  522. }
  523. var sign115 = JSON.parse(responseDetails.response).sign;
  524. var time115 = JSON.parse(responseDetails.response).time;
  525. console.log("uid=" + jav_userID + " sign:" + sign115 + " time:" + time115);
  526. console.log("rsp:" + responseDetails.response);
  527. GM_xmlhttpRequest({
  528. method: 'POST',
  529. url: 'http://115.com/web/lixian/?ct=lixian&ac=add_task_url', //添加115离线任务接口
  530. headers: {
  531. "Content-Type": "application/x-www-form-urlencoded"
  532. },
  533. data: "url=" + encodeURIComponent(maglink) + "&uid=" + jav_userID + "&sign=" + sign115
  534. + "&time=" + time115,
  535. onload: function (responseDetails) {
  536. var lxRs = JSON.parse(responseDetails.responseText); //离线结果
  537. if (lxRs.state) {
  538. //离线任务添加成功
  539. Common.notifiy("115老司机自动开车",
  540. '离线任务添加成功',
  541. icon,
  542. 'http://115.com/?tab=offline&mode=wangpan'
  543. );
  544. }
  545. else {
  546. //离线任务添加失败
  547. if (lxRs.errcode == '911') {
  548. lxRs.error_msg = '你的帐号使用异常,需要在线手工重新验证即可正常使用。';
  549. }
  550. Common.notifiy("失败了",
  551. '请重新打开115,' + lxRs.error_msg,
  552. icon,
  553. 'http://115.com/?tab=offline&mode=wangpan'
  554. );
  555. }
  556. console.log("sign:" + sign115 + " time:" + time115);
  557. console.log("磁链:" + maglink + " 下载结果:" + lxRs.state + " 原因:" + lxRs.error_msg);
  558. console.log("rsp:" + responseDetails.response);
  559. }
  560. });
  561.  
  562. });
  563. event.preventDefault(); //阻止跳转
  564. }
  565. }
  566.  
  567. reg_event() { // target 处理 更精准
  568. let list = [
  569. '.nong-copy',
  570. '.nong-offline-download'
  571. ];
  572. for (let i = 0; i < list.length; i++) {
  573. let a = document.querySelectorAll(list[i]);
  574. for (let u = 0; u < a.length; u++) {
  575. a[u].addEventListener('click', this.handle_event, false);
  576. }
  577. }
  578. }
  579.  
  580. parse_error(a) {
  581. alert("调用搜索引擎错误,可能需要更新,请向作者反馈。i=" + a);
  582. }
  583. };
  584. ThridpartyScript.Nong.resource_sites = { // 数组函数
  585. "btos.pw": function (keyword, cb) { //btsow
  586. let promise = Common.request("https://" + GM_getValue('search_index') + "/search/" + keyword);
  587. promise.then((result) => {
  588. this.full_url = result.finalUrl;
  589. var doc = Common.parsetext(result.responseText);
  590. if (!doc) {
  591. this.parse_error(GM_getValue('search_index'));
  592. }
  593. var data = [];
  594. var t = doc.getElementsByClassName('data-list')[0];
  595. if (t) {
  596. var a = t.getElementsByTagName('a');
  597. for (var i = 0; i < a.length; i++) {
  598. if (!a[i].className.match('btn')) {
  599. data.push({
  600. 'title': a[i].title,
  601. 'maglink': 'magnet:?xt=urn:btih:' + a[i].outerHTML.replace(/.*hash\//, '').replace(/" .*\n.*\n.*\n.*/, ''),
  602. 'size': a[i].nextElementSibling.textContent,
  603. 'src': a[i].href,
  604. });
  605. }
  606. }
  607. }
  608. cb(result.finalUrl, data);
  609. });
  610. },
  611. "www.btdig.com": function (keyword, cb) {
  612. let promise = Common.request("https://" + GM_getValue('search_index') + "/search?q=" + keyword);
  613. promise.then((result) => {
  614. this.full_url = result.finalUrl;
  615. let doc = Common.parsetext(result.responseText);
  616. let data = [];
  617. let t = doc.querySelectorAll("div.one_result");
  618. if (t) {
  619. for (let elem of t) {
  620. data.push({
  621. "title": elem.querySelector(".torrent_name a").textContent,
  622. "maglink": elem.querySelector(".fa.fa-magnet a").href,
  623. "size": elem.querySelector(".torrent_size").textContent,
  624. "src": elem.querySelector(".torrent_name a").href,
  625. });
  626. }
  627. }
  628. else {
  629. data.push({
  630. "title": "没有找到磁链接",
  631. "maglink": "",
  632. "size": "0",
  633. "src": result.finalUrl,
  634. });
  635. }
  636. cb(result.finalUrl, data);
  637. });
  638. },
  639. "sukebei.nyaa.si": function (keyword, cb) {
  640. let promise = Common.request("https://" + GM_getValue('search_index') + "/?f=0&c=0_0&q=" + keyword);
  641. promise.then((result) => {
  642. this.full_url = result.finalUrl;
  643. let doc = Common.parsetext(result.responseText);
  644. if (!doc) {
  645. thirdparty.nong.search_engines.parse_error(GM_getValue('search_index'));
  646. }
  647. let data = [];
  648. let t = doc.querySelectorAll("tr.default,tr.success");
  649. if (t.length !== 0) {
  650. for (let elem of t) {
  651. //debugger;
  652. data.push({
  653. "title": elem.querySelector("td:nth-child(2)>a:nth-child(1)").title,
  654. "maglink": elem.querySelector("td:nth-child(3)>a:nth-last-child(1)").href,
  655. //"torrent_url": "https://nyaa.si" + elem.querySelector("td:nth-child(3)>a:nth-child(1)").href,
  656. "size": elem.querySelector("td:nth-child(4)").textContent,
  657. "src": "https://sukebei.nyaa.si"
  658. + elem.querySelector("td:nth-child(2)>a:nth-child(1)").getAttribute('href'),
  659. });
  660. }
  661. }
  662. cb(result.finalUrl, data);
  663. });
  664. },
  665. "www.torrentkitty.tv": function (keyword, cb) {
  666. let promise = Common.request("https://" + GM_getValue('search_index') + "/search/" + keyword);
  667. promise.then((result) => {
  668. this.full_url = result.finalUrl;
  669. let doc = Common.parsetext(result.responseText);
  670. let data = [];
  671. let t = doc.querySelectorAll("#archiveResult tr");
  672. if (t) {
  673. t = Array.slice(t, 1, t.length);
  674. for (let elem of t) {
  675. if((/(No result)/g).test(elem.querySelector(".name").textContent))
  676. break;
  677. data.push({
  678. "title": elem.querySelector(".name").textContent,
  679. "maglink": elem.querySelector(".action>a:nth-child(2)").href,
  680. "size": elem.querySelector(".size").textContent,
  681. "src": "https://www.torrentkitty.tv" + elem.querySelector(".action>a:nth-child(1)").getAttribute('href'),
  682. });
  683. }
  684. }
  685. else {
  686. data.push({
  687. "title": "没有找到磁链接",
  688. "maglink": "",
  689. "size": "0",
  690. "src": result.finalUrl,
  691. });
  692. }
  693. cb(result.finalUrl, data);
  694. });
  695. },
  696.  
  697. };
  698. ThridpartyScript.Nong.offline_sites = {
  699. 115: {
  700. name: '115离线',
  701. url: 'http://115.com/?tab=offline&mode=wangpan',
  702. enable: true,
  703. },
  704. };
  705.  
  706. ThridpartyScript.Nong.template = class {
  707. static create_head(randomNum) {
  708. var tr = document.createElement('tr');
  709. tr.className = 'jav-nong-row';
  710. tr.id = 'jav-nong-head-'+randomNum;
  711. let list = ['标题','大小','操作','离线下载'];
  712. for (let i = 0; i < list.length; i++) {
  713. let b = ThridpartyScript.Nong.template.head.cloneNode(true);
  714. if (i === 0) {
  715. let select = document.createElement("select");
  716. select.id = randomNum;
  717. let ops = Object.keys(ThridpartyScript.Nong.resource_sites);
  718. let cur_index = GM_getValue("search_index", ops[0]);
  719. for (let j = 0; j < ops.length; j++) {
  720. let op = document.createElement("option");
  721. op.value = ops[j];
  722. op.textContent = ops[j];
  723. if (cur_index == ops[j]) {
  724. op.setAttribute("selected", "selected");
  725. }
  726. select.appendChild(op);
  727. }
  728. b.removeChild(b.firstChild);
  729. b.appendChild(select);
  730. tr.appendChild(b);
  731. continue;
  732. }
  733. b.firstChild.textContent = list[i];
  734. tr.appendChild(b);
  735. }
  736.  
  737. return tr;
  738. }
  739.  
  740. static create_row(data) {
  741. var a = document.createElement('tr');
  742. a.className = 'jav-nong-row';
  743. a.setAttribute('maglink', data.maglink);
  744.  
  745. // 暂时针对cnbtkitty.pw站点生效。
  746. if(data.maglink.indexOf("#magnetlink")>-1){
  747. a.setAttribute('id', data.id);
  748. let promise1 = Common.request(data.maglink + "?hobbyId=" + data.id);// 传递修改hobbyId,用于修改时定位。
  749. promise1.then((result) => {
  750. //定位磁链编码开始下标位置
  751. let indexNum = result.responseText.indexOf('#website#infohash#');
  752. if (indexNum >= 0) {
  753. let magnetlink = result.responseText.substring(indexNum + 18, indexNum + 58);
  754. let hobbyId = result.finalUrl.substring(result.finalUrl.indexOf('?hobbyId=') + 9, result.finalUrl.length);
  755. $("#" + hobbyId).attr("maglink", "magnet:?xt=urn:btih:" + magnetlink);
  756. }
  757. });
  758. }
  759.  
  760. var b = document.createElement('td');
  761. var list = [
  762. this.create_info(data.title, data.maglink),
  763. this.create_size(data.size, data.src),
  764. this.create_operation(data.maglink),
  765. this.create_offline()
  766. ];
  767. for (var i = 0; i < list.length; i++) {
  768. var c = b.cloneNode(true);
  769. c.appendChild(list[i]);
  770. a.appendChild(c);
  771. }
  772. return a;
  773. }
  774.  
  775. static create_loading() {
  776. return this.creteDomElement('<tr class="jav-nong-row"><td><p id="notice">Loading</p></td></tr>');
  777. }
  778.  
  779. static create_info(title, maglink) {
  780. let a = this.info.cloneNode(true);
  781. a.firstChild.textContent = title.length < 20 ? title : title.substr(0, 20) + '...';
  782. a.firstChild.href = maglink;
  783. a.title = title;
  784. return a;
  785. }
  786.  
  787. static create_size(size, src) {
  788. let a = this.size.cloneNode(true);
  789. a.textContent = size;
  790. a.href = src;
  791. return a;
  792. }
  793.  
  794. static create_operation(maglink) {
  795. let a = this.operation.cloneNode(true);
  796. a.firstChild.href = maglink;
  797. return a;
  798. }
  799.  
  800. static create_offline() { //有用 hobby
  801. let a = this.offline();
  802. a.className = 'nong-offline';
  803. return a;
  804. }
  805.  
  806. static offline() {
  807. let a = document.createElement('div');
  808. let b = document.createElement('a');
  809. b.className = 'nong-offline-download';
  810. b.target = '_blank';
  811. let offline_sites = ThridpartyScript.Nong.offline_sites
  812. for (let k in offline_sites) {
  813. if (offline_sites[k].enable) {
  814. let c = b.cloneNode(true);
  815. c.href = offline_sites[k].url;
  816. c.textContent = offline_sites[k].name;
  817. a.appendChild(c);
  818. }
  819. }
  820. return a;
  821. }
  822.  
  823. static creteDomElement(htmlStr){
  824. //return document.createRange().createContextualFragment(htmlString); // dom树结构出错
  825. //let parser = new DOMParser();
  826. //return (parser.parseFromString(htmlString,"text/xml")); //出错
  827. //return $(htmlString).get(0); // create_loading结果出错
  828. let div = document.createElement("div");
  829. $(div).append(htmlStr);
  830. return div.childNodes[0];
  831. }
  832. };
  833. ThridpartyScript.Nong.template.head = ThridpartyScript.Nong.template.creteDomElement('<th><a></a></th>');
  834. ThridpartyScript.Nong.template.info = ThridpartyScript.Nong.template.creteDomElement('<div><a href="src">name</a></div>');
  835. ThridpartyScript.Nong.template.size = ThridpartyScript.Nong.template.creteDomElement('<a>size</a>');
  836. ThridpartyScript.Nong.template.operation = ThridpartyScript.Nong.template.creteDomElement('<div><a class="nong-copy">复制</a></div>');
  837.  
  838. // 登录115执行脚本,自动离线下载准备步骤
  839. ThridpartyScript.login115Run = () =>{
  840. if (location.host.indexOf('115.com') >= 0) {
  841. jav_userID = GM_getValue('jav_user_id', 0); //115用户ID缓存
  842. //获取115ID
  843. if (jav_userID === 0) {
  844. if (location.host.indexOf('115.com') >= 0) {
  845. if (typeof (window.wrappedJSObject.user_id) != 'undefined') {
  846. jav_userID = window.wrappedJSObject.user_id;
  847. GM_setValue('jav_user_id', jav_userID);
  848. alert('115登陆成功!');
  849. return;
  850. }
  851. } else {
  852. //alert('请先登录115账户!');
  853. Common.notifiy("115还没有登录",
  854. '请先登录115账户后,再离线下载!',
  855. icon,
  856. 'http://115.com/?mode=login'
  857. );
  858. GM_setValue('jav_user_id', 0);
  859. }
  860. }
  861.  
  862. if (location.host.indexOf('115.com') >= 0) {
  863. console.log('jav老司机:115.com,尝试获取userid.');
  864. jav_userID = GM_getValue('jav_user_id', 0);
  865. //debugger;
  866. if (jav_userID !== 0) {
  867. console.log("jav老司机: 115账号:" + jav_userID + ",无需初始化.");
  868. return false;
  869. }
  870. jav_userID = $.cookie("OOFL");
  871. console.log("jav老司机: 115账号:" + jav_userID);
  872. if (!jav_userID) {
  873. console.log("jav老司机: 尚未登录115账号");
  874. return false;
  875. } else {
  876. console.log("jav老司机: 初始化成功");
  877. Common.notifiy('老司机自动开车', '登陆初始化成功,赶紧上车把!', icon, "");
  878. GM_setValue('jav_user_id', jav_userID);
  879. }
  880. return false;
  881. }
  882. }
  883. }
  884.  
  885. class BlogjavWaterfall extends ThridpartyScript.Waterfall {
  886. constructor(columnNum,selectorNext,selectorItem){
  887. super(columnNum,selectorNext,selectorItem);
  888. }
  889.  
  890. /**
  891. * 处理当前页面加载项
  892. * @param item 当前页面加载元素
  893. */
  894. processItem(item){
  895. let id = $(item).attr('id');
  896. if($(`#${id}`).length > 0) {
  897. $(item).attr('id','delete');
  898. $(item).empty();
  899. return;
  900. }
  901. // 获取文章的标题文字
  902. let titleStr = $(item).find("h1[itemprop='name'] a,h2[itemprop='name'] a")[0].innerHTML;
  903. if(location.href.indexOf("deleteOccident") > 0 ){//&& Common.hasWords(titleStr,occidentSeriesArray)
  904. let reg = /[\w\s&’.,:;!+-=?]/g;
  905. let str = titleStr.replace(reg,'');
  906. console.log('66665:'+str);
  907. str = str.replace('–','');
  908. console.log('66666:'+str);
  909. if(str.length <= 0){
  910. console.log('delete: '+titleStr);
  911. $(item).attr('id','delete');
  912. $(item).empty();
  913. return;
  914. }
  915. }
  916.  
  917. let aEle = $(item).find("a.more-link")[0];
  918. let handleFlag = $(aEle).attr('handle');
  919. if(!handleFlag){
  920. $(aEle).attr('handle', '1');
  921. $(aEle).html("点击进内页");
  922.  
  923. //查找title2的div元素
  924. let divEle = $(item).children("div.title2")[0];
  925. $(item).html($(item).html().replace(/Tags:/ig,'')
  926. .replace('View More Info &amp; Screenshot :',''));
  927.  
  928. $(item).find('.date').append("&nbsp; Tags: &nbsp;").append($(item).find('.tags'));
  929. $(item).find('.date').append("&nbsp;&nbsp; View More Info & Screenshot:&nbsp;");
  930. $(item).find('.date').append(aEle);
  931.  
  932. let requstUrl = aEle.href;
  933.  
  934. //封面图
  935. //let imgEle = $(item).find("img.alignnone")[0];
  936.  
  937. // 过滤文字
  938. titleStr = titleStr.replace(/【/g, " ");
  939. titleStr = Common.filterWords(titleStr);
  940. let code = "";
  941.  
  942. //如果包含指定单词字符
  943. if(Common.hasWords(titleStr,wordsArray)){
  944. // 获取av番号
  945. code = titleStr.split(" ")[0] + " " + titleStr.split(" ")[1];
  946. }
  947. else{
  948. // 获取av番号
  949. code = titleStr.split(" ")[0];
  950. }
  951.  
  952.  
  953. // 将外链元素P插入帖子div元素内最后面
  954. if(code !== ""){
  955. $(item).append(Common.crtOutLink(code));
  956. }
  957. else{
  958. $(item).append(Common.crtOutLink(titleStr.split(" ")[1]));
  959. }
  960. requstUrl = requstUrl.replace('#', "?");//console.log("requstUrl:"+requstUrl);
  961.  
  962. //异步请求调用内页详情的访问地址
  963. GM_xmlhttpRequest({
  964. method: "GET",
  965. //大图地址
  966. url: requstUrl + "?" + code,
  967. headers:{
  968. referrer: "http://pixhost.org/"
  969. },
  970. onload: function(XMLHttpRequest) {
  971. let bodyStr = XMLHttpRequest.responseText;
  972. let yixieBody = bodyStr.substring(bodyStr.search(/<span id="more-(\S*)"><\/span>/),bodyStr.search(/<div class="category/));
  973.  
  974. let dateBody = bodyStr.substring(bodyStr.search(/<span class="comm"/),bodyStr.search(/<div class="cover"/));//<span class="comm">Date: August 6th, 2015</span>
  975.  
  976. let dateStr = dateBody.substring(dateBody.indexOf('<span'),dateBody.indexOf('<\/span') + 7);
  977. dateStr = Common.filterDict(dateStr,replaceMonth);
  978. //console.log("dateStr:"+dateStr);
  979. //console.log("finalUrl:"+XMLHttpRequest.finalUrl);
  980. let moreId = XMLHttpRequest.finalUrl.split("?")[1];//例如:more-265519 more-265541
  981. let postId = "post" + moreId.substring(4,moreId.length);//例如:post-265519 more-265541
  982. //console.log("post:"+postId);
  983.  
  984. $(`#${postId} div[class="date"] span[itemprop="datePublished"]`).remove();
  985. //添加日期
  986. $(`#${postId} div[class="date"]`).prepend(dateStr);
  987.  
  988. let img_start_idx = yixieBody.search(/"><img .*src="https*:\/\/(\S*)pixhost.*\/thumbs\//);
  989. //如果找到内容大图
  990. if( img_start_idx > 0)
  991. {
  992. // 预览JAV缩略图
  993. let new_img_src = yixieBody.substring(yixieBody.indexOf('src',img_start_idx) + 5,yixieBody.indexOf('alt') - 2).replace('"','');
  994. // 预览JAV大图
  995. let targetImgUrl = new_img_src.replace('thumbs','images').replace('//t','//img').replace('"','') + '?';
  996.  
  997. let $imgCover = $('#'+postId+' p img');
  998.  
  999. $('#'+postId+' p img.emoji').remove();
  1000. $imgCover.attr("class","alignnone");
  1001. $(item).find('.alignnone').nextAll().remove();
  1002.  
  1003. // 获取av番号
  1004. var vid = XMLHttpRequest.finalUrl.split("?")[2];
  1005. console.log(`vid:${vid} imgUrl:${targetImgUrl} url:${XMLHttpRequest.finalUrl}`);
  1006. Common.addJavMovieImg(new_img_src,targetImgUrl,function ($img) {
  1007. $img.attr("vid",vid);
  1008. $imgCover.after($img);
  1009. });
  1010. }
  1011. }
  1012. });//end GM_xmlhttpRequest
  1013. }
  1014. }
  1015. }
  1016.  
  1017. class BlogjavNong extends ThridpartyScript.Nong {
  1018. constructor(keyword,randomNum,$locateObj){
  1019. super(keyword,randomNum,$locateObj);
  1020. }
  1021.  
  1022. /**
  1023. * 处理加载磁链搜索列表的位置
  1024. */
  1025. processMagnetTab($locateObj){
  1026. //let $img = $(this).parents(".nong-table-new").siblings("img[name='javRealImg']");
  1027. if(!$locateObj.attr("class")){
  1028. $locateObj.after(this.cur_tab);
  1029. }else{
  1030. $locateObj.before(this.cur_tab);
  1031. }
  1032. }
  1033. }
  1034.  
  1035. function onlyViewsAndSeeAll(){
  1036. //获取所有jav的div元素
  1037. let jav_div_arr = $("div[class='single']");
  1038. let seeAllFlag = $('#onlyViews').attr("seeall");
  1039. for (let index = 0; index < jav_div_arr.length; index++) {
  1040. let javDivEle = jav_div_arr[index];
  1041. let isViewFlag = $(javDivEle).attr("isView");
  1042.  
  1043. if(!isViewFlag || isViewFlag == '0'){
  1044. if(seeAllFlag == '1'){
  1045. $(javDivEle).css("display","none");//todo display: none;
  1046. }
  1047. else{
  1048. $(javDivEle).css("display","");
  1049. }
  1050. }
  1051. else{
  1052. if(seeAllFlag == '1'){
  1053. $(javDivEle).find('img[name="javRealImg"]').click();
  1054. }
  1055. }
  1056. }
  1057.  
  1058. if(seeAllFlag == '1'){
  1059. $('#navigation')[0].scrollIntoView();
  1060. $('#onlyViews').attr("seeall","0");
  1061. $("#onlyViews").text("查看全部");
  1062. }
  1063. else{
  1064. $('#onlyViews').attr("seeall","1");
  1065. $("#onlyViews").text("只看已阅");
  1066. }
  1067. }
  1068.  
  1069. document.addEventListener('DOMContentLoaded', function () {
  1070. // 115脚本运行
  1071. ThridpartyScript.login115Run();
  1072. $("#top").remove();
  1073. $("div.rate").remove();
  1074.  
  1075. //覆盖原有css样式
  1076. //GM_addStyle('body {background: white;}');
  1077. GM_addStyle(`
  1078. #catmenu {width: 100%;} .link {text-align: center;color: red;text-decoration: underline;}
  1079. #top {width: 100%;} .breadcrumbs {display: -webkit-box;}
  1080. #wrapper {width: 100%;margin: 0 auto;} .tags {width:0 !important}
  1081. #waterfall {float: none; width: auto;height: 100%;padding:10px 0 0 10px;overflow: hidden;display: block;}
  1082. #casing {background: #fff;width: initial;padding: 0 0 10px;}
  1083. .right {float: left;width: 185px;padding: 0px 0 0;margin-right: 0;}
  1084. img.alignnone {width: initial;max-width: 1000px;float: left;padding: 0px;}
  1085. .single {width: initial;display: grid;margin: 0 0 0 10px;}/**display: table-row;*/
  1086. #navigation {width: inherit;margin-left: 10px;}
  1087. .max{width:auto;height:auto;max-width: none;}
  1088. .min{width:66px;height:auto;}
  1089. .tags{width: 200px;display: inline-table;}
  1090. #s{width: 155px;}#search{width: 155px;}.sidebox {width: 200px;}.video {width: 175px;}.sidebox ul li {width: 195px;}.subscription_email {width: 75%;}
  1091. `);
  1092.  
  1093. // 挊
  1094. GM_addStyle(`
  1095. .nong-table-new {margin:0 0 0 5px;color:#666 !important;font-size:13px;text-align:center;background-color: #c9c7c7;float: left;border-spacing: 1px;}
  1096. .nong-table-new th,.nong-table-new td {text-align: center;height:30px;background-color: #FFF;padding:0 1em 0;}
  1097. .jav-nong-row{text-align: center;height:30px;background-color: #FFF;padding:0 1em 0;border: 1px solid #EFEFEF;}
  1098. .nong-copy{color:#08c !important;}
  1099. .nong-offline{text-align: center;}
  1100. #jav-nong-head a {margin-right: 5px;}
  1101. .nong-offline-download{color: rgb(0, 180, 30) !important; margin-right: 4px !important;}
  1102. .nong-offline-download:hover{color:red !important;}
  1103. `);
  1104.  
  1105. //<meta http-equiv="refresh" content="1200"> 每20分钟刷新一次 目前无法处理
  1106. $(".right").insertBefore("#content");
  1107. $('.breadcrumbs').append($("#navigation").clone());
  1108.  
  1109. $("#top").remove();
  1110.  
  1111. //删除所有a元素的href为www.histats.com网址的数据
  1112. $("a[href='http://www.histats.com']").remove();
  1113.  
  1114. //获取分页链接的所有a元素
  1115. var page_a_arr = $("div[class='wp-pagenavi'] a");
  1116. for (var index = 0; index < page_a_arr.length; index++) {
  1117. var pageAEle = page_a_arr[index];
  1118. $(pageAEle).attr("target","_blank");
  1119. }
  1120.  
  1121. //导航栏上增加内容显示
  1122. $("#catmenu").append(`<ul style="float: right;font-size: 125%;">
  1123. <li id="hisli"><a style="color: white;" id="hisUrl">上次加载到的那一页&nbsp;&nbsp;</a></li>
  1124. <li><a style="color: white;">已加载页数:&nbsp;&nbsp;<span id="addPageNbr">0</span>&nbsp;&nbsp;</a></li>
  1125. <li><a style="color: white;">已加载到第&nbsp;<span id="currNextPageNbr">1</span>&nbsp;页&nbsp;&nbsp;</a></li>
  1126. <li><a style="color: white;">已阅JAV数:&nbsp;&nbsp;<span id="viewJavNbr">0</span>&nbsp;&nbsp;</a></li>
  1127. <li><a id="onlyViews" seeall="1" href="javascript:void(0);" style="color: red;">只看已阅</a></li>
  1128. <li><a href="${location.pathname}?deleteOccident" style="color: yellow;">不看欧美</a></li>
  1129. </ul>`);
  1130. $("#onlyViews").click(function(){
  1131. onlyViewsAndSeeAll();
  1132. });
  1133.  
  1134. //区分列表和详细内页
  1135. if($('#content div[itemscope]').length > 0){
  1136. $('#content').attr("id","waterfall");
  1137. let blogJavWaterfall = new BlogjavWaterfall(1,'a.nextpostslink','div#content div.single');
  1138. blogJavWaterfall.intersectionObserver().observe($('.footer').get(0));
  1139. }
  1140. }, false);
  1141. })();