[{"bookSourceUrl":"https:\/\/www.zhswx.com\/","bookSourceName":"zhswx","enabledExplore":true,"enabled":true,"bookSourceGroup":"","author":"Codex","help":true,"html":"<!DOCTYPE html>\n<html lang=\"zh-CN\">\n<head>\n    <meta charset=\"UTF-8\">\n    <title>zhswx qysg source<\/title>\n<\/head>\n<body><\/body>\n<script src=\"https:\/\/vc.jd.com\/web\/js\/jquery-3.1.1.min.js\"><\/script>\n<script>\n    var isCookieJar = true;\n\n    class FlutterJSBridge {\n        constructor() {\n            this.init();\n        }\n        init() {\n            if (window.flutter_inappwebview) {\n                this.isReady = true;\n                this.CookieJar();\n            } else {\n                window.addEventListener(\"flutterInAppWebViewPlatformReady\", () => {\n                    this.isReady = true;\n                    this.CookieJar();\n                });\n            }\n        }\n        async CookieJar() {\n            try {\n                await window.flutter_inappwebview.callHandler(\"CookieJar\", isCookieJar);\n            } catch (error) {}\n        }\n        async log(str) {\n            try {\n                return await window.flutter_inappwebview.callHandler(\"log\", str);\n            } catch (error) {\n                return false;\n            }\n        }\n        async webview(url, js, html, body, header) {\n            try {\n                return await window.flutter_inappwebview.callHandler(\"webview\", url, js, html, body, header, \"\", \"\");\n            } catch (error) {\n                return \"\";\n            }\n        }\n        async text(type, str) {\n            try {\n                return await window.flutter_inappwebview.callHandler(\"text\", type, str);\n            } catch (error) {\n                return false;\n            }\n        }\n    }\n\n    class Http {\n        async Get(url, headers, followRedirects) {\n            try {\n                return await window.flutter_inappwebview.callHandler(\"http\", \"get\", url, \"\", JSON.stringify(headers), followRedirects, \"\");\n            } catch (error) {\n                return null;\n            }\n        }\n    }\n\n    const flutterBridge = new FlutterJSBridge();\n    const http = new Http();\n    const BASE_URL = \"https:\/\/www.zhswx.com\";\n    const DEFAULT_HEADERS = {\n        \"user-agent\": \"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/136.0.0.0 Safari\/537.36\",\n        \"referer\": BASE_URL + \"\/\"\n    };\n\n    function absoluteUrl(url, base) {\n        try {\n            return new URL(url, base || BASE_URL).toString();\n        } catch (e) {\n            return url || \"\";\n        }\n    }\n\n    function parseHTMLSafely(htmlStr) {\n        const div = document.createElement(\"div\");\n        div.innerHTML = htmlStr || \"\";\n        return div;\n    }\n\n    function stripScriptsAndStyles(html) {\n        return (html || \"\")\n            .replace(\/<script\\b[^<]*(?:(?!<\\\/script>)<[^<]*)*<\\\/script>\/gi, \"\")\n            .replace(\/<style\\b[^<]*(?:(?!<\\\/style>)<[^<]*)*<\\\/style>\/gi, \"\");\n    }\n\n    function textOf(node) {\n        return ((node && (node.textContent || node.innerText)) || \"\")\n            .replace(\/\\u00a0\/g, \" \")\n            .replace(\/\\s+\/g, \" \")\n            .trim();\n    }\n\n    function htmlOf(node) {\n        return node ? node.innerHTML || \"\" : \"\";\n    }\n\n    async function fetchHtml(url) {\n        const res = await http.Get(url, DEFAULT_HEADERS, true);\n        return res && res.data ? res.data : \"\";\n    }\n\n    async function fetchRenderedHtml(url) {\n        return await flutterBridge.webview(\n            url,\n            \"document.documentElement.outerHTML\",\n            \"\",\n            \"\",\n            JSON.stringify(DEFAULT_HEADERS)\n        );\n    }\n\n    function parseBookFromDetail(root, pageUrl) {\n        const name = textOf(root.querySelector(\"#novel_title h1, #list h1, h1\"));\n        const authorNode = root.querySelector('a[title*=\"作者标签\"], a[title^=\"作者:\"], a[href^=\"\/list\/\"]');\n        const author = authorNode ? textOf(authorNode) : \"\";\n        let kind = \"\";\n        const kindNode = root.querySelector('a[title*=\"小说分类标签\"]');\n        if (kindNode) kind = textOf(kindNode);\n        const cover = root.querySelector('img[src*=\"\/images\/\"]');\n        const introBlock = htmlOf(root.querySelector(\"#novel_title + div, .style2 div[style*='line-height']\"));\n        const introMatch = introBlock.match(\/\\u3010\\u5185\\u5bb9\\u7b80\\u4ecb\\u3011([\\s\\S]*?)(?:<p\\\/>|<div id=\"novel_toolbar\"|<br \\\/>)\/i);\n        const latestNode = root.querySelector(\"td.chapterlist a\");\n        return {\n            bookUrl: pageUrl,\n            name: name,\n            author: author,\n            kind: kind,\n            coverUrl: cover ? absoluteUrl(cover.getAttribute(\"src\"), pageUrl) : \"\",\n            intro: introMatch && introMatch[1] ? introMatch[1].replace(\/<br\\s*\\\/?>\/gi, \"\\n\").replace(\/<[^>]+>\/g, \"\").trim() : \"\",\n            tocUrl: absoluteUrl(root.querySelector('a[href^=\"\/chapter\/\"]') ? root.querySelector('a[href^=\"\/chapter\/\"]').getAttribute(\"href\") : pageUrl, pageUrl),\n            wordCount: \"\",\n            type: \"0\",\n            latestChapterTitle: latestNode ? textOf(latestNode) : \"\"\n        };\n    }\n\n    function parseBooksFromList(root, pageUrl) {\n        const books = [];\n        const rows = root.querySelectorAll(\".updating tr.odd, .updating tr.even\");\n        rows.forEach(row => {\n            const bookNode = row.querySelector(\".td2 a\");\n            const latestNode = row.querySelector(\".td3 a\");\n            const kindNode = row.querySelector(\".td1 a\");\n            const authorNode = row.querySelector(\".td4\");\n            if (!bookNode) return;\n            const bookUrl = absoluteUrl(bookNode.getAttribute(\"href\"), pageUrl);\n            books.push({\n                bookUrl: bookUrl,\n                name: textOf(bookNode),\n                author: textOf(authorNode),\n                kind: textOf(kindNode).replace(\/^\\[|\\]$\/g, \"\"),\n                coverUrl: \"\",\n                intro: \"\",\n                tocUrl: bookUrl,\n                wordCount: \"\",\n                type: \"0\",\n                latestChapterTitle: latestNode ? textOf(latestNode).replace(\/^\\u6700\\u8fd1\\u66f4\\u65b0[:\\uff1a]\/, \"\") : \"\"\n            });\n        });\n        return books;\n    }\n\n    async function search(key, page) {\n        if (page > 1) return \"[]\";\n        const rawUrl = BASE_URL + \"\/list\/\" + key + \".html\";\n        const encodedUrl = BASE_URL + \"\/list\/\" + encodeURIComponent(key) + \".html\";\n        let html = await fetchRenderedHtml(rawUrl);\n        if (!html || html.length < 200) {\n            html = await fetchRenderedHtml(encodedUrl);\n        }\n        if (!html || html.length < 200) {\n            html = await fetchHtml(encodedUrl);\n        }\n        await flutterBridge.text(0, html);\n        const root = parseHTMLSafely(stripScriptsAndStyles(html));\n\n        if (root.querySelector(\"#novel_title h1\")) {\n            return JSON.stringify([parseBookFromDetail(root, encodedUrl)]);\n        }\n\n        const books = parseBooksFromList(root, encodedUrl);\n        return JSON.stringify(books);\n    }\n\n    async function info(bookurl) {\n        const html = await fetchHtml(bookurl);\n        await flutterBridge.text(1, html);\n        const root = parseHTMLSafely(stripScriptsAndStyles(html));\n        const book = parseBookFromDetail(root, bookurl);\n        return JSON.stringify(book);\n    }\n\n    async function chapter(tocUrl) {\n        const html = await fetchHtml(tocUrl);\n        await flutterBridge.text(2, html);\n        const root = parseHTMLSafely(stripScriptsAndStyles(html));\n        const nodes = root.querySelectorAll(\"td.chapterlist a\");\n        const list = [];\n        nodes.forEach((node, index) => {\n            const href = absoluteUrl(node.getAttribute(\"href\"), tocUrl);\n            const name = textOf(node);\n            if (!href || !name) return;\n            list.push({\n                name: name,\n                chapterId: href,\n                index: index,\n                isPay: false,\n                isVip: false,\n                isVolume: false,\n                tag: \"\"\n            });\n        });\n        return JSON.stringify(list);\n    }\n\n    async function content(url) {\n        const html = await fetchHtml(url);\n        await flutterBridge.text(3, html);\n        const root = parseHTMLSafely(html);\n        const contentNode = Array.from(root.querySelectorAll(\"div\"))\n            .find(node => {\n                const style = (node.getAttribute(\"style\") || \"\").replace(\/\\s+\/g, \"\");\n                return style.indexOf(\"font-size:20px\") !== -1 && style.indexOf(\"width:700px\") !== -1;\n            });\n        if (!contentNode) return \"\";\n\n        let content = htmlOf(contentNode)\n            .replace(\/<br\\s*\\\/?>\/gi, \"\\n\")\n            .replace(\/<p\\\/>\/gi, \"\\n\\n\")\n            .replace(\/<p[^>]*>\/gi, \"\")\n            .replace(\/<\\\/p>\/gi, \"\")\n            .replace(\/<div[\\s\\S]*$\/i, \"\")\n            .replace(\/<[^>]+>\/g, \"\")\n            .replace(\/\\u624b\\u673a\\u7528\\u6237\\u8bf7\\u8bbf\\u95ee[\\s\\S]*?\\u513f\\u903cquger\/g, \"\")\n            .replace(\/\\u7ae0\\u8282\\u5217\\u8868\/g, \"\")\n            .replace(\/\\r\/g, \"\")\n            .replace(\/\\n{3,}\/g, \"\\n\\n\")\n            .trim();\n        return content;\n    }\n\n    async function getfinds() {\n        return JSON.stringify([\n            { title: \"\\u9996\\u9875\", url: BASE_URL + \"\/\", js: \"\", type: 1, width: 1 },\n            { title: \"\\u7384\\u5e7b\", url: BASE_URL + \"\/list\/\\u7384\\u5e7b.html\", js: \"\", type: 1, width: 1 },\n            { title: \"\\u90fd\\u5e02\", url: BASE_URL + \"\/list\/\\u90fd\\u5e02.html\", js: \"\", type: 1, width: 1 },\n            { title: \"\\u4ed9\\u4fa0\", url: BASE_URL + \"\/list\/\\u4ed9\\u4fa0.html\", js: \"\", type: 1, width: 1 },\n            { title: \"\\u5386\\u53f2\", url: BASE_URL + \"\/list\/\\u5386\\u53f2.html\", js: \"\", type: 1, width: 1 },\n            { title: \"\\u79d1\\u5e7b\", url: BASE_URL + \"\/list\/\\u79d1\\u5e7b.html\", js: \"\", type: 1, width: 1 }\n        ]);\n    }\n\n    async function find(url, page) {\n        if (page > 1) return \"[]\";\n        let html = await fetchRenderedHtml(url);\n        if (!html || html.length < 200) {\n            html = await fetchHtml(url);\n        }\n        await flutterBridge.text(0, html);\n        const root = parseHTMLSafely(stripScriptsAndStyles(html));\n        if (root.querySelector(\"#novel_title h1\")) {\n            return JSON.stringify([parseBookFromDetail(root, url)]);\n        }\n        return JSON.stringify(parseBooksFromList(root, url));\n    }\n\n    async function getloginurl() {\n        return \"\";\n    }\n\n    async function login() {}\n\n    async function pay(bookurl, url) {}\n\n    async function imagedecrypt(url, image) {}\n\n    async function shouldOverrideUrlLoading(url) {\n        return true;\n    }\n<\/script>\n<\/html>\n","login":false,"lastUpdateTime":"1779114955448"}]