Aqr-K
0fb11880a4
perf(http): AsyncRequestUtils 默认启用 HTTP/2
...
为 AsyncRequestUtils 增加 http2: bool = True 参数(默认开启),
内部贯穿到 _get_shared_async_transport 与 path C 兜底 AsyncClient。
http2 加入共享 AsyncHTTPTransport 桶 key,让不同 h2 设置自动隔离。
启用基于 TLS ALPN:服务端宣告支持 h2 时切到 HTTP/2 多路复用;
不支持(含明文 HTTP、老 nginx/Apache)透明回落 HTTP/1.1。如个别
站点 h2 实现异常,调用方传 http2=False 单独关闭。
依赖:httpx extras 由 [socks] 扩展为 [socks,http2],引入纯 Python
包 h2 / hpack / hyperframe(无原生扩展)。
真实 TMDB 压测(30 部美剧 × 每部 50 集 = 3060 请求/版本):
HTTP/1.1 52.0s → HTTP/2 27.6s,节省 24.4s(1.88×)。
单请求 p95 由 96.1ms 降至 20.1ms,长尾大幅收敛。
公共 API 表面零变动;插件可按需 http2=False 单点关闭。
2026-05-11 17:15:23 +08:00
jxxghp
1b2433f7c2
feat: implement runtime dependency checks and recovery for plugin installations
2026-05-11 08:54:34 +08:00
Aqr-K
c745616495
perf(http): 异步 HTTP 引入共享 AsyncHTTPTransport,复用 TCP/TLS 握手
...
AsyncRequestUtils 使用按事件循环弱引用持有的共享
AsyncHTTPTransport 作为底层连接池与 TLS 会话;每次请求创建轻量
AsyncClient 承载本次 cookie jar、timeout、follow_redirects,
用完即销毁。共享 transport 由 _NonClosingTransportProxy 包装后
注入 AsyncClient,吞掉 AsyncClient 退出时向底层 transport
传播的 __aexit__/aclose,使底层连接池跨调用持久,从而真正复用
TCP/TLS 握手。
设计要点:
- 共享 transport 桶按 (proxy, verify, max_keepalive_connections,
max_connections, keepalive_expiry) 区分;每事件循环 32 桶 LRU
上限,超出后异步关闭最久未用桶;关闭 task 由模块级强引用集合
持有以兼容 Python 3.11+ 的任务 GC 行为。
- 通过 FastAPI lifespan shutdown 调用 aclose_shared_async_transports
集中释放底层 transport,避免 ResourceWarning。
- AsyncRequestUtils.request 走三条 path:用户自管 client / 共享
transport + per-call AsyncClient / 兜底临时 client。三条路径
cookie 语义一致;后两条因 per-call AsyncClient 生命周期局限于
单次调用,天然不积累 Set-Cookie,避免跨调用 jar 演化串扰。
- _make_request 对幂等方法(GET/HEAD/OPTIONS)在
RemoteProtocolError / ReadError / WriteError 时单次重试,
容忍 keep-alive stale 连接命中;非幂等方法不重试,但记录
debug 日志。
- get_stream 使用 httpx.AsyncClient.stream() 标准流式 API,与
request 共用三条 path 的 client 选择逻辑;幂等单次重试;
yield 体异常透传给 stream 的 __aexit__。
公共 API 表面零变动。插件可通过 max_keepalive_connections /
max_connections / keepalive_expiry 三个 limits 参数为自己定制
连接池容量与握手有效期。
TMDB 真实压测(10 部美剧 × 每部 50 集,1020 请求):
61.96s → 18.15s(3.41×),单请求 p95 149.6ms → 38.1ms。
2026-05-11 08:46:40 +08:00
jxxghp
4b27b7bc42
重构 UgreenCrypto 模块路径至 app.modules.ugreen 并更新相关引用
2026-04-29 16:29:17 +08:00
jxxghp
ae15eac0f8
feat: normalize internal system user ID in notification dispatch
...
- Add SYSTEM_INTERNAL_USER_ID constant and helpers to app.utils.identity
- Ensure internal user ID is normalized to None before dispatching notifications, preventing misrouting to external channels
- Refactor MessageChain to use normalization for all message dispatch methods
- Add tests for internal user ID normalization and notification dispatch behavior
2026-04-21 14:32:14 +08:00
jxxghp
1282ad5004
feat: improve local CLI startup management
2026-04-21 11:26:56 +08:00
jxxghp
4c32ad902b
Harden system nettest SSRF handling
2026-04-18 17:43:38 +08:00
InfinityPacer
815d83bfb3
fix(http): close helper responses consistently
2026-04-10 18:21:30 +08:00
InfinityPacer
217fcfd1b2
fix(http): close non-success responses safely
2026-04-10 18:21:30 +08:00
DDSRem
c9149d1761
fix(system): 补充 fuse 挂载关键词
...
fix https://github.com/jxxghp/MoviePilot/issues/5624
2026-04-02 08:53:28 +08:00
DDSRem
bd68bcfd27
fix: await async config reload handlers
...
Restore awaiting of async on_config_changed callbacks in ConfigReloadMixin to ensure config reload logic executes correctly.
Made-with: Cursor
2026-03-24 20:44:26 +08:00
DDSRem
517300afe9
fix: clean typing issues and refresh runtime dependencies
...
Align endpoint/module type hints and config reload handling while updating base Python image and package pins to improve build/runtime compatibility.
Made-with: Cursor
2026-03-24 19:21:04 +08:00
jxxghp
78b8b30351
rollback aiopathlib
2026-03-24 09:06:44 +08:00
jxxghp
e82494c444
feat(agent): support skills
2026-03-24 08:48:27 +08:00
PKC278
226432ec7f
feat(mcp): add torrent filter workflow and moviepilot cli skill
2026-03-17 17:22:33 +08:00
copilot-swe-agent[bot]
a9f2b40529
test: extend media-title detection coverage and cleanup
...
Co-authored-by: jxxghp <51039935+jxxghp@users.noreply.github.com >
2026-03-03 12:20:54 +00:00
copilot-swe-agent[bot]
86000ea19a
feat: improve user message media-title detection
...
Co-authored-by: jxxghp <51039935+jxxghp@users.noreply.github.com >
2026-03-03 12:14:25 +00:00
doumao
296261da8a
feat: 完成绿联影视接入并补齐扫描模式与统计展示
2026-02-28 21:58:35 +08:00
doumao
344993dd6f
新增绿联接口加解密工具与单元测试
2026-02-28 15:35:27 +08:00
copilot-swe-agent[bot]
d61d16ccc4
Restore the optimization - accidentally reverted in previous commit
...
Co-authored-by: jxxghp <51039935+jxxghp@users.noreply.github.com >
2026-02-06 14:15:29 +00:00
copilot-swe-agent[bot]
f2a5715b24
Co-authored-by: jxxghp <51039935+jxxghp@users.noreply.github.com>
2026-02-06 14:11:15 +00:00
copilot-swe-agent[bot]
c064c3781f
Optimize SystemUtils.move to avoid triggering directory monitoring
...
Co-authored-by: jxxghp <51039935+jxxghp@users.noreply.github.com >
2026-02-06 14:03:03 +00:00
DDSRem
a1829fe590
feat: u115 global rate limiting strategy
2026-02-04 23:24:14 +08:00
hyuan280
f89d6342d1
fix: 修复Cookie解码二进制数据导致请求发送时UnicodeEncodeError
2026-01-21 16:36:28 +08:00
PKC278
95f2ac3811
feat(search): 添加AI推荐功能并优化相关逻辑
2026-01-15 02:49:29 +08:00
winter0245
5fe5deb9df
Merge branch 'jxxghp:v2' into v2
2026-01-13 09:30:16 +08:00
xjy
ce83bc24bd
fix: 修复站点Cookie处理的两个关键问题
...
本次提交修复了PT站点搜索功能失败的两个根本原因:
1. **Cookie URL解码问题**
- 问题:数据库中存储的Cookie值包含URL编码(如%3D、%2B、%2F),
但cookie_parse()函数未进行解码
- 影响:所有使用URL编码Cookie的站点可能无法正常登录
- 修复:在app/utils/http.py的cookie_parse()中添加unquote()解码
2. **httpx Cookie jar覆盖问题**(关键)
- 问题:httpx.AsyncClient的Cookie jar机制会自动保存服务器返回的
Set-Cookie,并在后续请求中覆盖我们传入的Cookie
- 表现:传入正确的c_secure_uid/c_secure_pass,实际发送的却是
PHPSESSID等错误Cookie
- 修复:在创建AsyncClient时传入Cookie,而不是在request()时传入
修改文件:
- app/utils/http.py: cookie_parse()添加URL解码 + AsyncClient传入cookies
- app/modules/indexer/spider/__init__.py: 清理调试代码
测试验证:
- ✅ pterclub 搜索功能恢复正常
- ✅ 春天站点搜索功能正常(验证通用性)
2026-01-13 09:29:05 +08:00
景大侠
4af5dad9a8
修复 原盘自动刮削缺少nfo
2026-01-12 21:36:17 +08:00
Attente
ca5ec8af0f
feat(config): 优化配置变更事件处理机制
2025-11-27 23:17:34 +08:00
DDSRem
0dc0d66549
fix: known issue
2025-11-19 19:46:46 +08:00
DDSRem
f589fcc2d0
feat(u115): improve stability of the u115 module
...
1. 优化API请求错误时到处理逻辑
2. 提升hash计算速度
3. 接口级QPS速率限制
4. 使用httpx替换request
5. 优化路径拼接稳定性
6. 代码格式化
2025-11-19 19:39:02 +08:00
wumode
9d182e53b2
fix: type hints
2025-11-05 15:41:31 +08:00
wumode
ff2826a448
feat(utils): Refactor check_method to use ast
...
- 使用 AST 解析函数源码,相比基于字符串的方法更稳定,能够正确处理具有多行 def 语句的函数
- 为 check_method 添加了单元测试
2025-11-05 14:16:37 +08:00
jxxghp
17a1bd352b
Merge pull request #5071 from wikrin/optimize-file-size
2025-10-23 22:54:43 +08:00
Attente
7421ca09cc
fix(transfer): 修复部分情况下无法正确统计已完成任务总大小的问题
...
- get_directory_size 使用 os.scandir 递归遍历提升性能
- 当任务文件项存储类型为 local 时,若其大小为空,则通过 SystemUtils 获取目录大小以确保
完成任务的准确统计。
fix(cache): 修改 fresh 和 async_fresh 默认参数为 True
refactor(filemanager): 移除整理后总大小计算逻辑
- 删除 TransHandler 中对整理目录总大小的冗余计算,提升性能并简化流程。
perf(system): 使用 scandir 优化文件扫描性能
- 重构 SystemUtils 中的文件扫描方法(list_files、exists_file、list_sub_files),
- 采用 os.scandir 替代 glob 实现,并预编译正则表达式以提升目录遍历与文件匹配性能。
2025-10-23 19:21:24 +08:00
wumode
3873786b99
fix: retry
2025-10-23 00:58:34 +08:00
Aqr-K
0ea9770bc3
Create debounce.py
2025-09-22 02:38:15 +08:00
jxxghp
481f1f9d30
add full gc scheduler
2025-09-08 10:49:09 +08:00
jxxghp
89b0ea0bf1
remove monitoring
2025-09-04 11:23:22 +08:00
Aqr-K
f22bc68af4
Update string.py
2025-08-30 08:59:35 +08:00
Aqr-K
d21f1f1b87
feat(string): add natural_sort_key function
2025-08-30 08:44:41 +08:00
jxxghp
1b7bdbf516
fix #4834
2025-08-27 08:28:16 +08:00
jxxghp
91a124ab8f
fix 异步定时服务
2025-08-25 20:44:38 +08:00
jxxghp
343109836f
fix cache
2025-08-23 14:06:44 +08:00
jxxghp
724c15a68c
add 插件内存统计API
2025-08-22 09:46:11 +08:00
jxxghp
1ab2da74b9
use apipathlib
2025-08-17 09:00:02 +08:00
jxxghp
90f74d8d2b
feat:支持FlareSolverr
2025-08-11 21:14:46 +08:00
jxxghp
1dd3af44b5
add FastApi实时性能监控
2025-08-01 17:47:55 +08:00
jxxghp
45bcc63c06
fix rate_limit async
2025-08-01 11:48:37 +08:00
jxxghp
6873de7243
fix async
2025-07-31 13:32:47 +08:00