看图外挂

不用翻页即可一键查看套图所有图片,已覆盖女神社、全图网、秀色女神、美女屋、秀人集

Versión del día 04/04/2022. Echa un vistazo a la versión más reciente.

// ==UserScript==
// @name         看图外挂
// @namespace    香谢枫林
// @version      1.0.2
// @description  不用翻页即可一键查看套图所有图片,已覆盖女神社、全图网、秀色女神、美女屋、秀人集
// @author       香谢枫林
// @license      MIT
// @match        *://nshens.com/*
// @match        *://inewgirl.com/*
// @match        *://qq.quantuwang1.com/*
// @match        *://m.54mn.cc/*
// @match        *://www.xsnvshen.co/*
// @match        *://www.jpxgyw.net/*
// @match        *://www.xiurenb.net/*
// @require      https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js
// @grant        unsafeWindow
// ==/UserScript==

(function() {
    'use strict';
    window.onload = function () {
        //全图网
        let ViewQuantuwang = function(){
            //设置按钮属性及功能
            let div=document.createElement("div");
            div.innerHTML='<a id="qtw_wg" href="javascript:void(0);"><img height="40px" src="http://lzqq.com.cn/images/ktwg.png"></a>';
            div.addEventListener("click",function(event){
                // console.log("开始插入图片");
                listPicAll();
            });
            //在图片左上方添加图片按钮
            let title_tag = document.getElementsByClassName("index_c_tag");
            title_tag[0].appendChild(div);
            //获取图片数量
            let div_img_num = document.getElementsByClassName("index_c_page");
            let img_num = parseInt(div_img_num[0].lastElementChild.innerHTML);
            //找到并获取图片链接
            // let div_img = document.getElementsByClassName("index_c_img");
            let div_img = $(".index_c_img");
            let img_url = div_img.children("a").children("img").attr("src");
            let img_url_str = img_url.substr(0,img_url.length-5);
            let img_name = div_img.children("a").children("img").attr("alt");
            //列出所有图片
            let listPicAll = function () {
                let pic_all = '';
                for(let i=1;i<=img_num;i++){
                    let url = img_url_str + i + '.jpg';
                    pic_all = pic_all + '<img style="width: 800px" src="'+url+'" alt="'+img_name+'">';
                }
                div_img.children("a")[0].innerHTML = pic_all;
            };
        };

        //秀色女神
        let ViewXsnvshen = function(){
            //设置按钮属性及功能
            let div = document.createElement("div");
            div.innerHTML='<div class="lm_name"><i></i><span class="f20 yh c666"><a href="javascript:void(0);" style="color:red;">看图外挂</a></span></div>';
            div.className = "wrapper1083 show_box_01";
            div.addEventListener("click",function(event){
                // console.log("开始插入图片");
                listPicAll();
            });
            //插入按钮
            let div_parent = document.getElementsByClassName("longConWhite");
            div_parent[0].insertBefore(div,div_parent[0].childNodes[4]);

            let title = $('h1').children('a')[0].innerText; //标题
            //获取图片数量
            let sp_num = $(".swp-tool").children('em')[0].childNodes[1].textContent;
            let img_num = parseInt(sp_num.replace(/[^0-9]/ig,"")); //取出数字就是图片的数量
            //获取图片链接
            let div_img = $(".workShow").children('ul').children('li');
            let img_url = div_img.children('img').attr('src')
            let img_url_str = 'https:' + img_url.substr(0,img_url.length-7);
            //列出所有图片
            let listPicAll = function () {
                let pic_all = '';
                for(let i=0;i<img_num;i++){
                    let url = img_url_str + prefix_integer(i,3) + '.jpg';
                    pic_all = pic_all + '<img id="bigImg" src="'+url+'" alt="'+title+'" class="mb10" style="max-width: 800px; height: auto;">';
                }
                div_img[0].innerHTML = pic_all;
            };
            let prefix_integer = function (num, length) {
                return (Array(length).join('0') + num).slice(-length);
            }
        };

        //美女屋
        let ViewJpxgyw = function(){
            //设置按钮属性及功能
            let div = document.createElement("div");
            div.innerHTML='<strong class="text-success"><i class="fa fa-hand-o-right"></i> </strong><a id="jpxgyw_wg" href="javascript:void(0);"  style="color: red; margin: 10px;">||看图外挂</a>';
            div.addEventListener("click",function(event){
                // console.log("开始插入图片");
                listPicAll();
            });
            //插入按钮
            document.getElementsByClassName("pull-right")[0].appendChild(div);

            //列出所有图片
            let listPicAll = function () {
                // document.getElementById("jpxgyw_wg").innerHTML="看图外挂,加载ing";
                // $('#jpxgyw_wg').text("看图外挂,加载ing");
                //获取标题
                let title = $('.article-title')[0].innerText; //标题
                let page = $(".pagination");
                let page_current = $('.current')[0].innerHTML;//判断是否是第一页
                let page_url = '';
                let page_url_str = '';
                let page_num = '';
                if(page_current == 1){
                    page_url = page.children('ul').children('a')[0]['href'];
                    page_url_str = page_url.substr(0,page_url.length-5);
                    page_num = page.children('ul').children('a').length/2-1;
                }else{
                    page_url = page.children('ul').children('a')[1]['href'];
                    page_url_str = page_url.substr(0,page_url.length-5);
                    page_num = page.children('ul').children('a').length/2-2;
                }
                //获取首页图片数据
                let img_p = $(".article-content").children("p");
                let img_p_num = img_p.children('img').length;
                let pic_all = '';
                //获取首页图片
                for(let i=0;i<img_p_num;i++){
                    pic_all = pic_all + '<img width="800px" src="'+img_p.children('img')[i]['src']+'" alt="'+title+'"><br><br>';
                }
                //获取其他标签页的图片
                for(let i=1;i<=page_num;i++){
                    let page_urls = page_url_str+"_"+i+".html";
                    pic_all = getPaginationPicUrl(pic_all,page_urls,title);
                }
                img_p[0].innerHTML = pic_all;
                // console.log(pic_all);
                $('#jpxgyw_wg').text("看图外挂,加载完成");
            };
            //获取指定页面的图片
            let getPaginationPicUrl = function (pic_all,page_url,title) {
                $.ajaxSettings.async = false;
                $.get(page_url,function (data) {
                    console.log('获取返回值');
                    let res_img_num = $(data).find(".article-content").children("p").children('img').length;
                    for(let i=0;i<res_img_num;i++){
                        pic_all = pic_all + '<img width="800px" src="'+$(data).find(".article-content").children("p").children('img')[i]['src']+'" alt="'+title+'"><br><br>';
                        // $(data).find(".article-content").children("p").children('img')[0]['src']
                    }
                });
                $.ajaxSettings.async = true;
                return pic_all;
            };
        };
        //女神社
        let ViewNshens = function () {
            //设置按钮属性及功能
            let div=document.createElement("div");
            div.innerHTML='<a id="nshens_wg" href="javascript:void(0);" class="ma-2 v-btn v-btn--is-elevated v-btn--has-bg theme--light v-size--default red" style="color: white; margin: 10px;"><span class="v-btn__content">看图外挂</span></a>';
            div.addEventListener("click",function(event){
                // console.log("开始插入图片");
                listPicAll();
                //去掉顶部header,影响看图
                $('header').remove();
            });
            //在H3标题后插入按钮
            let title = $('h3')[0];
            let title_str = title.innerText; //标题
            let str5 = title_str.substr(title_str.length-5); //取标题后5位
            let pic_num = parseInt(str5.replace(/[^0-9]/ig,"")); //取出数字就是图片的数量
            let parent = null;
            parent = title.parentNode;
            parent.appendChild(div);
            //获取第一张图片链接
            let div_parent = null;
            let div_nav = document.getElementsByClassName("text-center");
            div_parent = div_nav[0].parentNode;
            let pic_url = div_parent.children[2].children[0].children[0]['href']; //第一张图片url
            let url_str = pic_url.substr(0,pic_url.length-5);
            //列出所有图片
            let listPicAll = function () {
                let pic_all = '';
                for(let i=0;i<pic_num;i++){
                    let url = url_str + i + '.jpg';
                    pic_all = pic_all + '<a href="'+url+'" target="_blank"><div aria-label="'+title_str+'" role="img" class="v-image v-responsive theme--light" style="min-height: 300px; min-width: 200px;"><div class="v-responsive__sizer" style="padding-bottom: 150%;"></div><div class="v-image__image v-image__image--cover" style="background-image: url(&quot;'+url+'&quot;); background-position: center center;"></div><!----><div class="v-responsive__content post-item-image" style="width: 1000px;"></div></div></a>';
                }
                div_parent.children[2].children[0].innerHTML = pic_all;
            };
        };
        //秀人集
        let ViewXiurenb = function(){
            //设置按钮属性及功能
            let div = document.createElement("div");
            // div.className = "jianjie";
            div.innerHTML='<a href="javascript:void(0);"><span id="xiurenb_wg" style="color: red;font-size: x-large">||看图外挂</span></a>';
            div.addEventListener("click",function(event){
                // console.log("开始插入图片");
                listPicAll();
            });
            //插入按钮
            $(".item_title")[1].appendChild(div);

            //列出所有图片
            let listPicAll = function () {
                let title = $('h1')[0].innerText; //标题
                let page = $(".page");
                let page_current = $('.current')[0].innerHTML;//判断是否是第一页
                let page_url = '';
                let page_url_str = '';
                let page_num = '';
                if(page_current == 1){
                    page_url = page.children('a')[1]['href'];
                    page_url_str = page_url.substr(0,page_url.length-5);
                    page_num = page.children('a').length/2-2;
                }else{
                    page_url = page.children('a')[2]['href'];
                    page_url_str = page_url.substr(0,page_url.length-5);
                    page_num = page.children('a').length/2-3;
                }
                //获取首页图片数据
                let img_p = $(".content").children("p");
                let img_p_num = img_p.children('img').length;
                let pic_all = '';
                //获取首页图片
                for(let i=0;i<img_p_num;i++){
                    pic_all = pic_all + '<img width="800px" src="'+img_p.children('img')[i]['src']+'" alt="'+title+'"><br><br>';
                }
                //获取其他标签页的图片
                for(let i=1;i<=page_num;i++){
                    let page_urls = page_url_str+"_"+i+".html";
                    pic_all = getPaginationPicUrl(pic_all,page_urls,title);
                }
                $(".content").children("p").attr({style:"width:800px"});//设置居中
                $(".content").attr('align','center');//设置宽度800px
                img_p[0].innerHTML = pic_all;
                // console.log(pic_all);
                $('#xiurenb_wg').text("看图外挂,加载完成");
            };
            //获取指定页面的图片
            let getPaginationPicUrl = function (pic_all,page_url,title) {
                $.ajaxSettings.async = false;
                $.get(page_url,function (data) {
                    console.log('获取返回值');
                    let res_img_num = $(data).find(".content").children("p").children('img').length;
                    for(let i=0;i<res_img_num;i++){
                        pic_all = pic_all + '<img width="800px" src="'+$(data).find(".content").children("p").children('img')[i]['src']+'" alt="'+title+'"><br><br>';
                        // $(data).find(".article-content").children("p").children('img')[0]['src']
                    }
                });
                $.ajaxSettings.async = true;
                return pic_all;
            };
        };
        //主程序入口,获取url判断网站类型
        let url = window.location.host;
        if(url.indexOf("quantuwang") >=0 || url.indexOf("54mn") >=0){
            console.log("这是全图网");
            ViewQuantuwang();
        }else if(url.indexOf("xsnvshen") >=0) {
            console.log("这是秀色女神");
            ViewXsnvshen();
        }
        else if(url.indexOf("jpxgyw") >=0) {
            console.log("这是美女屋");
            ViewJpxgyw();
        }else if(url.indexOf("nshens") >=0 || url.indexOf("inewgirl") >=0) {
            console.log("这是女神社");
            ViewNshens();
        }else if(url.indexOf("xiurenb") >=0) {
            console.log("这是秀人集");
            ViewXiurenb();
        }
    }
})();