From d11a154fc105f2905ef0d70f2f16b6202d428ba6 Mon Sep 17 00:00:00 2001 From: Codex Date: Tue, 7 Jul 2026 00:43:22 +0800 Subject: [PATCH] =?UTF-8?q?S-16=20=E9=83=A8=E7=BD=B2=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 + docs/DEPLOYMENT.md | 103 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 docs/DEPLOYMENT.md diff --git a/README.md b/README.md index 9996a14..e5acad3 100644 --- a/README.md +++ b/README.md @@ -51,3 +51,5 @@ POST /api/v1/libraries/{libraryId}/scan ```bash python -m unittest discover -s tests ``` + +详细部署步骤见 [docs/DEPLOYMENT.md](docs/DEPLOYMENT.md)。 diff --git a/docs/DEPLOYMENT.md b/docs/DEPLOYMENT.md new file mode 100644 index 0000000..fc6fdcf --- /dev/null +++ b/docs/DEPLOYMENT.md @@ -0,0 +1,103 @@ +# JMDownload 归档器部署说明 + +## 1. 安装插件 + +将仓库放到 AstrBot 的插件目录: + +```text +AstrBot/ + data/ + plugins/ + astrbot_plugin_jmdownload/ + main.py + metadata.yaml + requirements.txt +``` + +如果使用 Git: + +```bash +cd AstrBot/data/plugins +git clone http://192.168.31.210:18085/YokiiroBW/astrbot_plugin_jmdowloads.git astrbot_plugin_jmdownload +``` + +然后在 AstrBot WebUI 的插件管理中安装依赖并重载插件。依赖来自 `requirements.txt`: + +```text +jmcomic +PyYAML +Pillow +httpx +PyPDF2 +``` + +## 2. 推荐配置 + +在 AstrBot WebUI 的插件配置中设置: + +```text +archive_root: D:\KomgaLibrary\JM +archive_format: cbz +send_archive_file: false +delete_work_dir_after_archive: true +cleanup_retention_days: 7 +max_concurrent_tasks: 1 +``` + +`archive_root` 建议直接填写 Komga 某个 library 的根目录。插件会生成: + +```text +D:\KomgaLibrary\JM\ + 系列名\ + 系列名 [JMID].cbz +``` + +## 3. Komga 联动 + +在 Komga 中创建或选择一个 Library,并让它指向同一个 `archive_root`。 + +插件配置: + +```text +komga.enabled: true +komga.base_url: http://127.0.0.1:25600 +komga.library_id: +komga.api_key: +``` + +如果不用 API Key,也可以填: + +```text +komga.username +komga.password +``` + +归档完成后插件会请求: + +```text +POST /api/v1/libraries/{libraryId}/scan +``` + +## 4. 命令 + +```text +/jm download +/jm 下载 +/jm status +/jm scan +/jm cleanup +``` + +## 5. 故障排查 + +- 插件无法加载:检查 `requirements.txt` 是否安装成功。 +- 下载后没有文件:检查 `jm_domains` 是否可用,或降低 `jm_batch_count`。 +- Komga 没有识别:确认 `archive_root` 是 Komga library 根目录,并手动执行 `/jm scan`。 +- 文件发送失败:不同平台对文件消息支持不同;归档仍会保存在 `archive_root`。 +- PDF 转换失败:确认 `PyPDF2` 已安装,或改用默认 `cbz`。 + +## 6. 本地测试 + +```bash +python -m unittest discover -s tests +```