[{"bookSourceName":"纸墨小说","bookSourceUrl":"https://zhimo-books-sample.pages.dev","bookSourceGroup":"纸墨书库","bookUrlPattern":"https://zhimo-books-sample\\.pages\\.dev/toc/[0-9a-f]+\\.json","lastUpdateTime":1796378553352,"searchUrl":"/catalog.json?q={{java.encodeURI(key)}}","ruleSearch":{"name":"$.title","author":"$.author","bookUrl":"$.detail","lastChapter":"$.lastChapter","checkKeyWord":"纸飞机","bookList":"<js>\nvar q = decodeURIComponent(String(baseUrl).split('?q=')[1].replace(/\\+/g, ' ')).toLowerCase();\nvar rows = java.getElements('$.books[*]');\nvar it = rows.iterator();\nwhile (it.hasNext()) {\n    var row = it.next();\n    if ((String(row.get('title')) + ' ' + String(row.get('author'))).toLowerCase().indexOf(q) < 0) it.remove();\n}\nrows;\n</js>"},"exploreUrl":"全部藏书::/catalog.json","ruleExplore":{"name":"$.title","author":"$.author","bookUrl":"$.detail","lastChapter":"$.lastChapter","bookList":"$.books[*]"},"ruleBookInfo":{"name":"$.title","author":"$.author","lastChapter":"$.lastChapter","init":"<js>\nvar meta = JSON.parse(String(result));\nlibraryText(String(meta.id), Number(meta.units), String(source.getKey()), java, cache);\nresult;\n</js>"},"ruleToc":{"chapterList":"$.chapters[*]","chapterName":"$.title","chapterUrl":"$.request","updateTime":"$.offset"},"ruleContent":{"content":"<js>\nvar coords = String(chapter.tag).split(',').map(Number);\nvar id = String(book.bookUrl).split('/').pop().split('.')[0];\nvar packed = libraryText(id, coords[2], String(source.getKey()), java, cache);\npacked.slice(id.length + 1 + coords[0], id.length + 1 + coords[1]);\n</js>"},"jsLib":"function libraryText(id, units, base, net, store) {\n    var slot = base + ':txt:' + (parseInt(id.slice(0, 8), 16) % 4);\n    var prefix = id + ':';\n    var packed = store.get(slot);\n    if (packed !== null && String(packed).slice(0, prefix.length) === prefix) return String(packed);\n    var response = net.connect(base + '/books/' + id + '.txt,{\"charset\":\"UTF-16\"}');\n    if (response.code() !== 200) throw new Error('正文下载失败 HTTP ' + response.code());\n    var text = String(response.body());\n    if (text.length !== units) throw new Error('TXT 下载不完整，请重试');\n    packed = prefix + text;\n    store.put(slot, packed);\n    return packed;\n}"}]
