幻影小说网

https://www.huiysj.com

laizhiyu (6509)07/03 14:02

目录拼接,正文加密
二维码导入
{
    "bookSourceComment": "幻影小说网 huiysj.com\nv5: 修复正文重复问题\n- 不存在的分页_N.html会被301重定向到首页\n- java.ajax()跟随重定向导致首页内容被重复追加\n- 修复:检查页码(第N页)是否匹配期望值,不匹配则停止\n- 目录:自动翻页+跳过重复章节\n- 正文:Base64解密+多页合并\n本书源难点:详情页显示目录前100章链接href,目录页101开始且链接需要自己拼接。正文加密",
    "bookSourceGroup": "玄幻;都市;言情",
    "bookSourceName": "幻影小说网",
    "bookSourceType": 0,
    "bookSourceUrl": "https:\/\/www.huiysj.com",
    "bookUrlPattern": "https:\/\/www.huiysj.com\/kuaishou\/.*\/index.html",
    "customButton": false,
    "customOrder": 3,
    "enabled": true,
    "enabledCookieJar": false,
    "enabledExplore": true,
    "eventListener": false,
    "exploreUrl": "玄幻修真::https:\/\/www.huiysj.com\/book\/1\/{{page}}.html\n重生穿越::https:\/\/www.huiysj.com\/book\/2\/{{page}}.html\n都市小说::https:\/\/www.huiysj.com\/book\/3\/{{page}}.html\n军史小说::https:\/\/www.huiysj.com\/book\/4\/{{page}}.html\n网游小说::https:\/\/www.huiysj.com\/book\/5\/{{page}}.html\n科幻小说::https:\/\/www.huiysj.com\/book\/6\/{{page}}.html\n灵异小说::https:\/\/www.huiysj.com\/book\/7\/{{page}}.html\n言情小说::https:\/\/www.huiysj.com\/book\/8\/{{page}}.html\n其他小说::https:\/\/www.huiysj.com\/book\/9\/{{page}}.html",
    "header": "{\"User-Agent\": \"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/120.0.0.0 Safari\/537.36\"}",
    "lastUpdateTime": "1783058537669",
    "respondTime": 180000,
    "ruleBookInfo": {
        "author": ".details .p a@text",
        "coverUrl": ".img img@src",
        "intro": ".details .p2@text",
        "kind": "meta[property=og:novel:category]@content",
        "lastChapter": "meta[property=og:novel:latest_chapter_name]@content",
        "name": ".details h2@text"
    },
    "ruleContent": {
        "content": "@js:\nvar src = String(result);\nvar doc = org.jsoup.Jsoup.parse(src);\n\nfunction decode(d) {\n    var scripts = d.select('script');\n    var s = '';\n    for (var i = 0; i < scripts.size(); i++) {\n        var data = scripts.get(i).data();\n        var m = data.match(\/qsbs\\.bb\\('([^']+)'\\)\/);\n        if (m) {\n            try {\n                var bytes = Packages.java.util.Base64.getDecoder().decode(m[1]);\n                s += String(new Packages.java.lang.String(bytes, 'UTF-8'));\n            } catch(e) {}\n        }\n    }\n    return s;\n}\n\nvar content = decode(doc);\n\nvar m = baseUrl.match(\/kuaishou\\\/(\\d+)\\\/(\\d+)(?:_\\d+)?\\.html\/);\nif (m) {\n    var bid = m[1];\n    var cid = m[2];\n    for (var p = 1; p < 50; p++) {\n        try {\n            var url = 'https:\/\/www.huiysj.com\/kuaishou\/' + bid + '\/' + cid + '_' + p + '.html';\n            var html = String(java.ajax(url));\n            if (!html) break;\n            \/\/ FIX: Check page number to detect 301 redirect to page 1\n            \/\/ Page p should be \"第(p+1)页\", if we get \"第1页\" it's a redirect\n            var pMatch = html.match(\/\\uff08\\u7b2c(\\d+)\\u9875\\uff09\/);\n            if (!pMatch) break;\n            if (parseInt(pMatch[1]) !== p + 1) break;\n            var nextContent = decode(org.jsoup.Jsoup.parse(html));\n            if (!nextContent || nextContent === '') break;\n            content += nextContent;\n        } catch(e) { break; }\n    }\n}\ncontent;",
        "replaceRegex": "##<p>.*?幻影小说.*?<\/p>##"
    },
    "ruleExplore": {
        "author": ".s4@text",
        "bookList": ".list_l2 li",
        "bookUrl": ".s2 a@href",
        "kind": ".s1@text",
        "lastChapter": ".s2 a@title##最新章节:",
        "name": ".s2 a@text"
    },
    "ruleSearch": {
        "author": ".s3 a@text",
        "bookList": "#novel-search li",
        "bookUrl": ".s2 a@href",
        "checkKeyWord": "我的",
        "kind": ".s1@text",
        "lastChapter": ".s4 a@text",
        "name": ".s2 a@text"
    },
    "ruleToc": {
        "chapterList": "@js:\nvar src = String(result);\nvar doc = org.jsoup.Jsoup.parse(src);\nvar bookId = baseUrl.match(\/kuaishou\\\/(\\d+)\/)[1];\nvar list = new Packages.java.util.ArrayList();\nvar seen = {};\n\nfunction addChap(name, url) {\n    if (url && url.indexOf('kuaishou') >= 0 && !seen[url]) {\n        seen[url] = 1;\n        var map = new Packages.java.util.HashMap();\n        map.put(\"name\", name);\n        map.put(\"url\", url);\n        list.add(map);\n    }\n}\n\nvar sections = doc.select('div.info_dv3');\nfor (var s = 0; s < sections.size(); s++) {\n    var sec = sections.get(s);\n    var title = sec.select('div.title').text();\n    if (title.indexOf('\\u7ae0\\u8282\\u5217\\u8868') >= 0) {\n        var links = sec.select('a[href*=\/kuaishou\/]');\n        for (var i = 0; i < links.size(); i++) {\n            var a = links.get(i);\n            var nm = a.text();\n            var hr = a.attr('abs:href');\n            if (nm && hr && hr.indexOf('all_') < 0) {\n                addChap(nm, hr);\n            }\n        }\n    }\n}\n\nvar moreLink = doc.select('a:containsOwn(\\u67e5\\u770b\\u66f4\\u591a)');\nif (moreLink.size() > 0) {\n    for (var p = 1; p < 30; p++) {\n        try {\n            var pageUrl = 'https:\/\/www.huiysj.com\/kuaishou\/' + bookId + '\/all_' + p + '\/index.html';\n            var html = String(java.ajax(pageUrl));\n            if (!html || html.indexOf('read_tz') < 0) break;\n            var d2 = org.jsoup.Jsoup.parse(html);\n            var items = d2.select('ul.yanqing_list li a');\n            if (items.size() === 0) break;\n            for (var k = 12; k < items.size(); k++) {\n                var a2 = items.get(k);\n                var nm2 = a2.text();\n                var oc = a2.attr('onclick');\n                var m = oc.match(\/read_tz\\((\\d+)\\)\/);\n                if (m) {\n                    addChap(nm2, 'https:\/\/www.huiysj.com\/kuaishou\/' + bookId + '\/' + m[1] + '.html');\n                }\n            }\n        } catch(e) { break; }\n    }\n}\n\nlist;",
        "chapterName": "$.name",
        "chapterUrl": "$.url"
    },
    "searchUrl": "https:\/\/www.huiysj.com\/search.html,{\"method\":\"POST\",\"body\":\"s={{key}}\",\"charset\":\"utf-8\"}",
    "weight": 0
}
广告