台湾小说网
https://twkan.com
yezechuandl (3004)3天前
//2025.10.12 ◎夜泽川◎
{ "bookSourceComment": "\/\/2025.10.12 ◎夜泽川◎", "bookSourceGroup": "自制,网络", "bookSourceName": "台湾小说网", "bookSourceType": 0, "bookSourceUrl": "https:\/\/twkan.com", "bookUrlPattern": "https?:\\\/\\\/twkan\\.com\\\/book\\\/\\d+\\.html", "customOrder": 19, "enabled": true, "enabledCookieJar": true, "enabledExplore": true, "exploreUrl": "@js:\nvar result = [];\nvar push = (title, url, size) => result.push({\n title: java.t2s(title),\n url: url && \/_\/.test(url) ? `\/novels\/${url}.html` : url,\n style: {\n layout_flexGrow: 1,\n layout_flexBasisPercent: size\n }\n});\n\npush(\"书籍分类\", null, 1);\n\nconst tag = org.jsoup.Jsoup.parse(Ajax(source.key + \"\/novels\/hot\")).select('.listleft li:not([class]) a');\nconst sort = [\n [\"全部\", \"monthvisit_0_0_1\"],\n [\"连载\", \"newhot_0_0_1\"],\n [\"全本\", \"newhot_0_1_1\"],\n [\"人气\", \"weekvisit_0_0_1\"],\n [\"推荐\", \"allvote_0_0_1\"],\n [\"新书\", \"newhot_0_0_1\"]\n];\n\nsort.forEach(([name, pattern]) => {\n let Url = pattern.replace(\/1$\/, \"{{page}}\");\n push(`༺ˇ»\\`ʚ ${name} ɞ´«ˇ༻`, Url, 1);\n tag.toArray().forEach((e, i) => push(e.text(), Url.replace(\/^(.+?_)0\/, `$1${i+1}`), 0.25));\n});\n\npush(\"༺ˇ»`ʚ 标签 ɞ´«ˇ༻\", null, 1);\norg.jsoup.Jsoup.parse(Ajax(source.key + \"\/newtags\")).select('.tag a').forEach(n => \n push(n.text(), n.attr('href') + \"{{page}}\", -1)\n);\n\nJSON.stringify(result);", "header": "{\"User-Agent\":\"Mozilla\/5.0 (Linux; Android 9) Mobile Safari\/537.36\"}", "jsLib": "var Regex = \/Just a moment|onloadTurnstileCallback\/;\nfunction Ajax(url) {\n const { java } = this;\n let result = java.ajax(url);\n let retryCount = 0;\n const maxRetries = 3;\n while (Regex.test(result) && retryCount < maxRetries) {\n result = java.startBrowserAwait(url, \"验证\").body();\n }\n return result;\n}", "lastUpdateTime": "1760284479543", "loginCheckJs": "let original = result;\nlet url = result.url();\nlet ck = cookie.getCookie(url).split('; ').filter(item => !item.startsWith(\"jieqiVisitTime\")).join('; ');\ncookie.setCookie(url, ck);\nif (result.code() == 403) java.toast('服务器拒绝访问,请检查网络状况!');\nif (Regex.test(original.body())) {\n\t cookie.removeCookie(url);\n\t if (key && page) {\n\t \tjava.toast('如搜索未弹出验证,浏览器内手动搜索即可');\n\t \tPackages.java.lang.Thread.sleep(40);\n\t \t}\n result = java.startBrowserAwait(url, \"验证\");\n if (\/onloadTurnstileCallback\/.test(original.body())) {\n java.initUrl();\n result = java.getStrResponse(null, null, false);\n }\n}\nresult;", "loginUi": "[\n {\n \"name\": \"简繁转换\",\n \"type\": \"button\",\n \"action\": \"t2s()\",\n \"style\": {\n \"layout_flexGrow\": 1,\n \"layout_flexBasisPercent\": 1\n }\n }\n]", "loginUrl": "function t2s() {\n let mySelect = source.getVariable();\n let t2sTrue = source.getVariable() == 'true' ? false : true;\n \tsource.setVariable(String(t2sTrue));\n java.toast(`已${t2sTrue ? '开启' : '关闭'}全局简繁转换`);\n}", "respondTime": 180000, "ruleBookInfo": { "author": "@get:{a}", "coverUrl": "@get:{i}", "init": "<js>java.setContent(source.getVariable() == 'true' ? java.t2s(src) : src);<\/js>\n@put:{\"n\":\"[property$=book_name]@content\",\n\"a\":\"[property$=author]@content\",\n\"t\":\"[property~=category|status]@content\",\n\"l\":\"[property$=latest_chapter_name]@content\",\n\"i\":\"[property$=image]@content\",\n\"z\":\".booknav2@p.-2@text\",\n\"o\":\"[property$=description]@content\",\n\"g\":\"[property$=update_time]@content\",\n\"m\":\"a[class$=more-btn]@href\"\n}", "intro": "@get:{o}", "kind": "@get:{t}", "lastChapter": "@get:{l}◎@get:{g}", "name": "@get:{n}", "tocUrl": "@get:{m}##\\\/(\\d+)\\\/##\/ajax_novels\/chapterlist\/$1.html###", "wordCount": "@get:{z}##\\s*\\|.*$" }, "ruleContent": { "content": ".txtnav@html##<[^>]+>.*?<[^>]+>|{{chapter.title}}|\\(本章完\\)|<br\\\/?>|\\ue5e5\n@js:\nresult = source.getVariable() == 'true' ? java.t2s(result) : result;\nresult;", "nextContentUrl": "text.下一章@href||[class^=\"page\"]@a.-1@href", "replaceRegex": "##.*[記记]住首[發发][網网]站域名.*", "title": "h1@text\n@js:result = source.getVariable() == 'true' ? java.t2s(result) : result;\nresult;" }, "ruleExplore": {}, "ruleSearch": { "author": "label.0@text", "bookList": "<js>\nresult = source.getVariable() == 'true' ? java.t2s(result) : result;\nresult;\n<\/js>\n.newbox > ul > li", "bookUrl": "a.0@href", "coverUrl": "img@data-src", "intro": "ol@text", "kind": "label!0@text", "lastChapter": ".zxzj p@ownText", "name": "h3@text" }, "ruleToc": { "chapterList": "ul > li\n@js:\nresult.sort((a, b) => +a.attr('data-num') - +b.attr('data-num'));\nresult;", "chapterName": "a@text\n@js:result = source.getVariable() == 'true' ? java.t2s(result) : result;\nresult;", "chapterUrl": "a@href" }, "searchUrl": "\/search\/{{key}}\/{{page}}.html", "weight": 0 }