重构番号插件为JavBus API在线查询版,替换失效Mongo方案
变更项:
1. 完全替换 fanhao_search 主逻辑,改为参考 koishi-plugin-javbus 的在线接口查询。
2. 移除 MongoDB 依赖与本地集合查询,改为 aiohttp 调用 javbus-api。
3. 新增 /api/v1/movies/{id} 与 /api/movies/{id} 双路由回退,提升兼容性。
4. 保留原有群权限与积分扣费流程,并增强异常日志。
5. 更新配置:新增 api_prefix、auth_token、movie_detail_paths、allow_download_link、allow_preview_cover 等参数。
This commit is contained in:
@@ -3,15 +3,26 @@ enable = true
|
||||
command = ["番号", "番号查询"]
|
||||
command-format = """
|
||||
🔎番号查询指令:
|
||||
番号 番号编号 例如:番号 FNS-109
|
||||
番号 番号编号 例如:番号 SSIS-406
|
||||
"""
|
||||
|
||||
# MongoDB 连接
|
||||
mongo_uri = "mongodb+srv://readonly:cS9NSuiJ1ebHnUL0@cluster0.8mosa.mongodb.net/sehuatang?retryWrites=true&w=majority"
|
||||
db = "sehuatang"
|
||||
collections = ["hd_chinese_subtitles", "asia_codeless_originate", "asia_mosaic_originate","4k_video"]
|
||||
# JavBus API 服务地址(必填)
|
||||
# 示例:api_prefix = "http://127.0.0.1:8922"
|
||||
api_prefix = ""
|
||||
|
||||
# 尝试匹配的字段名(存在其一即可)
|
||||
search_fields = ["number"]
|
||||
# 可选鉴权 token,对应请求头 j-auth-token
|
||||
auth_token = ""
|
||||
|
||||
# 请求超时(秒)
|
||||
request_timeout_seconds = 15
|
||||
|
||||
# 详情路由模板(兼容不同 javbus-api 版本)
|
||||
movie_detail_paths = ["/api/v1/movies/{id}", "/api/movies/{id}"]
|
||||
|
||||
# 是否返回磁力(默认关闭,避免群里长文本刷屏)
|
||||
allow_download_link = false
|
||||
|
||||
# 是否发送封面预览图(默认关闭)
|
||||
allow_preview_cover = false
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user