|
1 | 1 | // ==UserScript== |
2 | 2 | // @name 自动无缝翻页 |
3 | | -// @version 1.2.3 |
| 3 | +// @version 1.2.4 |
4 | 4 | // @author X.I.U |
5 | | -// @description 自动无缝翻页,目前支持:423Down、Apphot、不死鸟、小众软件、异次元软件、微当下载、豆瓣电影、3DM、游民星空、FitGirl Repacks、AlphaCoders、PubMed、三国杀论坛、百分浏览器论坛 |
| 5 | +// @description 自动无缝翻页,目前支持:423Down、Apphot、不死鸟、小众软件、异次元软件、微当下载、豆瓣电影、3DM、游民星空、千图网、FitGirl Repacks、AlphaCoders、PubMed、三国杀论坛、百分浏览器论坛 |
6 | 6 | // @match *://www.423down.com/* |
7 | 7 | // @exclude *://www.423down.com/*.html |
8 | 8 | // @match *://apphot.cc/* |
|
22 | 22 | // @match *://search.douban.com/* |
23 | 23 | // @match *://www.3dmgame.com/bagua/*.html |
24 | 24 | // @match *://www.gamersky.com/ent/*/*.shtml |
| 25 | +// @match *://www.58pic.com/* |
25 | 26 | // @icon https://i.loli.net/2021/03/07/rdijeYm83pznxWq.png |
26 | 27 | // @grant GM_xmlhttpRequest |
27 | 28 | // @grant GM_registerMenuCommand |
|
288 | 289 | replaceE: 'css;.page_css', |
289 | 290 | scrollDelta: 1000 |
290 | 291 | } |
| 292 | + }, |
| 293 | + _58pic: { |
| 294 | + SiteTypeID: 21, |
| 295 | + pager: { |
| 296 | + type: 1, |
| 297 | + nextLink: '//div[contains(@class,"page-box")]//a[text()="下一页"][@href]', |
| 298 | + pageElement: 'css;.pic-box > .qtw-card', |
| 299 | + HT_insert: ['css;.pic-box', 3], |
| 300 | + replaceE: 'css;.page-box', |
| 301 | + scrollDelta: 2000 |
| 302 | + }, |
| 303 | + function: { |
| 304 | + before: _58pic_beforeFunction |
| 305 | + } |
| 306 | + }, |
| 307 | + _58pic_c: { |
| 308 | + SiteTypeID: 22, |
| 309 | + pager: { |
| 310 | + type: 1, |
| 311 | + nextLink: '//div[contains(@class,"page-box")]//a[text()="下一页"][@href]', |
| 312 | + pageElement: 'css;.list-box > .qtw-card', |
| 313 | + HT_insert: ['css;.list-box', 3], |
| 314 | + replaceE: 'css;.page-box', |
| 315 | + scrollDelta: 4000 |
| 316 | + }, |
| 317 | + function: { |
| 318 | + before: _58pic_beforeFunction |
| 319 | + } |
291 | 320 | } |
292 | 321 | }; |
293 | 322 |
|
|
378 | 407 | curSite = DBSite.gamersky; |
379 | 408 | document.lastElementChild.appendChild(document.createElement('style')).textContent = `.Comment {display: none !important;}` // 隐藏评论区 |
380 | 409 | break; |
| 410 | + case "www.58pic.com": |
| 411 | + if (location.pathname.indexOf("/tupian/") > -1) { |
| 412 | + curSite = DBSite._58pic; |
| 413 | + } else if (location.pathname.indexOf("/c/") > -1) { |
| 414 | + curSite = DBSite._58pic_c; |
| 415 | + } |
| 416 | + break; |
381 | 417 | } |
382 | 418 | curSite.pageUrl = ""; // 下一页URL |
383 | 419 | pageLoading(); // 自动无缝翻页 |
|
463 | 499 | } |
464 | 500 |
|
465 | 501 |
|
| 502 | + // iplaysoft 的插入前函数 |
| 503 | + function _58pic_beforeFunction(pageElems) { |
| 504 | + let is_one = document.querySelector(".qtw-card.place-box.is-one"); |
| 505 | + if (is_one && is_one.style.display != "none") { |
| 506 | + is_one.setAttribute("style", "display: none;") |
| 507 | + } |
| 508 | + pageElems.forEach(function (one) { |
| 509 | + let now = one.querySelector("img.lazy") |
| 510 | + if (now && now.getAttribute('src') === "//icon.qiantucdn.com/static/images/qtw-card/card-place.png") { |
| 511 | + now.setAttribute("src", now.dataset.original) |
| 512 | + now.setAttribute("style", "display: block;") |
| 513 | + } |
| 514 | + }); |
| 515 | + return pageElems |
| 516 | + } |
| 517 | + |
| 518 | + |
466 | 519 | // 滚动条事件 |
467 | 520 | function windowScroll(fn1) { |
468 | 521 | var beforeScrollTop = document.documentElement.scrollTop, |
|
520 | 573 | if (curSite.pager) { |
521 | 574 | let curPageEle = getElementByXpath(curSite.pager.nextLink); |
522 | 575 | var url = this.getFullHref(curPageEle); |
523 | | - console.log(`${url} ${curPageEle} ${curSite.pageUrl}`); |
| 576 | + //console.log(`${url} ${curPageEle} ${curSite.pageUrl}`); |
524 | 577 | if(url === '') return; |
525 | 578 | if(curSite.pageUrl === url) return;// 避免重复加载相同的页面 |
526 | 579 | curSite.pageUrl = url; |
|
532 | 585 | timeout: 5000, |
533 | 586 | onload: function (response) { |
534 | 587 | try { |
535 | | - console.log(`${response.responseText}`) |
| 588 | + //console.log(`${response.responseText}`) |
536 | 589 | var newBody = ShowPager.createDocumentByString(response.responseText); |
537 | 590 | let pageElems = getAllElements(curSite.pager.pageElement, newBody, newBody); |
538 | 591 | let toElement = getAllElements(curSite.pager.HT_insert[0])[0]; |
|
0 commit comments