[
  {
    "bookSourceComment": "聚合书源：书旗、QQ浏览器、追书神器、得间、塔读、速读谷、七猫、爱下电子书、爱丽丝书屋、兽人控小说\n需填写密钥(token)",
    "bookSourceGroup": "析",
    "bookSourceName": "聚合书源",
    "bookSourceType": 0,
    "bookSourceUrl": "http://154.12.91.167:9947",
    "customButton": false,
    "customOrder": -1,
    "enabled": true,
    "enabledCookieJar": true,
    "enabledExplore": true,
    "eventListener": false,
    "jsLib": "function getHost() {\n  return \"http://154.12.91.167:9947\";\n}\n\nfunction Map(key) {\n    const { source } = this;\n    var infomap = source.getLoginInfoMap();\n    try {\n        return String(infomap[key]);\n    } catch (err) {\n        return \"\";\n    }\n}\n\nfunction getConfig() {\n    const { source } = this;\n    try {\n        return JSON.parse(source.getVariable());\n    } catch(e) {\n        return { source: \"QQ浏览器\", tab: \"小说\", mode: 3 };\n    }\n}",
    "lastUpdateTime": 1777793512269,
    "loginUi": "[{\"name\": \"书旗\",\"type\": \"button\",\"action\": \"setSourceTab('书旗','小说',3)\",\"style\": {\"layout_flexGrow\": 1,\"layout_flexBasisPercent\": 0.45}},{\"name\": \"QQ浏览器\",\"type\": \"button\",\"action\": \"setSourceTab('QQ浏览器','小说',3)\",\"style\": {\"layout_flexGrow\": 1,\"layout_flexBasisPercent\": 0.45}},{\"name\": \"追书神器\",\"type\": \"button\",\"action\": \"setSourceTab('追书神器','小说',3)\",\"style\": {\"layout_flexGrow\": 1,\"layout_flexBasisPercent\": 0.45}},{\"name\": \"得间\",\"type\": \"button\",\"action\": \"setSourceTab('得间','小说',3)\",\"style\": {\"layout_flexGrow\": 1,\"layout_flexBasisPercent\": 0.45}},{\"name\": \"塔读\",\"type\": \"button\",\"action\": \"setSourceTab('塔读','小说',3)\",\"style\": {\"layout_flexGrow\": 1,\"layout_flexBasisPercent\": 0.45}},{\"name\": \"速读谷\",\"type\": \"button\",\"action\": \"setSourceTab('速读谷','小说',3)\",\"style\": {\"layout_flexGrow\": 1,\"layout_flexBasisPercent\": 0.45}},{\"name\": \"七猫\",\"type\": \"button\",\"action\": \"setSourceTab('七猫','小说',3)\",\"style\": {\"layout_flexGrow\": 1,\"layout_flexBasisPercent\": 0.45}},{\"name\": \"爱下电子书\",\"type\": \"button\",\"action\": \"setSourceTab('爱下电子书','小说',3)\",\"style\": {\"layout_flexGrow\": 1,\"layout_flexBasisPercent\": 0.45}},{\"name\": \"爱丽丝书屋\",\"type\": \"button\",\"action\": \"setSourceTab('爱丽丝书屋','小说',3)\",\"style\": {\"layout_flexGrow\": 1,\"layout_flexBasisPercent\": 0.45}},{\"name\": \"兽人控小说\",\"type\": \"button\",\"action\": \"setSourceTab('兽人控小说','小说',3)\",\"style\": {\"layout_flexGrow\": 1,\"layout_flexBasisPercent\": 0.45}},{\"name\": \"密钥\",\"type\": \"password\",\"style\": {\"layout_flexGrow\": 1,\"layout_flexBasisPercent\": 1}},{\"name\": \"服务器检测\",\"type\": \"button\",\"action\": \"checkCurrentServer()\",\"style\": {\"layout_flexGrow\": 1,\"layout_flexBasisPercent\": 0.9}},{\"name\": \"讨论群1\",\"type\": \"button\",\"action\": \"joinGroup1()\",\"style\": {\"layout_flexGrow\": 1,\"layout_flexBasisPercent\": 0.45}},{\"name\": \"讨论群2\",\"type\": \"button\",\"action\": \"joinGroup2()\",\"style\": {\"layout_flexGrow\": 1,\"layout_flexBasisPercent\": 0.45}}]",
    "loginUrl": "function setSourceTab(name, tab, mode) {\n    var config = { source: name, tab: tab, mode: mode };\n    source.setVariable(JSON.stringify(config));\n    java.toast(\"当前：\" + name + (tab ? \" - \" + tab : \"\"));\n}\n\nfunction checkCurrentServer() {\n    var server = \"http://154.12.91.167:9947\";\n    java.longToast(\"正在检测服务器 \" + server + \" ...\");\n    var start = new Date().getTime();\n    try {\n        var res = java.ajax(server + \"/\");\n        var end = new Date().getTime();\n        var time = (end - start) / 1000;\n        if (time < 1) {\n            java.longToast(\"✅ 延迟低，服务器响应：\" + time.toFixed(2) + \"s\");\n        } else if (time < 2) {\n            java.longToast(\"⚠️ 延迟一般：\" + time.toFixed(2) + \"s\");\n        } else {\n            java.longToast(\"❌ 延迟过高：\" + time.toFixed(2) + \"s\");\n        }\n    } catch(e) {\n        java.longToast(\"❌ 服务器连接失败\");\n    }\n}\n\nfunction joinGroup1() {\n    java.startBrowserAwait(\"https://qm.qq.com/q/CnLl9FswzS\", \"加入讨论群1\");\n}\n\nfunction joinGroup2() {\n    java.startBrowserAwait(\"https://qm.qq.com/q/p67neFSXeg\", \"加入讨论群2\");\n}\n\nfunction login() {}",
    "respondTime": 180000,
    "ruleBookInfo": {
      "author": "$.author",
      "coverUrl": "$.cover_url",
      "init": "$.data<js>java.put('book_id', String(result.book_id)); result</js>",
      "intro": "$.abstract",
      "kind": "$.kind",
      "lastChapter": "$.last_chapter",
      "name": "$.title",
      "tocUrl": "@js:\n(function() {\n    var config = getConfig();\n    var token = Map(\"密钥\") || \"\";\n    var bookId = java.get('book_id');\n    return getHost() + '/catalog?source=' + encodeURIComponent(config.source) + '&tab=' + encodeURIComponent(config.tab) + '&token=' + encodeURIComponent(token) + '&book_id=' + bookId;\n})();",
      "wordCount": "$.word_count"
    },
    "ruleContent": {
      "content": "$.content"
    },
    "ruleExplore": {},
    "ruleSearch": {
      "author": "$.author",
      "bookList": "$.results",
      "bookUrl": "@js:\n(function() {\n    var config = getConfig();\n    var token = Map(\"密钥\") || \"\";\n    return getHost() + '/detail?source=' + encodeURIComponent(config.source) + '&tab=' + encodeURIComponent(config.tab) + '&token=' + encodeURIComponent(token) + '&book_id={{$.book_id}}';\n})();",
      "coverUrl": "$.cover_url",
      "intro": "$.abstract",
      "kind": "$.kind",
      "lastChapter": "$.last_chapter",
      "name": "$.title",
      "wordCount": "$.word_count"
    },
    "ruleToc": {
      "chapterList": "$.chapters<js>java.put('book_id', java.getString('$.book_id')); result</js>",
      "chapterName": "$.title",
      "chapterUrl": "$.item_id\n<js>\nvar config = getConfig();\nvar token = Map('密钥') || '';\nvar bookId = java.get('book_id');\nvar itemId = result;\n\n// 动态设置书籍类型（小说/漫画等），当前全为小说，保持默认 type=8\nif (config.mode == 3) book.type = 8;\n\nresult = getHost() + '/content?source=' + encodeURIComponent(config.source) + '&tab=' + encodeURIComponent(config.tab) + '&token=' + encodeURIComponent(token) + '&book_id=' + bookId + '&item_id=' + itemId;\n</js>"
    },
    "searchUrl": "@js:\n(function() {\n    var config = getConfig();\n    var token = Map(\"密钥\") || \"\";\n    return getHost() + '/search?source=' + encodeURIComponent(config.source) + '&tab=' + encodeURIComponent(config.tab) + '&token=' + encodeURIComponent(token) + '&key={{key}}&page={{page}}';\n})();",
    "weight": 0
  }
]