[{"bookSourceComment":"by天天的鸟蛋蛋\n他支持两种\n\n\n# 通过文本 重新排序 有数字才能用\n```js\n1 5 2 6目录乱序解决办法 复制到目录规则\n<js>\nvar JsDom = Packages.org.jsoup.Jsoup;\nvar Document = Packages.org.jsoup.nodes.Document;\nvar Element = Packages.org.jsoup.nodes.Element;\n\n\nvar document = JsDom.parse(src);\n\n\/\/获取列表 此处要改 改成对应的 css选择器\nvar links = document.select('.list_li > li > a');\n\nvar list = [];\nfor (var i = 0; i < links.size(); i++) {\n    var link = links.get(i);\n    list.push({\n        text: link.text(),\n        url: link.attr('href')\n    });\n}\n\n\/\/排序\nlist.sort(function(a, b) {\n    var pageA = parseInt(a.text.match(\/\\d+\/)[0], 10);\n    var pageB = parseInt(b.text.match(\/\\d+\/)[0], 10);\n    return pageA - pageB;\n});\n\n\njava.log(JSON.stringify(list));\nlist;\n<\/js>\n```\n\n\n# 通过属性ID 重新排序\n```js\n<js>\nvar JsDom = Packages.org.jsoup.Jsoup;\nvar Document = Packages.org.jsoup.nodes.Document;\nvar Element = Packages.org.jsoup.nodes.Element;\n\nvar document = JsDom.parse(src);\n\n\/\/ 获取列表 第一次需要修改的地方 修改正确的css 选择器\nvar links = document.select('.list_li > li');\n\nvar list = [];\nfor (var i = 0; i < links.size(); i++) {\n    var dd = links.get(i);\n    var a = dd.select('a').first(); \n    if (a != null) { \n        list.push({\n            text: a.text(),\n            id: dd.attr('id').replace('ch', ''), \/\/获取ID属性 需要自己手动改 第二处需要修改的地\n            url: a.attr('href')\n        });\n    } \n}\n\n\/\/ 排序\nlist.sort(function(a, b) {\n    var pageA = parseInt(a.id, 10);\n    var pageB = parseInt(b.id, 10);\n    return pageA - pageB;\n});\n\njava.log(JSON.stringify(list));\nlist;\n<\/js>\n搞定 获取ID 属性得自己手动改\n```\n解决目录乱序通过ID属性\n更新\n\/\/2025\/1\/8","bookSourceName":"滋味小说","bookSourceType":0,"bookSourceUrl":"https:\/\/www.zwxiaoshuo.com","customOrder":0,"enabled":true,"enabledCookieJar":true,"enabledExplore":true,"exploreUrl":"言情小说::https:\/\/m.zwxiaoshuo.com\/sort12-{{page}}.html\n都市言情::https:\/\/m.zwxiaoshuo.com\/sort3-{{page}}.html\n悬疑探险::https:\/\/m.zwxiaoshuo.com\/sort16-{{page}}.html\n盗墓小说::https:\/\/m.zwxiaoshuo.com\/sort15-{{page}}.html\n历史军事::https:\/\/m.zwxiaoshuo.com\/sort4-{{page}}.html\n武侠小说::https:\/\/m.zwxiaoshuo.com\/sort11-{{page}}.html\n奇幻玄幻::https:\/\/m.zwxiaoshuo.com\/sort1-{{page}}.html\n恐怖惊悚::https:\/\/m.zwxiaoshuo.com\/sort8-{{page}}.html\n侦探推荐::https:\/\/m.zwxiaoshuo.com\/sort5-{{page}}.html\n科幻小说::https:\/\/m.zwxiaoshuo.com\/sort7-{{page}}.html","lastUpdateTime":"1736375144909","respondTime":180000,"ruleBookInfo":{"author":".intro a@text","coverUrl":"img@src","intro":"#htmljieshao@html","kind":".intro > li:nth-child(2)@text&&.intro > li:nth-child(3)@text&&#alllist > li:nth-child(1)@text##.*：","lastChapter":"#alllist a@text##.*：","name":"h1@text","tocUrl":"text.开始阅读@href","wordCount":".intro > li:nth-child(4)@text##.*："},"ruleContent":{"content":"#htmlContent@html"},"ruleExplore":{"author":"","bookList":"","bookUrl":"","kind":"","lastChapter":"","name":""},"ruleSearch":{"author":"p:nth-child(2)@text","bookList":"#ulist > li:nth-child(n+1) > a","bookUrl":"a@href","kind":"p:nth-child(4)@text##.*：","lastChapter":"p:nth-child(3)@text##.*：","name":".book_title@text"},"ruleToc":{"chapterList":"<js>\nvar JsDom = Packages.org.jsoup.Jsoup;\nvar Document = Packages.org.jsoup.nodes.Document;\nvar Element = Packages.org.jsoup.nodes.Element;\n\nvar document = JsDom.parse(src);\n\n\/\/ 获取列表 第一次需要修改的地方 修改正确的css 选择器\nvar links = document.select('ul> li');\n\nvar list = [];\nfor (var i =0; i < links.size(); i++) {\n    var dd = links.get(i);\n    var a = dd.select('a').first(); \n    if (a != null) { \n        list.push({\n            text: a.text(),\n            id: dd.attr('id').replace('ch', ''), \/\/获取ID属性 需要自己手动改 第二处需要修改的地\n            url: a.attr('href')\n        });\n    } \n}\n\n\/\/ 排序\nlist.sort(function(a, b) {\n    var pageA = parseInt(a.id, 10);\n    var pageB = parseInt(b.id, 10);\n    return pageA - pageB;\n});\n\njava.log(JSON.stringify(list));\nlist;\n<\/js>","chapterName":"text","chapterUrl":"url"},"searchUrl":"{{url=source.getKey();cookie.removeCookie(url)}}\nhttps:\/\/m.zwxiaoshuo.com\/modules\/article\/search.php?searchkey={{key}}&searchtype=all,{\n  \"charset\": \"GBK\",\n  \"method\": \"GET\"\n}","weight":0}]