Skip to content

Commit a1ffafb

Browse files
committed
fix: explicitly disable proxy when use_proxy=false (#43)
1 parent 3df091b commit a1ffafb

5 files changed

Lines changed: 26 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
所有版本更新记录。
44

5+
## **v2.6.2** (2026-01-04)
6+
7+
### Bug 修复
8+
- **Docker 环境代理问题** (Issue #43)
9+
- 修复在 Docker 环境下即使未配置代理也会尝试连接 `127.0.0.1:7890` 的问题
10+
- 原因:`jmcomic` 库默认使用系统代理,插件未显式禁用
11+
- 修复:当 `use_proxy=false` 时,显式设置空代理覆盖 jmcomic 默认行为
12+
13+
### 说明
14+
- 关于依赖缺失问题:请确保 AstrBot Docker 中已安装 `jmcomic`
15+
- 可手动执行:`docker exec -it astrbot pip install jmcomic`
16+
17+
---
18+
519
## **v2.6.1** (2025-12-31)
620

721
### 新增功能

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<br>
1212
<div align="center">
13-
<a href="CHANGELOG.md"><img src="https://img.shields.io/badge/VERSION-v2.6.1-E91E63?style=for-the-badge" alt="Version"></a>
13+
<a href="CHANGELOG.md"><img src="https://img.shields.io/badge/VERSION-v2.6.2-E91E63?style=for-the-badge" alt="Version"></a>
1414
<a href="https://github.com/GEMILUXVII/astrbot_plugin_jm_cosmos/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-AGPL--3.0-009688?style=for-the-badge" alt="License"></a>
1515
<a href="https://www.python.org/"><img src="https://img.shields.io/badge/PYTHON-3.10+-3776AB?style=for-the-badge&logo=python&logoColor=white" alt="Python"></a>
1616
<a href="https://github.com/AstrBotDevs/AstrBot"><img src="https://img.shields.io/badge/AstrBot-Compatible-00BFA5?style=for-the-badge&logo=robot&logoColor=white" alt="AstrBot Compatible"></a>
@@ -19,7 +19,7 @@
1919
<div align="center">
2020
<a href="https://pypi.org/project/jmcomic/"><img src="https://img.shields.io/badge/JMCOMIC-≥2.5.0-9C27B0?style=for-the-badge" alt="JMComic"></a>
2121
<a href="https://github.com/botuniverse/onebot-11"><img src="https://img.shields.io/badge/OneBotv11-AIOCQHTTP-FF5722?style=for-the-badge&logo=qq&logoColor=white" alt="OneBot v11 Support"></a>
22-
<a href="https://github.com/GEMILUXVII/astrbot_plugin_jm_cosmos"><img src="https://img.shields.io/badge/UPDATED-2025.12.31-2196F3?style=for-the-badge" alt="Updated"></a>
22+
<a href="https://github.com/GEMILUXVII/astrbot_plugin_jm_cosmos"><img src="https://img.shields.io/badge/UPDATED-2026.01.04-2196F3?style=for-the-badge" alt="Updated"></a>
2323
</div>
2424

2525
## 介绍
@@ -375,7 +375,7 @@ proxy_url: http://127.0.0.1:7890
375375

376376
查看完整更新日志:[CHANGELOG.md](./CHANGELOG.md)
377377

378-
**当前版本:v2.6.1** - 搜索翻页功能,优化搜索结果显示
378+
**当前版本:v2.6.2** - 修复 Docker 环境代理问题 (Issue #43)
379379

380380
## 注意事项
381381

@@ -424,7 +424,7 @@ docs: 更新 README 安装说明
424424

425425
[![](https://www.gnu.org/graphics/agplv3-155x51.png "AGPL v3 logo")](https://www.gnu.org/licenses/agpl-3.0.txt)
426426

427-
Copyright (C) 2025 GEMILUXVII
427+
Copyright (C) 2025-2026 GEMILUXVII
428428

429429
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.
430430

core/base/config.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,16 @@ def create_jm_option(self) -> JmOption | None:
188188
}
189189

190190
# 添加代理配置
191+
# 修复 #43: Docker 环境下需要显式禁用代理,否则 jmcomic 会使用默认的系统代理
191192
if self.use_proxy and self.proxy_url:
192193
option_dict["client"]["postman"] = {
193194
"meta_data": {"proxies": self.proxy_url}
194195
}
196+
else:
197+
# 显式禁用代理,覆盖 jmcomic 的默认系统代理设置
198+
option_dict["client"]["postman"] = {
199+
"meta_data": {"proxies": {}}
200+
}
195201

196202
# 使用字典构建 JmOption
197203
self._option = JmModuleConfig.option_class().construct(option_dict)

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"jm_cosmos2",
2424
"GEMILUXVII",
2525
"JM漫画下载插件 - 支持搜索、下载禁漫天堂的漫画本子,支持加密PDF/ZIP打包",
26-
"2.6.1",
26+
"2.6.2",
2727
"https://github.com/GEMILUXVII/astrbot_plugin_jm_cosmos",
2828
)
2929
class JMCosmosPlugin(Star):

metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: JM-Cosmos II
22
desc: JM漫画下载插件 - 支持搜索、下载禁漫天堂的漫画本子,基于jmcomic库,支持加密PDF/ZIP打包
3-
version: v2.6.1
3+
version: v2.6.2
44
author: GEMILUXVII
55
repo: https://github.com/GEMILUXVII/astrbot_plugin_jm_cosmos

0 commit comments

Comments
 (0)