# 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 ```