// ==UserScript== // @name 图集岛破解VIP-威力加强版修改匹配地址--lc自用 // @namespace http://tampermonkey.net/ // @version 2.2.5.2 // @description 破解VIP、一键打包下载和图片自适应 // @author 原作者请搜索fordes123 // @homepageURL https://greasyfork.org/zh-CN/scripts/446150 // @require https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.0.0/jquery.min.js // @require https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/jszip/3.7.1/jszip.min.js // @require https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/FileSaver.js/2.0.5/FileSaver.min.js // @match https://www.sqmuying.com/* // @include https://www.sqmuying.com/* // @match *.sqmuying.com/* // @include *.sqmuying.com/* // @match https://www.sqmuying.com // @include https://www.sqmuying.com // @match *.sqmuying.com // @include *.sqmuying.com // @grant GM_xmlhttpRequest // @license MIT // @downloadURL none // ==/UserScript== (function () { "use strict"; function asyncGet(zip, filename, url) { const defered = $.Deferred(); GM_xmlhttpRequest({ method: "GET", url: url, headers: { referer: window.location.href, }, responseType: "blob", onload: (response) => { zip.file(filename, response.response); defered.resolve("success"); console.log(filename + " download completed~"); }, onerror: () => console.log(filename + "(" + url + ") download failed!") }); return defered; } function download() { let filename; const start = performance.now(); const zip = new JSZip(); const list = document.querySelectorAll("#kbox>img"); console.log("start download... " + list.length + " task"); let arr = []; for (const item of list) { filename = item.getAttribute("filename"); const url = item.getAttribute("data-src"); arr.push(asyncGet(zip, filename, url)); } filename = $("title").text(); $.when.apply(this, arr).then((...args) => { console.log("download completed... " + args.length + " task"); console.log("start generate zip files, timely: ", `${(performance.now() - start) / 1000} s`); zip.generateAsync({ type: "blob", }).then((content) => { saveAs(content, filename + ".zip"); sessionStorage.removeItem(filename); console.log("all completed: ", `${(performance.now() - start) / 1000} s`); }); }); } function tujidaoinit() { let action = document.location.href.split(window.location.host)[1]; try { layui.use('layer', () => layer = layui.layer); } catch (e) { } switch (action) { case "/": if (localStorage.getItem("data") != null) { let data = JSON.parse(localStorage.getItem("data")); localStorage.removeItem("data"); $("title").html(data.title); $('.lg').remove(); let footer = $(".footer"); footer.before($("
图片数量:" + data.num + "P
白嫖会员: 以上功能全部免费白嫖!只求去脚本主页给个好评支持一下~
') break; case "/u/?action=shoucang": let catalog = localStorage.getItem("collect") == null ? [] : JSON.parse(localStorage.getItem("collect")); $('.width').remove(); $('.c').after(`" + $(this).html() + "
"; }); let title = $item.find("p.biaoti > a").text(); let num = $item.find("span.shuliang").text().split("P")[0]; let id = /(.*)(\d+)\/(\d+)\/(\d+).*/g.exec($item.find('img').attr('src')); if (num == null || id.length < 3) { throw ("未获取到图集信息" + $item.html()); } $(this).on("click", function () { var data = { "num": num, "tags": tags, "prefix": id[1], "path": id[2], "id": id[3], "title": title }; localStorage.setItem("data", JSON.stringify(data)); window.open("/"); return false; }); }); }); break; } } tujidaoinit() var last = 1; new MutationObserver(() => { if ($('.hezi').length > last) { console.log("观察到分页脚本触发, 图集岛脚本重新初始化...") tujidaoinit() last = $('.hezi').length; } }).observe(document.body, { childList: true, subtree: true }); })();