Sleazy Fork is available in English.

图聚合展示by xhua

目标是聚合网页美女图

  1. // ==UserScript==
  2. // @name 图聚合展示by xhua
  3. // @namespace http://cmsv1.findmd5.com/
  4. // @version 3.10
  5. // @description 目标是聚合网页美女图
  6. // @author selang
  7. //
  8. // @include /https?\:\/\/(www\.)?hentai-cosplay\.com/
  9. // @include /https?\:\/\/(www\.)?porn-image-xxx\.com/
  10. // @include /https?\:\/\/(www\.)?umei\.fun/
  11. // @include /http?\:\/\/(www\.)?wndfx\.com/
  12. // @include /http?\:\/\/(www\.)?yhxz521\.com/
  13. //
  14. //
  15. //
  16. // @include /https?\:\/\/www\.lsmpx\.com/
  17. // @include /https?\:\/\/www\.lsm\.me/
  18. // @include /https?\:\/\/www\.umei\.cc/
  19. // @include /https?\:\/\/www\.meitulu\.com/
  20. // @include /https?\:\/\/www\.17786\.com/
  21. // @include /https?\:\/\/www\.nvshens\.com/
  22. // @include /https?\:\/\/m\.nvshens\.com/
  23. // @include /https?\:\/\/www\.youtube\.com/
  24. // @include /https?\:\/\/www\.aitaotu\.com/
  25. // @include /https?\:\/\/www\.mzitu\.com/
  26. // @include /https?\:\/\/www\.beautylegmm\.com/
  27. // @include /https?\:\/\/www\.rosiyy\.com/
  28. // @include /https?\:\/\/www\.xgtaotu\.com/
  29. // @include /https?\:\/\/www\.xgtutu\.com/
  30. // @include /https?\:\/\/www\.youzi4\.cc/
  31. // @include /https?\:\/\/www\.xiumeim\.com/
  32. // @include /https?\:\/\/www\.xmeim\.com/
  33. // @include /https?\:\/\/www\.win4000\.com/
  34. // @include /https?\:\/\/www\.mm131\.com/
  35. // @include /https?\:\/\/www\.114tuku\.com/
  36. // @include /https?\:\/\/www\.192tt\.com/
  37. // @include /https?\:\/\/www\.192tb\.com/
  38. // @include /https?\:\/\/www\.meituri\.com/
  39. // @include /https?\:\/\/www\.xiuren\.org/
  40. // @include /https?\:\/\/www\.juemei\.com/
  41. // @include /https?\:\/\/www\.tuao81\.top/
  42. // @include /https?\:\/\/(www\.)?rosim\.cc/
  43. // @require https://cdn.staticfile.org/jquery/1.12.4/jquery.min.js
  44. // @require https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/1.3.8/FileSaver.min.js
  45. // @require https://cdnjs.cloudflare.com/ajax/libs/dom-to-image/2.6.0/dom-to-image.min.js
  46. // @require https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.5/jszip.min.js
  47. // @require https://cdnjs.cloudflare.com/ajax/libs/dexie/1.5.1/dexie.min.js
  48. // @require https://cdnjs.cloudflare.com/ajax/libs/webtorrent/0.98.19/webtorrent.min.js
  49. // @connect *
  50. // @grant GM_download
  51. // @grant GM_openInTab
  52. // @grant GM_getTab
  53. // @grant GM_getTabs
  54. // @grant GM_saveTab
  55. // @grant GM_xmlhttpRequest
  56. // @grant GM_addStyle
  57. // @grant GM_registerMenuCommand
  58. // @grant unsafeWindow
  59. // ==/UserScript==
  60.  
  61. GM_addStyle(".sl-btn { border:1 !important; } .sl-c-pic { margin-top:6px } ");
  62.  
  63. //日志
  64. function log() {
  65. if (false) {
  66. console.log.apply(this, arguments);
  67. }
  68. };
  69.  
  70. function err() {
  71. if (true) {
  72. console.error.apply(this, arguments);
  73. }
  74. }
  75.  
  76. function priorityLog() {
  77. console.log.apply(this, arguments);
  78. }
  79.  
  80. var Alpha_Script = {
  81. obtainHtml: function (options) {
  82. options = options || {};
  83. if (!options.url || !options.method) {
  84. throw new Error("参数不合法");
  85. }
  86. GM_xmlhttpRequest(options);
  87. },
  88. parseHeaders: function (headStr) {
  89. var o = {};
  90. var myregexp = /^([^:]+):(.*)$/img;
  91. var match = /^([^:]+):(.*)$/img.exec(headStr);
  92. while (match != null) {
  93. o[match[1].trim()] = match[2].trim();
  94. match = myregexp.exec(headStr);
  95. }
  96. return o;
  97. },
  98. //获取参数
  99. getParam: function (dest, name) {
  100. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  101. var r = dest.match(reg);
  102. if (r != null) return decodeURI(r[2]);
  103. return null;
  104. },
  105. isArray: function (value) {
  106. return Object.prototype.toString.apply(value) === '[object Array]';
  107. }
  108. };
  109.  
  110. (function () {
  111. 'use strict';
  112. priorityLog('未实现:');
  113.  
  114. function injectBtns() {
  115. var blobCache = {};
  116. var blobUrlCache = {};
  117.  
  118. var pageUrls = [];
  119. var injectComponent =
  120. '<input id="captureBtn" type="button" class="sl-btn" value="截图并下载"/>' +
  121. '<span>&nbsp;&nbsp;</span>' +
  122. '<input id="packageBtn" type="button" class="sl-btn" value="打包下载聚合图片"/>' +
  123. '<span>&nbsp;&nbsp;</span>' +
  124. '<input id="injectaggregatBtn" type="button" class="sl-btn" value="聚合显示"/>';
  125. var domain = '';
  126. var hostName = window.location.hostname;
  127. var protocol = window.location.protocol;
  128. var startUrl = protocol + '//' + hostName + '/';
  129. var injectAggregationRef = null;
  130. var switchAggregationBtn = null;
  131. var collectPics = null;
  132. var switchAggregationBtnTemplateFunc = function (aggregationDispayFunc, aggregationDispayNoneFunc) {
  133. if ($('#injectaggregatBtn').val() === '聚合显示') {
  134. $('#injectaggregatBtn').val('聚合隐藏');
  135. $('#c_container').show();
  136. aggregationDispayFunc();
  137. } else {
  138. $('#injectaggregatBtn').val('聚合显示');
  139. $('#c_container').hide();
  140. aggregationDispayNoneFunc();
  141. }
  142. };
  143. var collectPicsTemplateFunc = function (parseImgsFunc, imgStyleFunc) {
  144. var id = setInterval(function () {
  145. if ($) {
  146. clearInterval(id);
  147. var breakPageLoop = false;
  148. for (var i = 0, len = pageUrls.length; i < len; i++) {
  149. //创建div去装各自
  150. $('#c_container').append('<div id="c_' + i + '"></div>');
  151. if (!breakPageLoop) {
  152. debugger
  153. var pageUrl = startUrl + pageUrls[i];
  154. Alpha_Script.obtainHtml({
  155. url: pageUrl,
  156. headers: Alpha_Script.parseHeaders("Accept:image/webp,image/*,*/*;q=0.8\n" +
  157. "Accept-Encoding:gzip, deflate, sdch\n" +
  158. "Accept-Language:zh-CN,zh;q=0.8\n" +
  159. "Referer:" + window.location.href + "\n" +
  160. "User-Agent:Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"
  161. ),
  162. method: 'GET',
  163. onload: function () {
  164. var _i = i;
  165. var _pageUrl = pageUrl;
  166. debugger
  167. return function (response) {
  168. log('response pageUrl:', _pageUrl);
  169. debugger
  170. if (response && response.status && response.status >= 200 && response.status < 300) {
  171. var html = response.responseText;
  172. // log('html==>',html);
  173. var parser = new DOMParser();
  174. var doc = parser.parseFromString(html, "text/html");
  175. var imgObj = parseImgsFunc(doc);
  176. var imgContainerCssSelector = '#c_' + _i;
  177. log(imgContainerCssSelector);
  178. $(imgObj).each(function (index) {
  179. log(index, ':', $(this).prop('outerHTML'));
  180. if (imgStyleFunc) {
  181. imgStyleFunc($(this)[0]);
  182. } else {
  183. $(this)[0].style = "width: 100%;height: 100%";
  184. }
  185. $(this).attr('label', 'sl');
  186. $(imgContainerCssSelector).append('<div class="sl-c-pic">' + $(this).prop('outerHTML') + '</div>');
  187. });
  188. }
  189. };
  190. }()
  191. });
  192. } else {
  193. break;
  194. }
  195. }
  196. }
  197. }, 100);
  198. };
  199. var match = function () {
  200. };
  201. var mismatch = function () {
  202. };
  203. var meet = function (options) {
  204. options = options || {};
  205. options.domain = options.domain || domain;
  206. options.match = options.match || match;
  207. options.mismatch = options.mismatch || mismatch;
  208. log(options.domain);
  209. var matchDomain = false;
  210. if (Alpha_Script.isArray(options.domain)) {
  211. for (var i = 0; i < options.domain.length; i++) {
  212. if (options.domain[i] === hostName) {
  213. matchDomain = true;
  214. break;
  215. }
  216. }
  217. } else {
  218. matchDomain = options.domain === hostName || options.domain === '';
  219. }
  220. return matchDomain;
  221. };
  222. var removeAD = null;
  223.  
  224. function packageAndDownload() {
  225. var zip = new JSZip();
  226. var imgList = $('img[label="sl"]');
  227. var length = imgList.length;
  228. $.each(imgList, function (index, value) {
  229. //zip.file("readme.txt", "感谢使用selang提供的插件。欢迎进群:455809302交流。一起玩。\r\n如果不是老司机,只要有创意也欢迎加入。点击链接加入群【油猴脚本私人级别定制】:https://jq.qq.com/?_wv=1027&k=460soLy\n");
  230. var myDate = new Date();//获取系统当前时间
  231. var times = myDate.getFullYear()+"-"+myDate.getMonth()+"-"+myDate.getDate()+"-"+myDate.getHours()+"-"+myDate.getMinutes()+"-"+myDate.getSeconds();
  232. var img = zip.folder(times);
  233. var imgSrc = $(value).attr('src');
  234. {
  235. if (blobCache[imgSrc]) {
  236. img.file(index + ".jpg", blobCache[imgSrc], {base64: false});
  237. length--;
  238. } else {
  239. if (!imgSrc.startsWith('blob:')) {
  240. Alpha_Script.obtainHtml({
  241. url: imgSrc,
  242. method: 'GET',
  243. headers: {
  244. "Accept": "application/*",
  245. "Referer": window.location.origin
  246. },
  247. responseType: 'blob',
  248. onload: function (response) {
  249. var responseHeaders = Alpha_Script.parseHeaders(response.responseHeaders);
  250. var contentType = responseHeaders['Content-Type'];
  251. if (!contentType) {
  252. contentType = "image/png";
  253. }
  254. var blob = new Blob([response.response], {type: contentType});
  255. blobCache[imgSrc] = blob;
  256. img.file(index + ".jpg", blobCache[imgSrc], {base64: false});
  257. length--;
  258. }
  259. });
  260. } else {
  261. img.file(index + ".jpg", blobCache[blobUrlCache[imgSrc]], {base64: false});
  262. length--;
  263. }
  264. }
  265. }
  266. });
  267. var id = setInterval(function () {
  268. if (length == 0) {
  269. clearInterval(id);
  270. zip.generateAsync({type: "blob"})
  271. .then(function (content) {
  272. saveAs(content, "PackageSL.zip");
  273. });
  274. }
  275. }, 100);
  276. }
  277.  
  278. function bindBtn(callback) {
  279. $('#injectaggregatBtn').bind('click', callback);
  280. $('#captureBtn').bind('click', function (e) {
  281. var imgList = $('img[label="sl"]');
  282. var length = imgList.length;
  283. $.each(imgList, function (index, value) {
  284. var imgSrc = $(value).attr('src');
  285. {
  286. if (blobCache[imgSrc]) {
  287. length--;
  288. } else {
  289. if (!imgSrc.startsWith('blob:')) {
  290. Alpha_Script.obtainHtml({
  291. url: imgSrc,
  292. method: 'GET',
  293. headers: {
  294. "Accept": "application/*"
  295. },
  296. responseType: 'blob',
  297. onload: function (response) {
  298. var responseHeaders = Alpha_Script.parseHeaders(response.responseHeaders);
  299. var contentType = responseHeaders['Content-Type'];
  300. if (!contentType) {
  301. contentType = "image/png";
  302. }
  303. var blob = new Blob([response.response], {type: contentType});
  304. blobCache[imgSrc] = blob;
  305. length--;
  306. }
  307. });
  308. }
  309. }
  310. }
  311. });
  312. var id = setInterval(function () {
  313. if (length == 0) {
  314. clearInterval(id);
  315. var length2 = imgList.length;
  316. $.each(imgList, function (index, value) {
  317. var imgSrc = $(value).attr('src');
  318. {
  319. if (!imgSrc.startsWith('blob:')) {
  320. if (blobCache[imgSrc]) {
  321. var objectURL = URL.createObjectURL(blobCache[imgSrc]);
  322. blobUrlCache[objectURL] = imgSrc;
  323. $(value).attr('src', objectURL);
  324. length2--;
  325. }
  326. } else {
  327. length2--;
  328. }
  329. }
  330. });
  331. var id2 = setInterval(function () {
  332. if (length2 == 0) {
  333. clearInterval(id2);
  334. var cContainner = $('#c_container').get(0);
  335. domtoimage.toBlob(cContainner)
  336. .then(function (blob) {
  337. if (blob) {
  338. saveAs(blob, "captureSL.png");
  339. } else {
  340. err('截图太大不能保存!');
  341. }
  342. })
  343. .catch(function (error) {
  344. err('截图太大不能保存!');
  345. });
  346. }
  347. }, 100);
  348.  
  349. }
  350. }, 100);
  351. });
  352. $('#packageBtn').bind('click', function (e) {
  353. packageAndDownload();
  354. });
  355. };
  356.  
  357. //热键
  358. function hotkeys() {
  359. GM_registerMenuCommand("图片打包下载", packageAndDownload, "d");
  360. $(document).keydown(function (e) {
  361. if (e.ctrlKey && e.shiftKey) {
  362. if (e.which == 76) {//L
  363. log("触发快捷键");
  364. }
  365. }
  366. });
  367. }
  368.  
  369. return {
  370. injectComponent: function (i) {
  371. if (i) injectComponent = i;
  372. return this;
  373. },
  374. domain: function (d) {
  375. if (d) domain = d;
  376. return this;
  377. },
  378. removeAD: function (fun) {
  379. if (fun) removeAD = fun;
  380. return this;
  381. },
  382. match: function (fun) {
  383. if (fun) match = fun;
  384. return this;
  385. },
  386. mismatch: function (fun) {
  387. if (fun) mismatch = fun;
  388. return this;
  389. },
  390. injectAggregationRef: function (fun) {
  391. if (fun) injectAggregationRef = fun;
  392. return this;
  393. },
  394. switchAggregationBtn: function (aggregationDispayFunc, aggregationDispayNoneFunc) {
  395. switchAggregationBtn = function () {
  396. switchAggregationBtnTemplateFunc(aggregationDispayFunc, aggregationDispayNoneFunc);
  397. };
  398. return this;
  399. },
  400. collectPics: function (parseImgsFunc, imgStyleFunc) {
  401. collectPics = function () {
  402. collectPicsTemplateFunc(parseImgsFunc, imgStyleFunc);
  403. }
  404. return this;
  405. },
  406. start: function () {
  407. //1、匹配当前hostName
  408. //2、注入操作界面
  409. //3、聚合多页图片
  410. //4、显示
  411. var matchDomain = meet();
  412. if (matchDomain) {
  413. if (removeAD) {
  414. removeAD();
  415. }
  416. if (injectAggregationRef) {
  417. injectAggregationRef.apply(this, [injectComponent, pageUrls]);
  418. $('#injectaggregatBtn').after('<div id="c_container"></div>');
  419. if (switchAggregationBtn) {
  420. switchAggregationBtn();
  421. if (collectPics) {
  422. collectPics();
  423. hotkeys();
  424. }
  425. }
  426. bindBtn(function () {
  427. if (switchAggregationBtn) {
  428. switchAggregationBtn();
  429. }
  430. });
  431. }
  432. } else {
  433.  
  434. }
  435. }
  436. }
  437. }
  438. ///////////////////////////////////////////yhxz521.com////////////////////////////////////////////////////
  439. injectBtns().domain('yhxz521.com').removeAD(function () {
  440. $('div.atc_new_head').remove();//移除广告等无必要元素
  441. $('div.keywords').remove();//移除广告等无必要元素
  442. }).switchAggregationBtn(function () {
  443. $('div.main').hide();
  444. $('div.photos').hide();
  445. $('div#imgwrap').hide();
  446. }, function () {
  447. $('div.main').show();
  448. $('div.photos').show();
  449. $('div#imgwrap').show();
  450. }).injectAggregationRef(function (injectComponent, pageUrls) {
  451. var currentPathname = window.location.pathname;
  452. var match = currentPathname.match(/\/(.+?\/)(\d+)(?:_\d+)?\.html/m);//http://www.aitaotu.com/weimei/36129.html//http://yhxz521.com/riben/1534.html
  453. debugger
  454. if (match !== null) {
  455. {
  456. var totalPageCnt = 1;
  457. var partPreUrl = match[1];
  458. var pageId = '/'+match[2]+'_';
  459. var suffixUrl = '.html';
  460. var limitPageStr = $('div.page a ').html();
  461. debugger
  462. var limitPageMatch = limitPageStr.match(/共(\d+)页/im);
  463. if (limitPageMatch != null) {
  464. var totalPics = parseInt(limitPageMatch[1]);
  465. var number = totalPics % 3;
  466. totalPageCnt = Math.floor(totalPics / 1);
  467. if (number > 0) {
  468. totalPageCnt = totalPageCnt + 1;
  469. }
  470. log('totalPageCnt', totalPageCnt);
  471. }
  472. var pageUrl = partPreUrl +'/'+match[2] + suffixUrl;
  473. pageUrls.push(pageUrl);
  474. for (var i = 2; i <= totalPageCnt; i++) {
  475. var pageUrl = partPreUrl + pageId + i + suffixUrl;
  476. log('push pageUrl:', pageUrl);
  477. pageUrls.push(pageUrl);
  478. }
  479. }
  480. $('div.article_position').after(injectComponent);
  481. }
  482. }).collectPics(function (doc) {
  483. return $(doc).find('div#disappear img');
  484. }, function (imgE) {
  485. imgE.style = "width: 70%;height: 70%";
  486. }).start();
  487.  
  488.  
  489. ///////////////////////////////////////////umei.fun////////////////////////////////////////////////////
  490. injectBtns().domain(['umei.fun']).removeAD(function () {
  491. $("div[id^='gn_delivery']").remove();
  492. $("a[id^='__qdd_ciw_a__']").remove();
  493. $('iframe').remove();//移除广告等无必要元素
  494. }).switchAggregationBtn(function () {
  495. $('#display_image_detail').hide();
  496. $('#paginator').hide();
  497. }, function () {
  498. $('#display_image_detail').show();
  499. $('#paginator').show();
  500. }).injectAggregationRef(function (injectComponent, pageUrls) {
  501. var match = window.location.pathname.match(/(\/\d+)/im); ///image/cos-cos-1/page/2/""
  502.  
  503. //var limitPageStr = $('#paginator').html();
  504. //var limitPageMatch = limitPageStr.match(/\/page\/\d+\/\">last/im)[0].match(/\d+/);
  505. //var maxpage=limitPageMatch[0];
  506. if (match !== null) {
  507. {
  508. var partPreUrl = window.location.pathname;
  509. pageUrls.push(partPreUrl);
  510. }
  511. $('h2').after(injectComponent);
  512. }
  513. }).collectPics(function (doc) {
  514. return $(doc).find('div.card img');//class . id#
  515. }, function (imgE) {
  516. imgE.style = "width: 100%;height: 100%";
  517. }).start();
  518. ///////////////////////////////////////////wndfx.com////////////////////////////////////////////////////
  519. injectBtns().domain('www.wndfx.com').removeAD(function () {
  520. $('div.atc_new_head').remove();//移除广告等无必要元素
  521. $('div.keywords').remove();//移除广告等无必要元素
  522. }).switchAggregationBtn(function () {
  523. $('div.main').hide();
  524. $('div.photos').hide();
  525. $('div#imgwrap').hide();
  526. }, function () {
  527. $('div.main').show();
  528. $('div.photos').show();
  529. $('div#imgwrap').show();
  530. }).injectAggregationRef(function (injectComponent, pageUrls) {
  531. var currentPathname = window.location.pathname;
  532. var match = currentPathname.match(/\/(.+?\/)(\d+)(?:_\d+)?\.html/m);//http://www.aitaotu.com/weimei/36129.html
  533. if (match !== null) {
  534. {
  535. var totalPageCnt = 1;
  536. var partPreUrl = match[1];
  537. var pageId = '/'+match[2]+'_';
  538. var suffixUrl = '.html';
  539. var limitPageStr = $('div.cgdijkn a ').html();
  540. debugger
  541. var limitPageMatch = limitPageStr.match(/共(\d+)页/im);
  542. if (limitPageMatch != null) {
  543. var totalPics = parseInt(limitPageMatch[1]);
  544. var number = totalPics % 3;
  545. totalPageCnt = Math.floor(totalPics / 1);
  546. if (number > 0) {
  547. totalPageCnt = totalPageCnt + 1;
  548. }
  549. log('totalPageCnt', totalPageCnt);
  550. }
  551. var pageUrl = partPreUrl +'/'+match[2] + suffixUrl;
  552. pageUrls.push(pageUrl);
  553. for (var i = 2; i <= totalPageCnt; i++) {
  554. var pageUrl = partPreUrl + pageId + i + suffixUrl;
  555. log('push pageUrl:', pageUrl);
  556. pageUrls.push(pageUrl);
  557. }
  558. }
  559. $('div.nav').after(injectComponent);
  560. }
  561. }).collectPics(function (doc) {
  562. return $(doc).find('div.stmyzbx img');
  563. }, function (imgE) {
  564. imgE.style = "width: 70%;height: 70%";
  565. }).start();
  566.  
  567.  
  568. ///////////////////////////////////////////umei.fun////////////////////////////////////////////////////
  569. injectBtns().domain(['umei.fun']).removeAD(function () {
  570. $("div[id^='gn_delivery']").remove();
  571. $("a[id^='__qdd_ciw_a__']").remove();
  572. $('iframe').remove();//移除广告等无必要元素
  573. }).switchAggregationBtn(function () {
  574. $('#display_image_detail').hide();
  575. $('#paginator').hide();
  576. }, function () {
  577. $('#display_image_detail').show();
  578. $('#paginator').show();
  579. }).injectAggregationRef(function (injectComponent, pageUrls) {
  580. var match = window.location.pathname.match(/(\/\d+)/im); ///image/cos-cos-1/page/2/""
  581.  
  582. //var limitPageStr = $('#paginator').html();
  583. //var limitPageMatch = limitPageStr.match(/\/page\/\d+\/\">last/im)[0].match(/\d+/);
  584. //var maxpage=limitPageMatch[0];
  585. if (match !== null) {
  586. {
  587. var partPreUrl = window.location.pathname;
  588. pageUrls.push(partPreUrl);
  589. }
  590. $('h2').after(injectComponent);
  591. }
  592. }).collectPics(function (doc) {
  593. return $(doc).find('div.card img');//class . id#
  594. }, function (imgE) {
  595. imgE.style = "width: 100%;height: 100%";
  596. }).start();
  597.  
  598. ///////////////////////////////////////////cosplay////////////////////////////////////////////////////
  599. injectBtns().domain(['hentai-cosplay.com', 'porn-image-xxx.com']).removeAD(function () {
  600. $("div[id^='gn_delivery']").remove();
  601. $("a[id^='__qdd_ciw_a__']").remove();
  602. $('iframe').remove();//移除广告等无必要元素
  603. }).switchAggregationBtn(function () {
  604. $('#display_image_detail').hide();
  605. $('#paginator').hide();
  606. }, function () {
  607. $('#display_image_detail').show();
  608. $('#paginator').show();
  609. }).injectAggregationRef(function (injectComponent, pageUrls) {
  610. var match = window.location.pathname.match(/(\/page\/\d+\/)$/im); ///image/cos-cos-1/page/2/""
  611.  
  612. var limitPageStr = $('#paginator').html();
  613. var limitPageMatch = limitPageStr.match(/\/page\/\d+\/\">last/im)[0].match(/\d+/);
  614. var maxpage=limitPageMatch[0];
  615. debugger
  616. if (limitPageMatch !== null) {
  617. {
  618. var totalPageCnt = maxpage;
  619. var partPreUrl = window.location.pathname;
  620. var suffixUrl = 'page/';
  621.  
  622. for (var i = 1; i <= totalPageCnt; i++) {
  623. var pageUrl = partPreUrl + suffixUrl+i+'/';
  624. log('push pageUrl:', pageUrl);
  625. pageUrls.push(pageUrl);
  626. }
  627. }
  628. $('#title').after(injectComponent);
  629. }
  630. }).collectPics(function (doc) {
  631. return $(doc).find('div#display_image_detail div a img');
  632. }, function (imgE) {
  633. imgE.style = "width: 100%;height: 100%";
  634. }).start();
  635.  
  636. ////////////////////////////////////////////////////////////////////////////////////////////////
  637. injectBtns().domain(['www.lsmpx.com', 'www.lsm.me']).switchAggregationBtn(function () {
  638. $('#thread-pic').hide();
  639. $('#thread-page').hide();
  640. }, function () {
  641. $('#thread-pic').show();
  642. $('#thread-page').show();
  643. }).injectAggregationRef(function (injectComponent, pageUrls) {
  644. var match = window.location.pathname.match(/^\/(thread-\d+-)(\d+)(-\d+\.html)$/im);
  645. debugger
  646. if (match !== null) {
  647. {
  648. var totalPageCnt = 5;
  649. var partPreUrl = match[1];
  650. var suffixUrl = match[3];
  651.  
  652. for (var i = 1; i <= totalPageCnt; i++) {
  653. var pageUrl = partPreUrl + i + suffixUrl;
  654. log('push pageUrl:', pageUrl);
  655. pageUrls.push(pageUrl);
  656. }
  657. }
  658. $('.thread-tr').after(injectComponent);
  659. }
  660. }).collectPics(function (doc) {
  661. return $(doc).find('ul > li > img');
  662. }, function (imgE) {
  663. imgE.style = "width: 100%;height: 100%";
  664. }).start();
  665.  
  666. injectBtns().domain('www.umei.cc').switchAggregationBtn(function () {
  667. $('.ImageBody').hide();
  668. }, function () {
  669. $('.ImageBody').show();
  670. }).injectAggregationRef(function (injectComponent, pageUrls) {
  671. var currentPathname = window.location.pathname;
  672. var match = currentPathname.match(/^\/(\w+\/\w+(?:\/\w+)?\/)(\d+)(?:_\d+)?\.htm$/im);
  673. if (match !== null) {
  674. {
  675. var totalPageCnt = 1;
  676. var partPreUrl = match[1];
  677. var pageId = match[2];
  678. var suffixUrl = '.htm';
  679. var limitPageStr = $('.NewPages li a').html();
  680. var limitPageMatch = limitPageStr.match(/共(\d+)页/m);
  681. if (limitPageMatch != null) {
  682. totalPageCnt = parseInt(limitPageMatch[1]);
  683. log('totalPageCnt', totalPageCnt);
  684. }
  685. for (var i = 1; i <= totalPageCnt; i++) {
  686. var pageUrl = '';
  687. if (i == 1) {
  688. pageUrl = partPreUrl + pageId + suffixUrl;
  689. } else {
  690. pageUrl = partPreUrl + pageId + '_' + i + suffixUrl;
  691. }
  692. log('push pageUrl:', pageUrl);
  693. pageUrls.push(pageUrl);
  694. }
  695. }
  696. $($('.hr10')[0]).after(injectComponent);
  697. }
  698. }).collectPics(function (doc) {
  699. return $(doc).find('.ImageBody p img');
  700. }, function (imgE) {
  701. imgE.style = "width: 100%;height: 100%";
  702. }).start();
  703.  
  704. injectBtns().domain('www.meitulu.com').removeAD(function () {
  705. $("a[id^='__tg_ciw_a__']").remove();
  706. $("a[id^='__qdd_ciw_a__']").remove();
  707. $('iframe').remove();//移除广告等无必要元素
  708. }).switchAggregationBtn(function () {
  709. $('div.content').hide();
  710. $('body > center').hide();
  711. }, function () {
  712. $('div.content').show();
  713. $('body > center').show();
  714. }).injectAggregationRef(function (injectComponent, pageUrls) {
  715. var currentPathname = window.location.pathname;
  716. var match = currentPathname.match(/^\/(item\/)(\d+)(?:_\d+)?\.html$/im);
  717. if (match !== null) {
  718. {
  719. var totalPageCnt = 1;
  720. var partPreUrl = match[1];
  721. var pageId = match[2];
  722. var suffixUrl = '.html';
  723. var limitPageStr = $('a.a1:last').prev().html();
  724. totalPageCnt = parseInt(limitPageStr);
  725. log('totalPageCnt', totalPageCnt);
  726. for (var i = 1; i <= totalPageCnt; i++) {
  727. var pageUrl = '';
  728. if (i == 1) {
  729. pageUrl = partPreUrl + pageId + suffixUrl;
  730. } else {
  731. pageUrl = partPreUrl + pageId + '_' + i + suffixUrl;
  732. }
  733. log('push pageUrl:', pageUrl);
  734. pageUrls.push(pageUrl);
  735. }
  736. }
  737. $('div.bk3').after(injectComponent);
  738. }
  739. }).collectPics(function (doc) {
  740. return $(doc).find('div.content > center > img');
  741. }, function (imgE) {
  742. imgE.style = "width: 100%;height: 100%";
  743. }).start();
  744.  
  745. injectBtns().domain('www.17786.com').switchAggregationBtn(function () {
  746. $('div.img_box').hide();
  747. $('div.wt-pagelist').hide();
  748. $('div#picBody').hide();
  749. $('.articleV2Page').hide();
  750. }, function () {
  751. $('div.img_box').show();
  752. $('div.wt-pagelist').show();
  753. $('div#picBody').show();
  754. $('.articleV2Page').show();
  755. }).injectAggregationRef(function (injectComponent, pageUrls) {
  756. var currentPathname = window.location.pathname;
  757. var match = currentPathname.match(/^\/(\d+)(?:_\d+)?\.html$/im); //http://www.17786.com/7745_1.html
  758. if (match !== null) {
  759. {
  760. var totalPageCnt = 1;
  761. var partPreUrl = '';
  762. var pageId = match[1];
  763. var suffixUrl = '.html';
  764. var limitPageStr = $('h2').html();
  765. var limitPageMatch = limitPageStr.match(/\(\d+\/(\d+)\)/im);
  766. if (limitPageMatch != null) {
  767. totalPageCnt = parseInt(limitPageMatch[1]);
  768. log('totalPageCnt', totalPageCnt);
  769. }
  770. for (var i = 1; i <= totalPageCnt; i++) {
  771. var pageUrl = partPreUrl + pageId + '_' + i + suffixUrl;
  772. log('push pageUrl:', pageUrl);
  773. pageUrls.push(pageUrl);
  774. }
  775. }
  776. $('div.tsmaincont-desc').after(injectComponent);
  777. } else {
  778. var match = currentPathname.match(/^\/((?:\w+\/)+)(\d+)(?:_\d+)?\.html$/im);//http://www.17786.com/beautiful/feizhuliutupian/44569.html
  779. if (match != null) {
  780. {
  781. var totalPageCnt = 50;
  782. var partPreUrl = match[1];
  783. var pageId = match[2];
  784. var suffixUrl = '.html';
  785. log('totalPageCnt', totalPageCnt);
  786. for (var i = 1; i <= totalPageCnt; i++) {
  787. var pageUrl = '';
  788. if (i == 1) {
  789. pageUrl = partPreUrl + pageId + suffixUrl;
  790. } else {
  791. pageUrl = partPreUrl + pageId + '_' + i + suffixUrl;
  792. }
  793. log('push pageUrl:', pageUrl);
  794. pageUrls.push(pageUrl);
  795. }
  796. }
  797.  
  798. $('div.articleV2Desc').after(injectComponent);
  799. }
  800. }
  801. }).collectPics(function (doc) {
  802. var imgObj = $(doc).find('img.IMG_show');
  803. if (imgObj.length == 0) {
  804. imgObj = $(doc).find('a#RightUrl img');
  805. }
  806. return imgObj;
  807. }, function (imgE) {
  808. imgE.style = "width: 100%;height: 100%";
  809. }).start();
  810.  
  811.  
  812. injectBtns().domain('www.nvshens.com').removeAD(function () {
  813. $('div[id^=mms]').remove();//移除广告等无必要元素
  814. }).switchAggregationBtn(function () {
  815. $('div.ck-box-unit').hide();
  816. $('div.photos').hide();
  817. $('div#imgwrap').hide();
  818. }, function () {
  819. $('div.ck-box-unit').show();
  820. $('div.photos').show();
  821. $('div#imgwrap').show();
  822. }).injectAggregationRef(function (injectComponent, pageUrls) {
  823. var currentPathname = window.location.pathname;
  824. var match = currentPathname.match(/\/(\d+).?\/(\d+).?\.html)?$/im);//20170507/282.html
  825. if (match !== null) {
  826. {
  827. var totalPageCnt = 1;
  828. var partPreUrl = match[1];
  829. var pageId = '/';
  830. var suffixUrl = '.html';
  831. var limitPageStr = $('div#dinfo span[style="color: #DB0909"]').html();
  832. var limitPageMatch = limitPageStr.match(/(\d+)张照片/im);
  833. if (limitPageMatch != null) {
  834. var totalPics = parseInt(limitPageMatch[1]);
  835. var number = totalPics % 3;
  836. totalPageCnt = Math.floor(totalPics / 3);
  837. if (number > 0) {
  838. totalPageCnt = totalPageCnt + 1;
  839. }
  840. log('totalPageCnt', totalPageCnt);
  841. }
  842. for (var i = 1; i <= totalPageCnt; i++) {
  843. var pageUrl = partPreUrl + pageId + i + suffixUrl;
  844. log('push pageUrl:', pageUrl);
  845. pageUrls.push(pageUrl);
  846. }
  847. }
  848. $('div#dinfo').after(injectComponent);
  849. }
  850. }).collectPics(function (doc) {
  851. return $(doc).find('ul#hgallery img');
  852. }, function (imgE) {
  853. imgE.style = "width: 100%;height: 100%";
  854. }).start();
  855.  
  856. injectBtns().domain('www.aitaotu.com').removeAD(function () {
  857. setInterval(function () {
  858. $('#lgVshow').remove();
  859. $('div.gg1002').remove();
  860. }, 100);
  861. }).switchAggregationBtn(function () {
  862. $('div.big-pic').hide();
  863. $('div.pages').hide();
  864. }, function () {
  865. $('div.big-pic').show();
  866. $('div.pages').show();
  867. }).injectAggregationRef(function (injectComponent, pageUrls) {
  868. var currentPathname = window.location.pathname;
  869. var match = currentPathname.match(/\/(.+?\/)(\d+)(?:_\d+)?\.html/m);//http://www.aitaotu.com/weimei/36129.html
  870. if (match !== null) {
  871. {
  872. var totalPageCnt = 1;
  873. var partPreUrl = match[1];
  874. var pageId = match[2];
  875. var suffixUrl = '.html';
  876. var limitPageStr = $('div.photo > div.pages > ul > li:last-child > a').attr('href');
  877. var limitPageMatch = limitPageStr.match(/\/\w+\/(\d+)(?:_(\d+))?\.html/m);
  878. if (limitPageMatch != null) {
  879. totalPageCnt = parseInt(limitPageMatch[2]);
  880. log('totalPageCnt', totalPageCnt);
  881. }
  882. for (var i = 1; i <= totalPageCnt; i++) {
  883. var pageUrl = partPreUrl + pageId + '_' + i + suffixUrl;
  884. log('push pageUrl:', pageUrl);
  885. pageUrls.push(pageUrl);
  886. }
  887. }
  888. $('div.tsmaincont-desc').after(injectComponent);
  889. }
  890. }).collectPics(function (doc) {
  891. return $(doc).find('#big-pic > p > a > img');
  892. }, function (imgE) {
  893. imgE.style = "width: 100%;height: 100%";
  894. }).start();
  895.  
  896.  
  897. injectBtns().domain('www.mzitu.com').removeAD(function () {
  898.  
  899. }).switchAggregationBtn(function () {
  900. $('div.main-image').hide();
  901. $('div.pagenavi').hide();
  902. }, function () {
  903. $('div.main-image').show();
  904. $('div.pagenavi').show();
  905. }).injectAggregationRef(function (injectComponent, pageUrls) {
  906. var currentPathname = window.location.pathname;
  907. var match = currentPathname.match(/\/(\d+)(?:\/\d+)?/m);//http://www.mzitu.com/139218
  908. if (match !== null) {
  909. {
  910. var totalPageCnt = 1;
  911. var partPreUrl = '';
  912. var pageId = match[1];
  913. var suffixUrl = '';
  914. var limitPageStr = $('div.pagenavi >a').last().prev().find('span').text().trim();
  915. if (limitPageStr) {
  916. totalPageCnt = parseInt(limitPageStr);
  917. log('totalPageCnt', totalPageCnt);
  918. }
  919. for (var i = 1; i <= totalPageCnt; i++) {
  920. var pageUrl = partPreUrl + pageId + '/' + i + suffixUrl;
  921. log('push pageUrl:', pageUrl);
  922. pageUrls.push(pageUrl);
  923. }
  924. }
  925. $('div.main-meta').after(injectComponent);
  926. }
  927. }).collectPics(function (doc) {
  928. return $(doc).find('div.main-image > p > a > img');
  929. }, function (imgE) {
  930. imgE.style = "width: 100%;height: 100%";
  931. }).start();
  932.  
  933. injectBtns().domain('www.beautylegmm.com').removeAD(function () {
  934. setInterval(function () {
  935. $('iframe').remove();
  936. }, 100);
  937. }).switchAggregationBtn(function () {
  938. $('div.post').hide();
  939. $('div.archives_page_bar').hide();
  940. }, function () {
  941. $('div.post').show();
  942. $('div.archives_page_bar').show();
  943. }).injectAggregationRef(function (injectComponent, pageUrls) {
  944. var currentPathname = window.location.pathname;
  945. var match = currentPathname.match(/^\/(\w+\/beautyleg-\d+\.html)/im);//http://www.beautylegmm.com/Vanessa/beautyleg-1619.html
  946. if (match !== null) {
  947. {
  948. var totalPageCnt = 1;
  949. var partPreUrl = '';
  950. var pageId = match[1];
  951. var suffixUrl = '';
  952. var limitPageStr = $('#contents_post > div.post > div > a:not(.next)').last().text().trim();
  953. if (limitPageStr) {
  954. totalPageCnt = parseInt(limitPageStr);
  955. log('totalPageCnt', totalPageCnt);
  956. }
  957. for (var i = 1; i <= totalPageCnt; i++) {
  958. var pageUrl = partPreUrl + pageId + '?page=' + i + suffixUrl;
  959. log('push pageUrl:', pageUrl);
  960. pageUrls.push(pageUrl);
  961. }
  962. }
  963. $('div.post_title').after(injectComponent);
  964. }
  965. }).collectPics(function (doc) {
  966. return $(doc).find('#contents_post > div.post > a > img');
  967. }, function (imgE) {
  968. imgE.style = "width: 100%;height: 100%";
  969. }).start();
  970.  
  971. injectBtns().domain(['www.xgtaotu.com', 'www.xgtutu.com']).removeAD(function () {
  972. $('#divStayTopright').remove();
  973. }).switchAggregationBtn(function () {
  974. $('div.page').hide();
  975. }, function () {
  976. $('div.page').show();
  977. }).injectAggregationRef(function (injectComponent, pageUrls) {
  978. var currentPathname = window.location.pathname;
  979. var match = currentPathname.match(/^\/(rentihtml\/zhaopian\/\d+\/\d+)/im);//http://www.xgtutu.com/rentihtml/zhaopian/20200314/82031.html
  980. if (match !== null) {
  981. {
  982. var totalPageCnt = 1;
  983. var partPreUrl = '';
  984. var pageId = match[1];
  985. var suffixUrl = '.html';
  986. var limitPageStr = $('p b a').eq(-2).text().replace(/[\]\[]/img, "").trim();
  987. if (limitPageStr) {
  988. totalPageCnt = parseInt(limitPageStr);
  989. log('totalPageCnt', totalPageCnt);
  990. }
  991. for (var i = 1; i <= totalPageCnt; i++) {
  992. var pageUrl = '';
  993. if (i == 1) {
  994. pageUrl = partPreUrl + pageId + suffixUrl;
  995. } else {
  996. pageUrl = partPreUrl + pageId + '_' + i + suffixUrl;
  997. }
  998.  
  999. log('push pageUrl:', pageUrl);
  1000. pageUrls.push(pageUrl);
  1001. }
  1002. }
  1003. $('div h1').after(injectComponent);
  1004. }
  1005. }).collectPics(function (doc) {
  1006. return $(doc).find('p a > img');
  1007. }, function (imgE) {
  1008. imgE.style = "max-width: 100%;";
  1009. }).start();
  1010.  
  1011. injectBtns().domain('www.youzi4.cc').removeAD(function () {
  1012.  
  1013. }).switchAggregationBtn(function () {
  1014. $('#picBody').hide();
  1015. $('div.page-tag').hide();
  1016. }, function () {
  1017. $('#picBody').show();
  1018. $('div.page-tag').show();
  1019. }).injectAggregationRef(function (injectComponent, pageUrls) {
  1020. var currentPathname = window.location.pathname;
  1021. var match = currentPathname.match(/^\/(\w+.*\/\d+)/im);//http://www.youzi4.cc/mm/19890/19890_1.html
  1022. if (match !== null) {
  1023. {
  1024. var totalPageCnt = 1;
  1025. var partPreUrl = '';
  1026. var pageId = match[1];
  1027. var suffixUrl = '.html';
  1028. var limitPageStr = $('div.page-tag> ul > div > div > a ').eq(-2).text().trim();
  1029. if (limitPageStr) {
  1030. totalPageCnt = parseInt(limitPageStr);
  1031. log('totalPageCnt', totalPageCnt);
  1032. }
  1033. for (var i = 1; i <= totalPageCnt; i++) {
  1034. var pageUrl = '';
  1035. if (i == 1) {
  1036. pageUrl = partPreUrl + pageId + suffixUrl;
  1037. } else {
  1038. pageUrl = partPreUrl + pageId + '_' + i + suffixUrl;
  1039. }
  1040.  
  1041. log('push pageUrl:', pageUrl);
  1042. pageUrls.push(pageUrl);
  1043. }
  1044. }
  1045. $('div.articleV4Desc').after(injectComponent);
  1046. }
  1047. }).collectPics(function (doc) {
  1048. return $(doc).find('#picBody p a img');
  1049. }, function (imgE) {
  1050. imgE.style = "max-width: 100%;";
  1051. }).start();
  1052.  
  1053. injectBtns().domain(['www.xiumeim.com', 'www.xmeim.com']).removeAD(function () {
  1054.  
  1055. }).switchAggregationBtn(function () {
  1056. $('div.gallary_wrap').hide();
  1057. }, function () {
  1058. $('div.gallary_wrap').show();
  1059. }).injectAggregationRef(function (injectComponent, pageUrls) {
  1060. var currentPathname = window.location.pathname;
  1061. var match = currentPathname.match(/^\/(photos\/\w+-\d+)/im);//http://www.xiumeim.com/photos/LUGirls-190942.html
  1062. if (match !== null) {
  1063. {
  1064. var totalPageCnt = 1;
  1065. var partPreUrl = '';
  1066. var pageId = match[1];
  1067. var suffixUrl = '.html';
  1068. var limitPageStr = $('div.paginator > span.count').text().trim();
  1069. var limitPageMatch = limitPageStr.match(/\(共(\d+)页\)/m);
  1070. if (limitPageMatch != null) {
  1071. totalPageCnt = parseInt(limitPageMatch[1]);
  1072. log('totalPageCnt', totalPageCnt);
  1073. }
  1074. for (var i = 1; i <= totalPageCnt; i++) {
  1075. var pageUrl = '';
  1076. if (i == 1) {
  1077. pageUrl = partPreUrl + pageId + suffixUrl;
  1078. } else {
  1079. pageUrl = partPreUrl + pageId + '-' + i + suffixUrl;
  1080. }
  1081.  
  1082. log('push pageUrl:', pageUrl);
  1083. pageUrls.push(pageUrl);
  1084. }
  1085. }
  1086. $('div.album_desc div.inline').after(injectComponent);
  1087. }
  1088. }).collectPics(function (doc) {
  1089. return $(doc).find('table > tbody > tr > td > img');
  1090. }, function (imgE) {
  1091. imgE.style = "max-width: 100%;";
  1092. }).start();
  1093.  
  1094. injectBtns().domain('www.mm131.com').switchAggregationBtn(function () {
  1095. $('.content-pic').hide();
  1096. $('.content-page').hide();
  1097. }, function () {
  1098. $('.content-pic').show();
  1099. $('.content-page').show();
  1100. }).injectAggregationRef(function (injectComponent, pageUrls) {
  1101. var currentPathname = window.location.pathname;
  1102. var match = currentPathname.match(/^\/(\w+\/)(\d+)(?:_\d+)?\.html$/im);
  1103. if (match !== null) {
  1104. {
  1105. var totalPageCnt = 1;
  1106. var partPreUrl = match[1];
  1107. var pageId = match[2];
  1108. var suffixUrl = '.html';
  1109. var limitPageStr = $('span.page-ch:nth-child(1)').text();
  1110. var limitPageMatch = limitPageStr.match(/共(\d+)页/m);
  1111. if (limitPageMatch != null) {
  1112. totalPageCnt = parseInt(limitPageMatch[1]);
  1113. log('totalPageCnt', totalPageCnt);
  1114. }
  1115. for (var i = 1; i <= totalPageCnt; i++) {
  1116. var pageUrl = '';
  1117. if (i == 1) {
  1118. pageUrl = partPreUrl + pageId + suffixUrl;
  1119. } else {
  1120. pageUrl = partPreUrl + pageId + '_' + i + suffixUrl;
  1121. }
  1122. log('push pageUrl:', pageUrl);
  1123. pageUrls.push(pageUrl);
  1124. }
  1125. }
  1126. $('div.content-msg').after(injectComponent);
  1127. }
  1128. }).collectPics(function (doc) {
  1129. return $(doc).find('div.content-pic a img');
  1130. }, function (imgE) {
  1131. imgE.style = "width: 100%;height: 100%";
  1132. }).start();
  1133.  
  1134.  
  1135. injectBtns().domain('www.win4000.com').removeAD(function () {
  1136. setInterval(function () {
  1137. $('iframe').remove();
  1138. }, 100);
  1139. }).switchAggregationBtn(function () {
  1140. $('div.pic-meinv').hide();
  1141. }, function () {
  1142. $('div.pic-meinv').show();
  1143. }).injectAggregationRef(function (injectComponent, pageUrls) {
  1144. var currentPathname = window.location.pathname;
  1145. var match = currentPathname.match(/\/(\w+?\d+)(?:_\d+)?/m);
  1146. if (match !== null) {
  1147. {
  1148. var totalPageCnt = 1;
  1149. var partPreUrl = match[1];
  1150. var pageId = '';
  1151. var suffixUrl = '.html';
  1152. var limitPageStr = $('div.ptitle').text();
  1153. var limitPageMatch = limitPageStr.match(/(\d+\/(\d+))/m);
  1154. if (limitPageMatch != null) {
  1155. totalPageCnt = parseInt(limitPageMatch[1]);
  1156. log('totalPageCnt', totalPageCnt);
  1157. }
  1158. for (var i = 1; i <= totalPageCnt; i++) {
  1159. var pageUrl = partPreUrl + pageId + '_' + i + suffixUrl;
  1160. log('push pageUrl:', pageUrl);
  1161. pageUrls.push(pageUrl);
  1162. }
  1163. }
  1164. $('div.ptitle').after(injectComponent);
  1165. }
  1166. }).collectPics(function (doc) {
  1167. return $(doc).find('div.pic-meinv a img');
  1168. }, function (imgE) {
  1169. imgE.style = "width: 100%;height: 100%";
  1170. var src = $(imgE).attr('url');
  1171. if (src) {
  1172. $(imgE).attr('src', src);
  1173. }
  1174. }).start();
  1175.  
  1176. injectBtns().domain('www.114tuku.com').removeAD(function () {
  1177. setInterval(function () {
  1178. $('iframe').remove();
  1179. $('div[baidu_imageplus_sensitive_judge="true"]').remove();
  1180. }, 100);
  1181. }).switchAggregationBtn(function () {
  1182. $('#picBody').hide();
  1183. $('#pages').hide();
  1184. }, function () {
  1185. $('#picBody').show();
  1186. $('#pages').show();
  1187. }).injectAggregationRef(function (injectComponent, pageUrls) {
  1188. var currentPathname = window.location.pathname;
  1189. var match = currentPathname.match(/\/(\w+?p)\d+\//m);
  1190. if (match !== null) {
  1191. if ($('div.content_body a img').length > 0) {
  1192. {
  1193. var totalPageCnt = 1;
  1194. var partPreUrl = match[1];
  1195. var pageId = '';
  1196. var suffixUrl = '/';
  1197. var limitPageStr = $('#pages > a:last-child').prev().text();
  1198. if (limitPageStr) {
  1199. totalPageCnt = parseInt(limitPageStr);
  1200. log('totalPageCnt', totalPageCnt);
  1201. }
  1202. for (var i = 1; i <= totalPageCnt; i++) {
  1203. var pageUrl = partPreUrl + pageId + i + suffixUrl;
  1204. log('push pageUrl:', pageUrl);
  1205. pageUrls.push(pageUrl);
  1206. }
  1207. }
  1208. $('div.tags').after(injectComponent);
  1209. }
  1210. }
  1211. }).collectPics(function (doc) {
  1212. return $(doc).find('div.content_body a img');
  1213. }, function (imgE) {
  1214. imgE.style = "width: 100%;";
  1215. }).start();
  1216.  
  1217. injectBtns().domain(['www.192tt.com', 'www.192tb.com']).removeAD(function () {
  1218. setInterval(function () {
  1219. $('iframe').remove();
  1220. $('div[class^=ad]').remove();
  1221. }, 100);
  1222. }).switchAggregationBtn(function () {
  1223. $('#p').hide();
  1224. }, function () {
  1225. $('#p').show();
  1226. }).injectAggregationRef(function (injectComponent, pageUrls) {
  1227. var currentPathname = window.location.pathname;
  1228. var match = currentPathname.match(/\/(\w+(?:\/\w+)?\/\w+?)(?:_\d+)?\.html/m);//https://www.192tt.com/gq/ugirls/ugu349_2.html,https://www.192tt.com/meitu/81896.html
  1229. if (match !== null) {
  1230. {
  1231. var totalPageCnt = 1;
  1232. var partPreUrl = match[1];
  1233. var pageId = '';
  1234. var suffixUrl = '.html';
  1235. var limitPageStr = $('h1').text();
  1236. var limitPageMatch = limitPageStr.match(/\(\d+\/(\d+)\)/m);
  1237. if (limitPageMatch != null) {
  1238. totalPageCnt = parseInt(limitPageMatch[1]);
  1239. log('totalPageCnt', totalPageCnt);
  1240. }
  1241. for (var i = 1; i <= totalPageCnt; i++) {
  1242. var pageUrl = '';
  1243. if (i == 1) {
  1244. pageUrl = partPreUrl + pageId + suffixUrl;
  1245. } else {
  1246. pageUrl = partPreUrl + pageId + '_' + i + suffixUrl;
  1247. }
  1248. log('push pageUrl:', pageUrl);
  1249. pageUrls.push(pageUrl);
  1250. }
  1251. }
  1252. $('div.pictopline').after(injectComponent);
  1253. }
  1254. }).collectPics(function (doc) {
  1255. return $(doc).find('#p > center img');
  1256. }, function (imgE) {
  1257. imgE.style = "width: 100%;";
  1258. var src = $(imgE).attr('lazysrc');
  1259. if (src) {
  1260. $(imgE).removeAttr('lazysrc');
  1261. $(imgE).attr('src', src);
  1262. }
  1263. }).start();
  1264.  
  1265. injectBtns().domain('www.meituri.com').removeAD(function () {
  1266. setInterval(function () {
  1267. $('iframe').remove();
  1268. $('div.weixin').remove();
  1269. $('div[id^=__jclm_]').remove();
  1270. $('center>a').parent().remove();
  1271. }, 200);
  1272. }).switchAggregationBtn(function () {
  1273. $('#pages').hide();
  1274. $('body > div.content').hide();
  1275. }, function () {
  1276. $('#pages').show();
  1277. $('body > div.content').show();
  1278. }).injectAggregationRef(function (injectComponent, pageUrls) {
  1279. var currentPathname = window.location.pathname;
  1280. var match = currentPathname.match(/^\/(a\/\d+\/)(\d+\.html)?/im);
  1281. if (match !== null) {
  1282. {
  1283. var totalPageCnt = 1;
  1284. var partPreUrl = match[1];
  1285. var pageId = '';
  1286. var suffixUrl = '';
  1287. var limitPageStr = '';
  1288. var text = $('#pages > a').last().text();
  1289. if ('下一页' == text) {
  1290. limitPageStr = $('#pages > a').last().prev().text();
  1291. }
  1292. if (limitPageStr != '') {
  1293. totalPageCnt = parseInt(limitPageStr);
  1294. log('totalPageCnt', totalPageCnt);
  1295. }
  1296. for (var i = 1; i <= totalPageCnt; i++) {
  1297. var pageUrl = '';
  1298. if (i == 1) {
  1299. pageUrl = partPreUrl;
  1300. } else {
  1301. pageUrl = partPreUrl + pageId + suffixUrl + i + '.html';
  1302. }
  1303. log('push pageUrl:', pageUrl);
  1304. pageUrls.push(pageUrl);
  1305. }
  1306.  
  1307.  
  1308. }
  1309. $('div.tuji').append(injectComponent);
  1310. }
  1311. }).collectPics(function (doc) {
  1312. return $(doc).find('div.content > img');
  1313. }).start();
  1314.  
  1315. injectBtns().domain('www.xiuren.org').removeAD(function () {
  1316. setInterval(function () {
  1317. $('iframe').remove();
  1318. }, 100);
  1319. }).switchAggregationBtn(function () {
  1320. $('div.post').hide();
  1321. }, function () {
  1322. $('div.post').show();
  1323. }).injectAggregationRef(function (injectComponent, pageUrls) {
  1324. var currentPathname = window.location.pathname;
  1325. var match = currentPathname.match(/^\/([\w-]+\.html)\b/im);
  1326. if (match !== null) {
  1327. {
  1328. pageUrls.push(window.location.pathname.substr(1));
  1329. }
  1330. $('#title').after(injectComponent);
  1331. }
  1332. }).collectPics(function (doc) {
  1333. var clone = $(doc).find('div.post span > a').clone();
  1334. return $(clone).find('img');
  1335. }, function (imgE) {
  1336. var src = $(imgE).parent().attr('href');
  1337. $(imgE).attr('src', src);
  1338. imgE.style = "width: 100%;height: 100%";
  1339. }).start();
  1340.  
  1341. injectBtns().domain('www.tuao81.top').removeAD(function () {
  1342. setInterval(function () {
  1343. $('iframe').remove();
  1344. $('#v_ads > img').parent().parent().remove();
  1345. }, 100);
  1346. }).switchAggregationBtn(function () {
  1347. $('div.entry').hide();
  1348. }, function () {
  1349. $('div.entry').show();
  1350. }).injectAggregationRef(function (injectComponent, pageUrls) {
  1351. var currentPathname = window.location.pathname;
  1352. var match = currentPathname.match(/\/(post\/\d+.html)\b/i);
  1353. if (match !== null) {
  1354. {
  1355. var totalPageCnt = 1;
  1356. var partPreUrl = match[1];
  1357. var pageId = '';
  1358. var suffixUrl = '';
  1359. var limitPageStr = '';
  1360. var text = $('#dm-fy li').last().text();
  1361. if ('下一頁' == text) {
  1362. limitPageStr = $('#dm-fy li').last().prev().text();
  1363. }
  1364. if (limitPageStr != '') {
  1365. totalPageCnt = parseInt(limitPageStr);
  1366. log('totalPageCnt', totalPageCnt);
  1367. }
  1368. for (var i = 1; i <= totalPageCnt; i++) {
  1369. var pageUrl = partPreUrl + pageId + suffixUrl + '?page=' + i;
  1370. log('push pageUrl:', pageUrl);
  1371. pageUrls.push(pageUrl);
  1372. }
  1373. }
  1374. $('div.postmeta').after(injectComponent);
  1375. }
  1376. }).collectPics(function (doc) {
  1377. return $(doc).find('div.entry > p > a > img');
  1378. }).start();
  1379.  
  1380. injectBtns().domain(['rosim.cc', 'www.rosim.cc']).removeAD(function () {
  1381. setInterval(function () {
  1382. $('iframe').remove();
  1383. }, 100);
  1384. }).switchAggregationBtn(function () {
  1385. $('div.container>h4').parent().find('div.col-xs-12:eq(2)').hide();
  1386. }, function () {
  1387. $('div.container>h4').parent().find('div.col-xs-12:eq(2)').show();
  1388. }).injectAggregationRef(function (injectComponent, pageUrls) {
  1389. var currentPathname = window.location.pathname;
  1390. var match = currentPathname.match(/^\/(item-detail-\d+)(?:-\d+)?.html/im);
  1391. if (match !== null) {
  1392. {
  1393. var totalPageCnt = 1;
  1394. var partPreUrl = match[1];
  1395. var pageId = '';
  1396. var suffixUrl = '';
  1397. var limitPageStr = $('ul.pagination > li').last().find('a').attr('name');
  1398. if (limitPageStr != '') {
  1399. totalPageCnt = parseInt(limitPageStr);
  1400. log('totalPageCnt', totalPageCnt);
  1401. }
  1402. for (var i = 1; i <= totalPageCnt; i++) {
  1403. var pageUrl = partPreUrl + pageId + suffixUrl + '-' + i + '.html';
  1404. log('push pageUrl:', pageUrl);
  1405. pageUrls.push(pageUrl);
  1406. }
  1407. }
  1408. $('div.container>h4').next().after(injectComponent);
  1409. }
  1410. }).collectPics(function (doc) {
  1411. return $(doc).find('div.col-xs-12> img.img-responsive ');
  1412. }).start();
  1413.  
  1414. if (false && 'www.youtube.com' === window.location.hostname) {
  1415. var vId = "";
  1416. var id = setInterval(function () {
  1417. $('#player-unavailable').not('.hid').addClass('hid');
  1418. var curVId = Alpha_Script.getParam(dest, 'v');
  1419. if (curVId != null && vId != curVId) {
  1420. log('切换VID');
  1421. vId = curVId;
  1422. var sid = setInterval(function () {
  1423. var swichVIdState = switchVId(vId);
  1424. if (swichVIdState) {
  1425. clearInterval(sid);
  1426. }
  1427. }, 100);
  1428. }
  1429. }, 100);
  1430. }
  1431. })();
  1432.  
  1433. function switchVId(vId) {
  1434. $('#player-unavailable').not('.hid').addClass('hid');
  1435. var text = $('#unavailable-message').text();
  1436. if (text && text.indexOf('内容警告') != -1) {
  1437. log('内容警告::');
  1438. $('#player-api').removeClass('off-screen-target').html('<iframe src="https://www.youtube.com/embed/' +
  1439. vId +
  1440. '" width="100%" height="100%" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe>');
  1441. return true;
  1442. }
  1443. return false;
  1444. }
  1445.  
  1446.  
  1447. //注入JS:jquery
  1448. function injectJs(e) {
  1449. if (e.jQuery) {
  1450. log('jquery available');
  1451. } else {
  1452. var ele = e.document.createElement('script');
  1453. ele.src = "https://cdn.staticfile.org/jquery/1.12.4/jquery.min.js";
  1454. e.document.body.appendChild(ele);
  1455. var id = e.setInterval(function () {
  1456. if (e.jQuery) {
  1457. e.clearInterval(id);
  1458. }
  1459. }, 100);
  1460. }
  1461. }
  1462.  
  1463. //等待JQuery加载完毕
  1464. function dependenceJQuery(e, callback) {
  1465. var id = e.setInterval(function () {
  1466. if (e.jQuery) {
  1467. e.clearInterval(id);
  1468. callback;
  1469. }
  1470. }, 100);
  1471. }