网淘吧来吧,欢迎您!

返回首页 微信
微信
手机版
手机版

Weiyun Skills

2026-03-28 新闻来源:网淘吧 围观:57
电脑广告
手机广告

SKILL.md — 腾讯微云管理 Skills 定义

使用方法:本文档定义了所有可用的腾讯微云管理 Skills。AI Agent 或开发者可根据此文档调用 Python 脚本完成云存储操作。

认证方式(二选一):

# Method 1: QR code login (recommended)
python weiyun_skills/login.py --method qrcode

# Method 2: Copy cookies from browser
python weiyun_skills/login.py --method cookies --cookies "uin=o012345678; skey=@abcdef1234; ..."

调用方式

# CLI
python weiyun_skills/main.py <command> [args] [options]

# Python SDK
from weiyun_skills.client import WeiyunClient
client = WeiyunClient()
client.<skill_name>(**params)

统一返回格式

{ "success": true, "data": { ... }, "message": "ok" }

目录


1. 认证 Skills

1.1 qrcode_login — 扫码登录

描述:生成腾讯微云登录二维码,用户使用微信/QQ 扫码完成认证。登录成功后自动保存 Cookies 到cookies.json

CLI

python weiyun_skills/login.py --method qrcode

Python

from weiyun_skills.login import qrcode_login

cookies = qrcode_login()
# Terminal will display QR code, scan with WeChat/QQ
# After success, cookies are saved to cookies.json

输入参数参数名

类型必填默认值说明save_path
字符串cookies.jsonCookies 保存路径输出参数

参数名

类型说明success
布尔型是否登录成功uin
字符串用户 UINnickname
字符串用户昵称cookies_str
字符串Cookies 字符串Cookies 字符串
保存路径字符串Cookies 保存路径

流程

┌─────────────┐     ┌──────────────┐     ┌─────────────┐
│ Request QR  │────▶│ Display QR   │────▶│ User scans  │
│ code URL    │     │ in terminal  │     │ with WeChat  │
└─────────────┘     └──────────────┘     └──────┬──────┘
                                                 │
┌─────────────┐     ┌──────────────┐             │
│ Save to     │◀────│ Get cookies  │◀────────────┘
│ cookies.json│     │ from server  │
└─────────────┘     └──────────────┘

1.2 cookies_login — Cookies 登录

描述:使用从浏览器复制的 Cookies 字符串完成登录认证。

命令行界面

python weiyun_skills/login.py --method cookies --cookies "uin=o012345678; skey=@abcdef1234; p_uin=o012345678; pt4_token=xxxxx; p_skey=xxxxx"

Python

from weiyun_skills.login import cookies_login

cookies = cookies_login(
    cookies_str="uin=o012345678; skey=@abcdef1234; ..."
)

如何获取 Cookies

  1. 打开浏览器访问https://www.weiyun.com/并登录
  2. F12打开开发者工具
  3. 切换到Network(网络)标签页
  4. 刷新页面,点击任意一个请求
  5. Headers(请求头)中找到Cookie字段
  6. 复制完整的 Cookie 值

输入参数

参数名类型必填默认值说明
cookies_strstring-从浏览器复制的 Cookie 字符串
save_pathstringcookies.jsonCookies 保存路径

输出参数

参数名类型说明
successboolean是否验证成功
uinstring用户 UIN
昵称字符串用户昵称
保存路径字符串Cookies 保存路径

2. 文件管理技能

2.1 list_files — 列出文件

描述:列出微云指定目录下的所有文件和文件夹。

CLI

python weiyun_skills/main.py list /
python weiyun_skills/main.py list /我的文档 --sort size --order desc

Python

files = client.list_files("/我的文档", sort_by="size", sort_order="desc")

输入参数

参数名类型必填默认值说明
remote_path字符串/目录路径,默认根目录
排序依据字符串名称排序字段:名称/大小/时间
排序顺序字符串升序排序方向:升序/降序
页码整数1分页页码
每页大小整数100每页数量

输出参数

参数名类型说明
filesarray文件列表
files[].file_idstring文件唯一 ID
files[].namestring文件名
files[].typestringfilefolder
files[].sizeinteger大小(字节)
files[].size_strstring可读大小(如2.5 MB
files[].pathstring完整路径
files[].updated_at字符串最后修改时间
total整数总数量

示例输出

{
  "success": true,
  "data": {
    "files": [
      {
        "file_id": "f_abc123",
        "name": "report.pdf",
        "type": "file",
        "size": 2621440,
        "size_str": "2.5 MB",
        "path": "/我的文档/report.pdf",
        "updated_at": "2026-03-15 10:30:00"
      },
      {
        "file_id": "d_folder01",
        "name": "照片",
        "type": "folder",
        "size": 0,
        "size_str": "-",
        "path": "/我的文档/照片",
        "updated_at": "2026-03-14 08:00:00"
      }
    ],
    "total": 2
  },
  "message": "ok"
}

2.2 upload_file — 上传文件

描述:将本地文件上传到微云指定目录。支持大文件分片上传。

CLI

python weiyun_skills/main.py upload ./report.pdf /我的文档/
python weiyun_skills/main.py upload ./big_video.mp4 /视频/ --overwrite

Python

result = client.upload_file("./report.pdf", "/我的文档/report.pdf", overwrite=True)

输入参数

参数名类型必填默认值说明
local_path字符串-本地文件路径
remote_path字符串-微云目标路径
覆盖布尔值是否覆盖同名文件

输出参数

参数名类型说明
file_id字符串上传后的文件 ID
name字符串文件名
size整数文件大小
remote_path字符串云端路径
md5字符串文件 MD5
uploaded_atstring上传时间

2.3 upload_folder — 上传文件夹

描述:将本地文件夹递归上传到微云,自动创建对应的目录结构。跳过隐藏文件和__pycache__等缓存目录。

CLI

# Upload folder to Weiyun root
python weiyun_skills/main.py upload-folder ./my_docs/

# Upload folder to a specific remote directory
python weiyun_skills/main.py upload-folder ./my_docs/ /目标文件夹/

# Overwrite existing files
python weiyun_skills/main.py upload-folder ./my_docs/ / --overwrite

Python

# Upload to root
result = client.upload_folder("./my_docs/")

# Upload to a specific folder, overwrite existing
result = client.upload_folder("./my_docs/", remote_path="/目标文件夹/", overwrite=True)

输入参数

参数名类型必填默认值说明
local_pathstring-本地文件夹路径
remote_pathstring/微云目标路径(/表示根目录)
overwritebooleanfalse是否覆盖同名文件

输出参数

参数名类型说明
folder_namestring上传的文件夹名称
uploaded_filesarray成功上传的文件列表
uploaded_files[].namestring文件名
uploaded_files[].sizeinteger文件大小(字节)
uploaded_files[].size_strstring可读大小
uploaded_files[].instant_uploadboolean是否秒传
failed_filesarray上传失败的文件列表
failed_files[].namestring文件名
failed_files[].errorstring错误信息
uploaded_countinteger成功上传数量
failed_countinteger失败数量
total_size_strstring总上传大小
elapsedfloat上传耗时(秒)

示例输出

{
  "success": true,
  "data": {
    "folder_name": "upload_file",
    "uploaded_files": [
      {
        "name": "abc.txt",
        "size": 6,
        "size_str": "6.00 B",
        "instant_upload": false
      }
    ],
    "failed_files": [],
    "uploaded_count": 1,
    "failed_count": 0,
    "total_size_str": "6.00 B",
    "elapsed": 2.35
  },
  "message": "ok"
}

2.4 download_file — 下载文件

描述:从微云下载文件到本地。

CLI

python weiyun_skills/main.py download /我的文档/report.pdf ./downloads/
python weiyun_skills/main.py download /我的文档/report.pdf ./downloads/ --overwrite

Python

result = client.download_file("/我的文档/report.pdf", "./downloads/report.pdf")

输入参数

参数名类型必填默认值说明
remote_pathstring-微云文件路径
local_pathstring-本地保存路径
overwritebooleanfalse是否覆盖本地文件

输出参数 参数名

类型说明local_path
string本地保存路径size
integer文件大小md5
stringMD5 校验值elapsed
float下载耗时(秒)2.5 download_folder — 下载文件夹

描述

:从微云下载整个文件夹到本地。支持两种模式:递归下载(保留目录结构)和打包下载(下载为 zip 文件)。CLI

Python

# Recursive download (preserves folder structure)
python weiyun_skills/main.py download-folder QQ ./downloads/
python weiyun_skills/main.py download-folder QQ ./downloads/ --overwrite

# Download as zip
python weiyun_skills/main.py download-folder QQ ./downloads/ --zip

输入参数

# Recursive download
result = client.download_folder("QQ", "./downloads/")

# Download as zip
result = client.download_folder("QQ", "./downloads/", as_zip=True)

参数名

类型必填必填默认值说明
folder_namestring-微云上的文件夹名称
local_pathstring-本地保存目录(或 zip 文件路径)
overwritebooleanfalse是否覆盖已存在的本地文件
as_zipbooleanfalse是否打包为 zip 下载

输出参数(递归模式)

参数名类型说明
folder_name字符串文件夹名称
local_path字符串本地保存路径
downloaded_files数组成功下载的文件列表
downloaded_files[].name字符串文件名
downloaded_files[].local_path字符串本地路径
downloaded_files[].size整数文件大小(字节)
downloaded_files[].size_str字符串可读大小
failed_files数组下载失败的文件列表
failed_files[].name字符串文件名
failed_files[].error字符串错误信息
downloaded_count整数成功下载数量
failed_count整数失败数量
total_size_str字符串总下载大小
elapsed浮点数下载耗时(秒)

输出参数(zip 模式)

参数名类型说明
local_path字符串zip 文件本地路径
size整数文件大小(字节)
size_str字符串可读大小
md5字符串MD5 校验值
耗时浮点数下载耗时(秒)

示例输出(递归模式)

{
  "success": true,
  "data": {
    "folder_name": "QQ",
    "local_path": "./downloads/QQ",
    "downloaded_files": [
      {
        "name": "report.pdf",
        "local_path": "./downloads/QQ/report.pdf",
        "size": 8663503,
        "size_str": "8.26 MB"
      }
    ],
    "failed_files": [],
    "downloaded_count": 6,
    "failed_count": 0,
    "total_size_str": "33.11 MB",
    "elapsed": 5.88
  },
  "message": "ok"
}

2.6 delete_file — 删除文件

描述:删除微云文件或文件夹(移入回收站)。

CLI

python weiyun_skills/main.py delete /我的文档/old_file.pdf
python weiyun_skills/main.py delete /我的文档/old_file.pdf --permanent

Python

result = client.delete_file("/我的文档/old_file.pdf", permanent=False)

输入参数

参数名类型必填默认值说明
remote_path字符串-文件/文件夹路径
永久删除布尔型false是否永久删除(跳过回收站)

输出参数

参数名类型说明
deleted_path字符串已删除的路径
is_permanent布尔型是否永久删除
deleted_at字符串删除时间

2.7 move_file — 移动文件

描述:将文件或文件夹移动到另一个目录。

CLI

python weiyun_skills/main.py move /我的文档/report.pdf /归档/2026/

Python

result = client.move_file("/我的文档/report.pdf", "/归档/2026/")

输入参数

参数名类型必填默认值说明
source_path字符串-源路径
target_path字符串-目标目录路径

输出参数

参数名类型说明
source_path字符串原路径
target_path字符串新路径

2.8 copy_file — 复制文件

描述:复制文件或文件夹到另一个目录。

CLI

python weiyun_skills/main.py copy /我的文档/report.pdf /备份/

Python

result = client.copy_file("/我的文档/report.pdf", "/备份/")

输入参数

参数名类型必填默认值说明
source_pathstring-源路径
target_pathstring-目标目录路径

输出参数

参数名类型说明
source_pathstring源路径
target_path字符串副本路径
新文件ID字符串副本文件ID

2.9 rename_file — 重命名

描述:重命名文件或文件夹。

CLI

python weiyun_skills/main.py rename /我的文档/report.pdf "年度报告.pdf"

Python

result = client.rename_file("/我的文档/report.pdf", "年度报告.pdf")

输入参数

参数名类型必填默认值说明
remote_path字符串-文件当前路径
new_name字符串-新文件名

输出参数

参数名类型说明
old_pathstring原路径
new_pathstring新路径

2.10 create_folder — 创建文件夹

描述:在微云上创建文件夹,支持递归创建多级目录。

CLI

python weiyun_skills/main.py mkdir /工作/2026/Q1/报告

Python

result = client.create_folder("/工作/2026/Q1/报告")

输入参数

参数名类型必填默认值说明
remote_pathstring-文件夹路径

输出参数

参数名类型说明
folder_idstring文件夹 ID
pathstring完整路径
created_atstring创建时间

2.11 search_files — 搜索文件

描述:按关键词搜索微云中的文件。

CLI

python weiyun_skills/main.py search "报告"
python weiyun_skills/main.py search "报告" --type document

Python

results = client.search_files("报告", file_type="document")

输入参数

参数名类型必填默认值说明
关键词字符串-搜索关键词
文件类型字符串全部类型过滤:全部/文档/图片/视频/音频
页码整数1分页页码
每页大小整数50每页数量

输出参数

参数名类型说明
resultsarray搜索结果列表
results[].file_idstring文件 ID
results[].namestring文件名
results[].typestring类型
results[].size_strstring可读大小
results[].pathstring路径
totalinteger匹配总数

3. 分享管理 Skills

3.1 create_share — 创建分享

描述:为文件或文件夹创建分享链接,支持设置密码和有效期。

CLI

python weiyun_skills/main.py share /我的文档/report.pdf
python weiyun_skills/main.py share /我的文档/report.pdf --expire 7 --password abc1

Python

share = client.create_share(
    "/我的文档/report.pdf",
    expire_days=7,
    password="abc1"
)
print(share["share_url"])

输入参数

参数名类型必填默认值说明
remote_pathstring-文件/文件夹路径
passwordstringnull分享密码(4 位)
expire_daysinteger0有效天数,0 为永久

输出参数参数名

类型说明share_id
string分享 IDshare_url
string分享链接password
string分享密码expire_at
string过期时间created_at
string创建时间示例输出

3.2 cancel_share — 取消分享

{
  "success": true,
  "data": {
    "share_id": "s_abc123",
    "share_url": "https://share.weiyun.com/xxxx",
    "password": "abc1",
    "expire_at": "2026-03-22 21:00:00",
    "created_at": "2026-03-15 21:00:00"
  },
  "message": "ok"
}

描述

:取消已创建的分享链接。CLI

Python

python weiyun_skills/main.py unshare s_abc123

result = client.cancel_share("s_abc123")

输入参数

参数名类型必填默认值说明
share_idstring-分享 ID

输出参数

参数名类型说明
share_idstring已取消的分享 ID
cancelled_atstring取消时间

3.3 list_shares — 列出分享

描述:列出当前用户所有的分享链接。

CLI

python weiyun_skills/main.py shares
python weiyun_skills/main.py shares --status active

Python输入参数

shares = client.list_shares(status="active")

参数名

类型必填默认值说明status
字符串all状态过滤:all/active/expiredpage
整数1分页页码page_size
整数20每页数量输出参数

输出参数参数名

类型说明shares
array分享列表shares[].share_id
string分享 IDshares[].share_url
string分享链接shares[].file_name
string文件名shares[].status
string状态shares[].view_count
integer查看次数shares[].download_count
integer下载次数shares[].created_at
stringstring创建时间
shares[].expire_atstring过期时间
totalinteger总数量

4. 空间管理 技能

4.1 get_space_info — 空间信息

描述:获取微云存储空间使用情况。

CLI

python weiyun_skills/main.py space

Python

info = client.get_space_info()
print(f"Used: {info['used_space_str']} / {info['total_space_str']}")

输入参数:无

输出参数

参数名类型说明
total_spaceinteger总空间(字节)
total_space_strstring可读总空间(如10 GB
used_spaceinteger已用空间(字节)
used_space_strstring可读已用空间
free_spaceinteger剩余空间(字节)
free_space_strstring可读剩余空间
usage_percentfloat使用百分比
file_countinteger文件总数
folder_countinteger文件夹总数

示例输出

{
  "success": true,
  "data": {
    "total_space": 10737418240,
    "total_space_str": "10.00 GB",
    "used_space": 5368709120,
    "used_space_str": "5.00 GB",
    "free_space": 5368709120,
    "free_space_str": "5.00 GB",
    "usage_percent": 50.0,
    "file_count": 1234,
    "folder_count": 56
  },
  "message": "ok"
}

4.2 get_recycle_bin — 回收站

描述获取回收站中的文件列表。

CLI

python weiyun_skills/main.py recycle

Python

items = client.get_recycle_bin()

输入参数

参数名类型必填默认值说明
pageinteger1分页页码
page_sizeinteger50每页数量

输出参数

参数名类型说明
filesarray回收站文件列表
files[].file_id字符串文件 ID
files[].name字符串文件名
files[].size_str字符串可读大小
files[].original_path字符串原始路径
files[].deleted_at字符串删除时间
total整数总数量
total_size_str字符串回收站总大小

4.3 restore_file — 恢复文件

描述:从回收站恢复文件到原始位置。

命令行界面

python weiyun_skills/main.py restore f_del001

Python

result = client.restore_file("f_del001")

输入参数

参数名类型必填默认值说明
file_idstring-回收站中的文件 ID

输出参数

参数名类型说明
file_idstring文件 ID
restored_pathstring恢复后路径
restored_atstring恢复时间

4.4 clear_recycle_bin — 清空回收站

描述:清空回收站,永久删除所有回收站文件。⚠️ 此操作不可逆!

CLI

python weiyun_skills/main.py clear-recycle --confirm

Python

result = client.clear_recycle_bin(confirm=True)

输入参数

参数名类型必填默认值说明
confirmboolean-必须为true才执行

输出参数

参数名类型说明
deleted_countinteger删除文件数
freed_space_strstring释放的空间大小
cleared_atstring清空时间

附录 A:统一错误码

错误码说明
AUTH_EXPIREDCookies 已过期,需重新登录
AUTH_FAILED认证失败
FILE_NOT_FOUND文件不存在
FOLDER_NOT_FOUND文件夹不存在
SPACE_FULL空间已满
FILE_TOO_LARGE文件过大
DUPLICATE_NAME名称重复
PERMISSION_DENIED权限不足
RATE_LIMITED请求频率超限
NETWORK_ERROR网络错误
SHARE_EXPIRED分享已过期
INVALID_PARAM参数无效
QR_EXPIRED二维码已过期,需刷新
QR_CANCELLED用户取消了扫码

错误响应格式

{
  "success": false,
  "data": null,
  "message": "Cookies expired, please re-login",
  "error_code": "AUTH_EXPIRED"
}

附录 B:Cookies 关键字段说明

Cookie 名称说明
uin用户 QQ 号标识
skey会话密钥
p_uin加密的用户标识
p_skey加密的会话密钥
pt4_tokenPT4 认证 Token
pt2gguin辅助认证字段

提示:并非所有 Cookie 字段都是必需的,核心字段为uinskeyp_skey

免责申明
部分文章来自各大搜索引擎,如有侵权,请与我联系删除。
打赏
文章底部电脑广告
手机广告位-内容正文底部
上一篇:Scrapling Official Skill 下一篇:Fast.io

相关文章

您是本站第289952名访客 今日有233篇新文章/评论