gntv456 6166968f4c feat(indexer): 支持 FluxTorrent 兼容层站点搜索与用户数据 (#7355)
* feat(indexer): 支持 FluxTorrent 兼容层站点搜索与用户数据

好学(hxpt.org)已由 NexusPHP 迁移到 FluxTorrent,原有页面刮削全部失效。
FluxTorrent 提供 /api/v1/compat/nexusphp/* 只读 JSON 兼容层,本提交按该契约
新增索引器与用户数据解析器,并在分发层加入能力探测,使未在站点资源中登记
专站协议的站点也能被自动识别(站点清单是闭源发布资源,主仓无法新增条目)。

- 新增 FluxTorrentSpider:调用兼容层 torrents.json 搜索,按 category_newznab
  映射媒体类型,按 promotion 换算下载与上传量系数,下载地址携带开放 API 令牌
- 新增 FluxTorrentSiteUserInfo:解析兼容层 user.json 的用户资料与流量
- 新增同步与异步能力探测:站点未登记专站协议时,用站点令牌请求一次
  user.json,响应符合 {code, message, data, request_id} 信封即判定为 FluxTorrent
- 探测要求站点已配置令牌,并用命中 24 小时、未命中 30 分钟的双层 TTL 缓存
- 不下发分类与媒体类型筛选:兼容层的 category 只接受站内分类 ID,且客户端
  过滤会破坏分页续拉契约,分类筛选待站点资源发布链路补齐后再放开

* fix(indexer): 抽出用户数据模型解析,消除复杂度增长

CI 复杂度门禁报 IndexerModule.refresh_userdata 圈复杂度 15->16(上限 15)。
把 FluxTorrent 能力探测与模型选择抽成模块级函数 _resolve_userdata_schema,
refresh_userdata 的方法体不再因新增分支而增长。

* refactor(indexer): FluxTorrent 模块文件改为单词命名

命名门禁 test_new_host_production_modules_use_single_word_filenames 要求
app 下的模块文件名满足 [a-z][a-z0-9]*,flux_torrent.py 不合规 ⇒ 两个模块
改名为 fluxtorrent.py,同步更新导入与测试打桩路径。

* test(indexer): 修正发布时间断言并同步架构依赖基线

- 发布时间断言原先写死本机时区渲染结果,在 UTC 的 CI 上必然失败 ⇒ 改为对同一
  转换函数取期望值,只验证 Unix 时间戳经由 format_timestamp 输出
- dependency-baseline.json 新增 app.modules.indexer.spider.fluxtorrent 与
  app.modules.indexer.parser.fluxtorrent 的模块与导入边(edge_count 9973→9990、
  module_count 1151→1153),结构与既有 haidan 等专站模块一致,边界未越权

* docs(architecture): 同步架构快照的模块与导入边数量

架构依赖基线新增两个索引器模块后,docs/architecture-overview.md 的
快照表需同步:Python 模块 1151→1153、内部导入边 9,973→9,990。

* test(indexer): 补齐异步探测与失败路径用例,满足新文件覆盖率门槛

新增文件的覆盖率低水位要求 80%,补齐后 spider 90.81%、parser 92.21%:
- 异步能力探测命中与请求异常两条路径
- 站点无响应、响应不是 JSON 时的降级判定
- 异步搜索缺少令牌时的直接失败
- 用户接口空响应 / 非 JSON / 结构异常 / 业务错误码的错误信息
- 站点地址缺协议与空白地址的归一

* test(indexer): 覆盖协议解析的三条分支

存量文件覆盖率低水位要求未覆盖语句数不增长,补齐协议解析的已登记协议、
探测命中、未识别三种情况(同步与异步),以及用户数据模型名的两条分支。

* refactor(indexer): 按站点资源路由 FluxTorrent 协议

删除运行时能力探测与 TTL 缓存,搜索和用户数据直接使用站点资源声明的 parser/schema;保留 FluxTorrent spider 与用户数据解析器的注册,由站点构建配置决定路由。

---------

Co-authored-by: gntv456 <gntv456@users.noreply.github.com>
Co-authored-by: jxxghp <jxxghp@gmail.com>
2026-11-11 10:27:52 +08:00
…
…
…
…
…
…

MoviePilot

简体中文 | English

GitHub Repo stars GitHub forks GitHub contributors GitHub repo size GitHub issues Docker Pulls Docker Pulls V2 Docker Pulls V3 Platform

Redesigned from parts of NAStool, with a stronger focus on core automation scenarios while reducing issues and making the project easier to extend and maintain.

For learning and personal communication only. Please do not promote this project on platforms in mainland China.

Release channel: https://t.me/moviepilot_channel

Key Features

  • Focuses on the core media automation flow: subscriptions, search, downloads, file organization, scraping, media server refresh, and notifications.
  • Uses a separated backend/frontend architecture: FastAPI for the backend and Vue 3 for the frontend.
  • Connects download clients, media servers, metadata providers, message channels, plugins, workflows, and AI Agent capabilities.
  • For feature details, screenshots, and product entry points, see https://movie-pilot.org

Installation and Usage

Docker is the recommended deployment model. V3 uses the dedicated jxxghp/moviepilot-v3 image; V2 and legacy images keep their existing names. Compose examples, environment variables, volume mappings, and upgrade notes are maintained in the official wiki:

MoviePilot can also be installed and managed from source with the local CLI:

curl -fsSL https://raw.githubusercontent.com/jxxghp/MoviePilot/v3/scripts/bootstrap-local.sh | bash

After installation, use the moviepilot command for initialization, service management, updates, and configuration. See docs/cli.md for the full command reference.

Agent

  1. MoviePilot includes a built-in AI Agent. After model configuration, it can call system tools through natural language to help with search, subscriptions, downloads, organization, diagnostics, and other management tasks.

  2. Other agents can import the repository skills/ directory to gain MoviePilot operation capabilities. Environments that support the skills CLI can use:

    npx skills add https://github.com/jxxghp/MoviePilot
    

    Built-in skills live in skills/. For custom skill authoring, see skills/create-moviepilot-skill/SKILL.md.

  3. Other MCP clients can call MoviePilot tools through /api/v1/mcp. Authentication, client configuration, and tool APIs are documented in docs/mcp-api.md.

Development

Before contributing, read the repository rules and local environment guide, keep changes focused, and validate them before opening a PR. Useful entry points:

Disclaimer

  • This software is for learning and personal communication only. It must not be used for commercial purposes or illegal activities. The software does not know how users choose to use it, and all responsibility rests with the user.
  • The source code is open source and derived from other open-source code. If someone removes the relevant restrictions and redistributes or publishes modified versions that lead to liability events, the publisher of those modifications bears full responsibility. Public releases that bypass or alter the user authentication mechanism are not recommended.
  • This project does not accept donations and has not published any donation page anywhere. The software itself is free of charge and does not provide paid services. Please verify information carefully to avoid being misled.

Contributors

Description
No description provided
Readme GPL-3.0 156 MiB
Languages
Python 99.4%
Shell 0.4%
Dockerfile 0.2%