115 Netdisk logo

115 Netdisk

Community
chongchong59699
115-netdisk

115 网盘集成,支持 115扫码登录/115扫码登陆、二维码图片交互获取 cookies、cookies 保存与验证、目录浏览、文件搜索、离线下载任务添加和任务查询。使用 p115client SDK,基于 cookies 认证。Use when the user asks about 115网盘, 115云盘, 115扫码登录, 115扫码登陆, 115离线下载, p115client, 115 pan, or 115 netdisk operations.

Overview

Publisherchongchong59699
Repository115-netdisk-skill
Skill name115-netdisk
Stars
30
Forks
2
Bundled files
12
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 12 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by chongchong59699 on GitHub. Read the source before you install it.

Installation

Install the 115 Netdisk AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/chongchong59699/115-netdisk-skill/tree/master
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/chongchong59699/115-netdisk-skill.git \
  .claude/skills/115-netdisk
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable 115 Netdisk in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads 115 Netdisk on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so 115 Netdisk is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

115 网盘集成

安装本 Skill

当用户给出本仓库的 SKILL.md 或 install.py 远程 URL 并要求安装时,必须安装完整 skill 文件集,而不是只保存这个 SKILL.md 文件,因为脚本都在 scripts/ 中。本仓库采用“仓库根目录即 skill 根目录”的结构,关键文件包括 SKILL.md、scripts/、agents/ 和 requirements.txt。

Agent 兼容约定

本 skill 需要兼容 Codex、OpenClaw、Hermes 和普通 CLI 类 agent。扫码登录脚本不会假设某个平台一定能渲染 Markdown 图片,而是同时输出多种稳定标记:

  • LOGIN_QR_JSON:紧凑 JSON,包含 image_path、image_uri、remote_url、markdown。
  • QR_IMAGE_PATH:二维码 PNG 本地路径,适合能上传/展示本地图片的 agent。
  • QR_FILE_URI:file:// URI,适合能打开本地文件 URI 的 agent。
  • QR_REMOTE_URL:115 二维码远程图片 URL,适合纯 CLI 或无法读取本地图片的 agent。
  • QR_MARKDOWN:Markdown 图片语法,适合聊天界面支持本地图片渲染的 agent。

所有 agent 在运行 scripts/login.py --no-open 或 release 二进制后,应监听 stdout;一旦看到 AGENT_ACTION_REQUIRED、LOGIN_QR_JSON 或上述任意二维码标记,就立即用自己支持的方式展示、打开或转述给用户,并保持进程继续运行等待用户扫码确认。单纯在 shell 输出里打印 QR_MARKDOWN 不等于已经把图片展示给用户。

对 Codex 这类通过工具执行命令的 agent,扫码登录属于长轮询任务,不能一直阻塞等待命令结束后才回复用户。应使用短暂等待启动命令(例如 yield_time_ms: 1000),读取首批 stdout;如果看到二维码标记,立刻在普通聊天消息中发送本地图片 Markdown(Codex 桌面端必须使用绝对路径),例如 ![115 登录二维码](C:\...\115-login-qrcode-xxx.png),然后再继续轮询后台进程直到登录成功或失败。如果首批输出还没有二维码标记,应继续读取进程输出,直到拿到二维码再展示。--timeout 0 只表示脚本不主动超时,115 的二维码 key 仍可能过期;通常保留默认超时即可。

推荐安装方式:必须使用 curl 获取仓库根目录的 install.py,让安装器下载 GitHub zip 包并复制完整 skill,不要只保存 SKILL.md。安装器自身只依赖 Python 标准库,不依赖 git,Windows / macOS / Linux 都可用;安装完成后会在目标用户的 skill 目录内创建私有 .venv 并安装固定依赖。如果目标用户环境没有 Python 3.12,安装器会尝试先安装/使用 uv 拉起 Python 3.12 环境,不要求用户手工安装到系统 Python。

bash
curl -fsSL https://raw.githubusercontent.com/chongchong59699/115-netdisk-skill/master/install.py | python - --repo chongchong59699/115-netdisk-skill --branch master

Windows 如果 python 命令不可用,优先尝试:

powershell
curl.exe -fsSL https://raw.githubusercontent.com/chongchong59699/115-netdisk-skill/master/install.py | py - --repo chongchong59699/115-netdisk-skill --branch master

如果用户只想复制 skill 文件、跳过依赖安装,可给安装器追加 --no-deps。除非用户明确要求,否则不要加这个参数,因为会导致扫码后无法立即浏览网盘或读取账户信息。

如果用户只提供了 GitHub 上的 SKILL.md URL,也可以把 URL 传给安装器,安装器会反推出仓库和分支:

bash
curl -fsSL https://raw.githubusercontent.com/chongchong59699/115-netdisk-skill/master/install.py | python - --skill-url https://raw.githubusercontent.com/chongchong59699/115-netdisk-skill/master/SKILL.md

如果用户提供的是 curl -fsSL https://.../SKILL.md 这类自定义域名,先读取该 SKILL.md 正文;若正文没有给出 GitHub 仓库或安装器 URL,先询问仓库地址。

安装流程:

  1. 优先使用上面的 install.py 一行安装。
  2. 如果只能手工安装,从用户提供的 URL 推导 GitHub 仓库地址。常见格式:
    • https://raw.githubusercontent.com/<chongchong59699>/<REPO>/<BRANCH>/SKILL.md
    • https://github.com/<chongchong59699>/<REPO>/blob/<BRANCH>/SKILL.md
    • 兼容旧结构:https://raw.githubusercontent.com/<chongchong59699>/<REPO>/<BRANCH>/115-netdisk/SKILL.md
    • 如果仓库 URL 无法从用户请求或 SKILL.md URL 推导出来,先向用户询问仓库地址,不要只安装单个 SKILL.md 文件。
  3. 将仓库根目录中的 skill 文件集复制到 Codex skills 目录:
    • 优先使用 $CODEX_HOME/skills
    • 未设置时使用 ~/.codex/skills
    • 最终目录应为 ~/.codex/skills/115-netdisk/SKILL.md
  4. 安装器会自动创建 115-netdisk/.venv 并安装固定版本的 requirements.txt;优先使用 Python 3.12,没有时尝试通过 uv 自举 Python 3.12。业务脚本会自动切换到这个私有 .venv,agent 不需要记住解释器路径。
  5. 安装后枚举运行 python -m py_compile scripts/*.py 验证 Python 脚本语法;仅在 Windows/PowerShell 可用时检查 scripts/get_cookie.ps1。如果依赖安装失败,必须在安装阶段明确告知用户,而不是等扫码后才说缺少 p115client。

PowerShell 7 示例,替换 chongchong59699、REPO、BRANCH 后执行:

powershell
$owner = "chongchong59699"
$repo = "REPO"
$branch = "master"
$targetRoot = if ($env:CODEX_HOME) { Join-Path $env:CODEX_HOME "skills" } else { Join-Path $HOME ".codex\skills" }
$tmp = Join-Path ([System.IO.Path]::GetTempPath()) "115-netdisk-skill-$([guid]::NewGuid())"
git clone --depth 1 --branch $branch "https://github.com/$owner/$repo.git" $tmp
New-Item -ItemType Directory -Force -Path $targetRoot | Out-Null
$targetSkill = Join-Path $targetRoot "115-netdisk"
if (Test-Path -LiteralPath $targetSkill) { Remove-Item -LiteralPath $targetSkill -Recurse -Force }
New-Item -ItemType Directory -Force -Path $targetSkill | Out-Null
Copy-Item -LiteralPath (Join-Path $tmp "SKILL.md") -Destination $targetSkill -Force
Copy-Item -LiteralPath (Join-Path $tmp "requirements.txt") -Destination $targetSkill -Force
Copy-Item -LiteralPath (Join-Path $tmp "agents") -Destination $targetSkill -Recurse -Force
Copy-Item -LiteralPath (Join-Path $tmp "scripts") -Destination $targetSkill -Recurse -Force
Remove-Item -LiteralPath $tmp -Recurse -Force

POSIX shell 示例,替换 chongchong59699、REPO、BRANCH 后执行:

bash
owner="chongchong59699"
repo="REPO"
branch="master"
target_root="${CODEX_HOME:-$HOME/.codex}/skills"
tmp="$(mktemp -d)"
git clone --depth 1 --branch "$branch" "https://github.com/$owner/$repo.git" "$tmp"
mkdir -p "$target_root"
rm -rf "$target_root/115-netdisk"
mkdir -p "$target_root/115-netdisk"
cp "$tmp/SKILL.md" "$tmp/requirements.txt" "$target_root/115-netdisk/"
cp -R "$tmp/agents" "$tmp/scripts" "$target_root/115-netdisk/"
rm -rf "$tmp"

快速开始

默认 cookies 路径为 ~/.115-cookies。当目录浏览、搜索、离线下载等脚本发现该文件不存在或内容为空时,会自动提醒用户扫码登录、生成 115 登录二维码 PNG、等待用户用 115 App 扫码确认,并把 cookies 保存到 ~/.115-cookies。

agent 看到脚本输出 LOGIN_QR_JSON: ...、QR_IMAGE_PATH: ...、QR_FILE_URI: ...、QR_REMOTE_URL: ... 或 QR_MARKDOWN: ... 后,应立即把二维码图片发给用户;Codex、OpenClaw、Hermes 或 CLI agent 都不应假设 shell 输出中的 Markdown 会自动弹图,必须由 agent 在普通回复中展示、打开或转述图片目标。如果图片发送失败,提醒用户打开该本地路径或远程 URL 扫码。扫码登录成功后,脚本会默认输出用户基本信息和本 skill 支持的功能点。

第一步:获取 Cookies

用户提供的 cookies 格式(4 个字段缺一不可):

UID=xxx; CID=xxx; SEID=xxx; KID=xxx

跨平台默认方案:使用纯 Python 标准库登录脚本。agent 应优先运行这个命令,因为它在 Windows / macOS / Linux 上都可用,不依赖 PowerShell,也不依赖 p115client:

bash
python scripts/login.py --no-open

如果当前系统只有 python3 或 Windows py launcher,则改用:

bash
python3 scripts/login.py --no-open
py -3 scripts/login.py --no-open

脚本会把二维码保存为本地 PNG、输出 AGENT_ACTION_REQUIRED、LOGIN_QR_JSON、QR_IMAGE_PATH、QR_FILE_URI、QR_REMOTE_URL 和 QR_MARKDOWN,并继续轮询扫码状态。agent 应把二维码图片发给用户;如果图片没有成功显示,必须提醒用户打开脚本输出的二维码文件路径或远程 URL 自行扫码。用户用 115 App 扫码并确认后,脚本会自动获取 cookies 并默认保存到 ~/.115-cookies。状态接口偶发 read timeout 时脚本会继续等待,不会立即退出。

可选参数:

bash
# 指定二维码图片保存位置
python scripts/login.py --qr-path /tmp/115-login-qrcode.png --no-open

# 指定 cookies 保存位置
python scripts/login.py --cookie-path ~/.115-cookies --no-open

# 指定 app 类型,默认 tv
python scripts/login.py --app web --no-open

免 Python 方案:使用 GitHub Releases 中的 115-cookie-helper-* 独立二进制。它是跨平台的,但需要下载与当前系统/架构匹配的文件。

macOS:

bash
# Apple Silicon
chmod +x ./115-cookie-helper-darwin-arm64
./115-cookie-helper-darwin-arm64

# Intel Mac
chmod +x ./115-cookie-helper-darwin-amd64
./115-cookie-helper-darwin-amd64

如果 macOS 提示无法验证开发者,先在“系统设置 → 隐私与安全性”中允许运行,或执行:

bash
xattr -d com.apple.quarantine ./115-cookie-helper-darwin-arm64

Windows:

powershell
.\115-cookie-helper-windows-amd64.exe

Linux:

bash
chmod +x ./115-cookie-helper-linux-amd64
./115-cookie-helper-linux-amd64

Windows 备用方案:如果用户没有合适的 Python 或 release 二进制,可用 PowerShell 脚本获取并保存 cookies。不要在 macOS/Linux 上把它作为默认路径:

powershell
pwsh -ExecutionPolicy Bypass -File scripts/get_cookie.ps1 -NoOpen

PowerShell 脚本会把二维码保存为本地 PNG 并输出绝对路径,然后继续轮询扫码状态。agent 应在看到 二维码图片已保存到:... 后立刻把图片发给用户,例如:

markdown
![115 登录二维码](C:\Users\...\AppData\Local\Temp\115-login-qrcode-xxx.png)

如果图片没有成功显示,必须提醒用户打开脚本输出的二维码文件路径自行扫码。用户用 115 App 扫码并确认后,脚本会自动获取 cookies 并默认保存到 ~/.115-cookies。

可选参数:

powershell
# 指定二维码图片保存位置
pwsh -ExecutionPolicy Bypass -File scripts/get_cookie.ps1 -QrPath "D:\115-login-qrcode.png" -NoOpen

# 允许脚本自动打开二维码图片
pwsh -ExecutionPolicy Bypass -File scripts/get_cookie.ps1

# 只打印 cookies,不保存
pwsh -ExecutionPolicy Bypass -File scripts/get_cookie.ps1 -NoSave

# 保存到指定路径
pwsh -ExecutionPolicy Bypass -File scripts/get_cookie.ps1 -CookiePath "D:\115-cookies.txt"

# 指定 app 类型,默认 tv
pwsh -ExecutionPolicy Bypass -File scripts/get_cookie.ps1 -App web

GitHub Releases 中的 115-cookie-helper-* 独立二进制也支持同样的二维码文件交互:

powershell
.\115-cookie-helper-windows-amd64.exe -no-open
.\115-cookie-helper-windows-amd64.exe -qr-path "D:\115-login-qrcode.png" -no-open

备用方案,如果用户已经手动拿到了 cookies,则保存并验证:

运行保存脚本(自动持久化到 ~/.115-cookies):

bash
printf '%s' 'UID=xxx; CID=xxx; SEID=xxx; KID=xxx' | python3 scripts/save_cookies.py --stdin

或使用环境变量 / 交互式运行:

bash
P115_COOKIES='UID=xxx; CID=xxx; SEID=xxx; KID=xxx' python3 scripts/save_cookies.py --env
python3 scripts/save_cookies.py

不推荐把 cookies 直接作为命令行参数传入,因为可能进入 shell 历史或进程列表。

第二步:测试连接

bash
python3 scripts/test_connection.py

输出用户信息、存储空间、根目录预览即表示连接正常。

第三步:使用功能

bash
# 浏览目录
python3 scripts/browse.py [目录ID]

# 添加离线下载
python3 scripts/offline_download.py 'magnet:?xt=urn:btih:xxx'

# 查看离线任务
python3 scripts/offline_download.py --list

安装依赖

p115client 当前固定在 Python 3.12 环境:

bash
python3.12 -m pip install -r requirements.txt
# 或指定 Python 路径
uv pip install --python /path/to/python3.12 -r requirements.txt

Cookies 持久化说明

  • 标准路径: ~/.115-cookies(即 /root/.115-cookies 或 /home/<user>/.115-cookies)
  • 格式: 纯文本,单行,格式为 UID=xxx; CID=xxx; SEID=xxx; KID=xxx
  • 权限: 建议 chmod 600 仅本人可读写
  • 过期: Cookies 有有效期,过期后需用户重新扫码或从浏览器获取。脚本用 Path 对象初始化 P115Client(Path(...))(新版 p115client 已移除 check_for_relogin 参数)。
  • 读取方式: 普通字符串会被 p115client 当作 cookies 内容解析;如果要传文件路径,必须传 pathlib.Path/os.PathLike,或者先 open().read() 读取内容。

⚠️ 关键 Pitfalls

1. 不能把普通字符串路径传给 P115Client

python
# ❌ 报错 ValueError: dictionary update sequence element #0 has length 1; 2 is required
client = P115Client("/path/to/cookies.txt")

# ✅ 正确:用 PathLike,续期后可写回文件
from pathlib import Path
client = P115Client(Path("/path/to/cookies.txt"))

# ✅ 也可以读取文件内容,但续期后的 cookies 不会自动写回这个文件
with open("/path/to/cookies.txt") as f:
    cookies = f.read().strip()
client = P115Client(cookies)

2. p115client 0.0.8.4.9 默认解析可能误判 JSON 响应

当前 skill 的 scripts/lib.py 会在导入 p115client 后修补 default_parse:使用响应首尾字节判断 JSON,避免 SDK 把普通 JSON 响应误当作加密内容解密后再解析,从而触发 P115DataError / JSONDecodeError。业务脚本应通过 lib.get_client() 初始化客户端,不要直接裸用 P115Client(...)。

3. tv cookies 与 web 文件接口登录态可能不通

默认扫码登录 app 仍为 tv,可用于扫码和部分账户/离线接口;目录浏览、搜索或存储接口如果返回“请先登录”“登录超时”“请重新登录”,请重新执行:

bash
python scripts/login.py --app web --no-open

4. API 字段名是缩写

字段含义常见错误
n文件/文件夹名❌ name
s文件大小 (bytes)❌ size
cid目录 ID❌ folder_id
fc子项数量❌ count
pid父目录 ID❌ parent_id
pcpick code (下载用)❌ pick_code
t修改时间 (unix)❌ mtime

5. Web API 在服务器上返回 405

fs_files() 从服务器 IP 调用会被拦截。必须用 fs_files_aps(),参数相同:

python
# ❌ 服务器上会 405
result = client.fs_files({"cid": dir_id, "limit": 100})

# ✅ 用这个
result = client.fs_files_aps({"cid": dir_id, "limit": 100})

6. 响应结构

python
{
    "state": true,
    "data": [  # 直接是列表
        {"cid": "xxx", "n": "文件夹名", "fc": 5, ...},   # 有 cid = 文件夹
        {"fid": "xxx", "n": "文件名", "s": 1048576, ...}  # 有 fid = 文件
    ]
}

常用 API 速查

python
from p115client import P115Client

# 初始化
with open(os.path.expanduser("~/.115-cookies")) as f:
    client = P115Client(f.read().strip())

# 用户信息
info = client.user_info()  # info['data']['user_name'], info['data']['is_vip']

# 存储空间
space = client.fs_storage_info()  # {type_id: {total, used}, ...}

# 浏览目录
items = client.fs_files_aps({"cid": 0, "limit": 100})['data']

# 搜索文件
result = client.fs_search({"search_value": "关键词", "limit": 50})

# 获取下载链接
url = client.download_url({"pick_code": "xxx"})

# 离线下载(磁力/ed2k/HTTP)——新版 p115client 方法名为 clouddownload_task_*
client.clouddownload_task_add_url({"url": "magnet:?xt=urn:btih:xxx"})

# 指定保存相对目录用 savepath;指定目录 ID 用 wp_path_id
client.clouddownload_task_add_url({"url": "https://example.com/file.zip", "savepath": "downloads"})

# 离线任务列表(payload 可传页码 int 或 {page, page_size, stat})
tasks = client.clouddownload_task_list()  # tasks['quota'], tasks['total'], tasks['count'], tasks['tasks']

# 离线下载目录
paths = client.clouddownload_downpath()  # paths['data'] = [{file_id, file_name, is_selected}, ...]

# 创建文件夹
client.fs_mkdir({"cname": "新文件夹", "pid": 0})

# 删除文件
client.fs_delete({"file_id": "xxx"})

相关资源

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the 115 Netdisk AI skill do?

115 网盘集成,支持 115扫码登录/115扫码登陆、二维码图片交互获取 cookies、cookies 保存与验证、目录浏览、文件搜索、离线下载任务添加和任务查询。使用 p115client SDK,基于 cookies 认证。Use when the user asks about 115网盘, 115云盘, 115扫码登录, 115扫码登陆, 115离线下载, p115client, 115 pan, or 115 netdisk operations.

Why use 115 Netdisk on TypingMind?

Because you install it once and use it with any model. 115 Netdisk is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install 115 Netdisk in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/chongchong59699/115-netdisk-skill/tree/master. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use 115 Netdisk?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with 115 Netdisk?

As many as you like. As long as a model supports skills, you can use 115 Netdisk with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the 115 Netdisk AI skill free?

It is published on GitHub by chongchong59699. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇