MCPcopy Index your code
hub / github.com/123panNextGen/123pan

github.com/123panNextGen/123pan @v3.1.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v3.1.2 ↗ · + Follow
384 symbols 1,302 edges 43 files 153 documented · 40%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

🚀 123pan

突破限制 · 高效下载 · 简单易用

<a href="https://github.com/123pannextgen/123pan/stargazers"><img src="https://img.shields.io/github/stars/123pannextgen/123pan" alt="Stars"></a>
<a href="https://github.com/123pannextgen/123pan/issues"><img src="https://img.shields.io/github/issues/123pannextgen/123pan" alt="Issues"></a>
<a href="https://github.com/123pannextgen/123pan/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-green" alt="License"></a>
<a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.12%2B-blue" alt="Python Version"></a>
<a href="https://github.com/123pannextgen/123pan/releases"><img src="https://img.shields.io/github/v/tag/123pannextgen/123pan?label=release" alt="latest_release"></a>
<a href="https://github.com/123pannextgen/123pan/releases"><img src="https://img.shields.io/github/downloads/123pannextgen/123pan/total" alt="Downloads"></a>

Screenshot

介绍

123pan是一款基于Python开发的高效下载辅助工具,通过模拟安卓客户端协议,帮助用户绕过123云盘的自用下载流量限制,实现无阻碍下载体验。

使用

使用打包后的文件运行

如果你的电脑是Windows系统或者Linux发行版,可以直接下载并解压,然后运行其中的123pan.exe123pan
下载地址:

  • Github: https://github.com/123panNextGen/123pan/releases/
  • Website(CloudFlare CDN, 更新可能不及时): https://download.123panng.top/

[!TIP] Windows下如果无法运行,可以尝试打开兼容模式。杀毒软件有可能报毒,请放行。

[!IMPORTANT] 请不要从未知渠道下载!

其他系统以及开发请参考下方的源码运行。

使用源码运行

首先准备好 Python3uv 环境,并克隆存储库。

git clone https://github.com/123panNextGen/123pan.git
cd 123pan/

准备Python虚拟环境。

uv sync
uv sync --group build --group lint # 构建环境

然后运行src下的123pan.py即可。

uv run src/123pan.py

技术说明

默认会在系统C:\Users\%USERNAME%\AppData\Roaming\123pan~/.config/123pan创建配置文件和日志。

密码使用 AES-256-GCM 加密存储,密钥基于机器标识派生,存储于 ~/.config/123pan/.keyfile(权限 600)。

{
  "currentAccount": "账号",
  "accounts": {
    "账号": {
      "userName": "账号",
      "passWord": "密码",
      "authorization": "令牌",
      "deviceType": "模拟设备类型",
      "osVersion": "模拟设备系统",
      "loginuuid": "登陆id"
    }
  },
  "settings": {
    "defaultDownloadPath": "默认下载位置",
    "askDownloadLocation": true,
    "multiThreadDownload": true,
    "downloadSpeedLimit": 0,
    "uploadSpeedLimit": 0,
    "proxyEnabled": false,
    "proxyType": "http",
    "proxyHost": "",
    "proxyPort": 0,
    "proxyUsername": "",
    "proxyPassword": ""
  }
}

设置项说明

设置项 类型 默认值 说明
defaultDownloadPath string ~/Downloads 默认下载目录
askDownloadLocation bool true 每次下载前是否询问保存位置
multiThreadDownload bool true 是否启用多线程分片下载
downloadSpeedLimit int 0 下载速度限制(KB/s),0 表示不限制
uploadSpeedLimit int 0 上传速度限制(KB/s),0 表示不限制
proxyEnabled bool false 是否启用网络代理
proxyType string "http" 代理类型:"http""socks5"
proxyHost string "" 代理服务器地址
proxyPort int 0 代理服务器端口
proxyUsername string "" 代理认证用户名(可选)
proxyPassword string "" 代理认证密码(可选)

测试

项目包含 61 个测试用例,覆盖核心逻辑层。

运行测试

# 运行全部测试
uv run pytest

# 运行特定文件
uv run pytest tests/unit/test_speed_limiter.py

# 带覆盖率报告
uv run pytest --cov

# 详细输出
uv run pytest -v

测试结构

tests/
  unit/                    # 纯逻辑测试,无外部依赖
    test_speed_limiter.py  # 令牌桶限速算法(mock time.monotonic)
    test_credential.py     # AES-256-GCM 加解密(临时 keyfile 隔离)
    test_model.py          # 数据模型解析/序列化
    test_api_utils.py      # format_file_size 等工具函数
    test_config.py         # 配置读写、旧格式迁移(临时目录隔离)
  integration/             # 依赖 mock 外部服务
    test_session.py        # NetSession HTTP 方法(responses mock)

测试策略

层级 方式 说明
纯函数 直接断言返回值 SpeedLimiterformat_file_size
文件系统 tmp_path fixture 不碰 ~/.config/123pan
加密 模块级 _KEY_FILE 覆盖 测试用临时 .keyfile
HTTP responses 拦截 requests 不发起真实网络请求

问题反馈

你可以通过多种途径反馈问题。

  • Github: https://github.com/123panNextGen/123pan/issues
  • QQ群: 996241397

我们将在第一时间解决。

社区讨论:

你可以在社区讨论相关问题

  • Github:https://github.com/123panNextGen/123pan/discussions
  • QQ群:群号同上

使用协议

本程序使用Apache 2.0协议。

免责声明

本项目为个人学习与技术研究目的开发,与 123 云盘官方无任何关联。使用本软件即表示您已知晓并同意以下内容:

  • 本软件按「现状」提供,不提供任何明示或暗示的保证
  • 开发者不对因使用本软件导致的任何直接或间接损失承担责任,包括但不限于数据丢失、账号封禁、服务中断等
  • 使用者应自行承担使用本软件的全部风险,并遵守 123 云盘用户协议及相关法律法规
  • 请勿将本软件用于商业用途

其他版本推荐

[!IMPORTANT] 以下项目与123panNextGen团队没有任何关系,为社区的技术爱好者基于我们的项目进一步创作的。

  • https://github.com/crmmc/123pan-open

Star History Chart

本程序由123panNextGen开发团队用♥️制作~
我们由衷感谢为本程序贡献代码的人们。 贡献人员名单

Core symbols most depended-on inside this repo

get_setting
called by 35
src/app/common/config.py
format_file_size
called by 16
src/app/common/api.py
get_logger
called by 15
src/app/common/log.py
setText
called by 14
src/app/view/setting_interface.py
text
called by 12
src/app/view/setting_interface.py
load_config
called by 12
src/app/common/config.py
set_setting
called by 12
src/app/common/config.py
_parse_timestamp
called by 9
src/app/api/model.py

Shape

Method 313
Class 52
Function 19

Languages

Python100%

Modules by API surface

src/app/view/file_interface.py47 symbols
src/app/common/api.py43 symbols
src/app/view/transfer_interface.py34 symbols
src/app/view/setting_interface.py33 symbols
src/app/api/session.py31 symbols
tests/integration/test_session.py23 symbols
tests/unit/test_model.py15 symbols
src/app/tasks/file_tasks.py15 symbols
src/app/service/file_service.py14 symbols
src/app/api/model.py14 symbols
tests/unit/test_speed_limiter.py12 symbols
src/app/common/config.py12 symbols

For agents

$ claude mcp add 123pan \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact