Weiyun Skills
This skill should be used when the user needs to manage Tencent Weiyun cloud storage, including file upload/download, sharing, space management, and account authentication via QR code scanning or cookies. It provides a complete Python toolkit for automating Weiyun operations with CLI and SDK support. Trigger phrases include "upload to weiyun", "download from weiyun", "weiyun share", "weiyun space", "manage weiyun files", "weiyun login", "scan QR code", "微云管理", "微云上传", "微云下载", "微云分享", "微云空间", "扫码登录", "文件管理", "云存储管理", "微云文件", "weiyun files", "cloud storage".
安装 / 下载方式
TotalClaw CLI推荐
totalclaw install skilldb:wscats~weiyun-skillscURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/skilldb%3Awscats~weiyun-skills/file -o weiyun-skills.mdGit 仓库获取源码
git clone https://github.com/openclaw/skills/commit/01251d771fee83ebbf77aee9b768f3f2440a158b# SKILL.md — 腾讯微云管理 Skills 定义
> **使用方法**:本文档定义了所有可用的腾讯微云管理 Skills。AI Agent 或开发者可根据此文档调用 Python 脚本完成云存储操作。
>
> **认证方式**(二选一):
> ```bash
> # 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; ..."
> ```
>
> **调用方式**:
> ```bash
> # CLI
> python weiyun_skills/main.py <command> [args] [options]
>
> # Python SDK
> from weiyun_skills.client import WeiyunClient
> client = WeiyunClient()
> client.<skill_name>(**params)
> ```
>
> **统一返回格式**:
> ```json
> { "success": true, "data": { ... }, "message": "ok" }
> ```
---
## 目录
- [SKILL.md — 腾讯微云管理 Skills 定义](#skillmd--腾讯微云管理-skills-定义)
- [目录](#目录)
- [1. 认证 Skills](#1-认证-skills)
- [1.1 qrcode\_login — 扫码登录](#11-qrcode_login--扫码登录)
- [1.2 cookies\_login — Cookies 登录](#12-cookies_login--cookies-登录)
- [2. 文件管理 Skills](#2-文件管理-skills)
- [2.1 list\_files — 列出文件](#21-list_files--列出文件)
- [2.2 upload\_file — 上传文件](#22-upload_file--上传文件)
- [2.3 download\_file — 下载文件](#23-download_file--下载文件)
- [2.4 delete\_file — 删除文件](#24-delete_file--删除文件)
- [2.5 move\_file — 移动文件](#25-move_file--移动文件)
- [2.6 copy\_file — 复制文件](#26-copy_file--复制文件)
- [2.7 rename\_file — 重命名](#27-rename_file--重命名)
- [2.8 create\_folder — 创建文件夹](#28-create_folder--创建文件夹)
- [2.9 search\_files — 搜索文件](#29-search_files--搜索文件)
- [3. 分享管理 Skills](#3-分享管理-skills)
- [3.1 create\_share — 创建分享](#31-create_share--创建分享)
- [3.2 cancel\_share — 取消分享](#32-cancel_share--取消分享)
- [3.3 list\_shares — 列出分享](#33-list_shares--列出分享)
- [4. 空间管理 Skills](#4-空间管理-skills)
- [4.1 get\_space\_info — 空间信息](#41-get_space_info--空间信息)
- [4.2 get\_recycle\_bin — 回收站](#42-get_recycle_bin--回收站)
- [4.3 restore\_file — 恢复文件](#43-restore_file--恢复文件)
- [4.4 clear\_recycle\_bin — 清空回收站](#44-clear_recycle_bin--清空回收站)
- [附录 A:统一错误码](#附录-a统一错误码)
- [附录 B:Cookies 关键字段说明](#附录-bcookies-关键字段说明)
---
## 1. 认证 Skills
### 1.1 qrcode_login — 扫码登录
**描述**:生成腾讯微云登录二维码,用户使用微信/QQ 扫码完成认证。登录成功后自动保存 Cookies 到 `cookies.json`。
**CLI**:
```bash
python weiyun_skills/login.py --method qrcode
```
**Python**:
```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` | `string` | ❌ | `cookies.json` | Cookies 保存路径 |
**输出参数**:
| 参数名 | 类型 | 说明 |
|--------|------|------|
| `success` | `boolean` | 是否登录成功 |
| `uin` | `string` | 用户 UIN |
| `nickname` | `string` | 用户昵称 |
| `cookies_str` | `string` | Cookies 字符串 |
| `save_path` | `string` | 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 字符串完成登录认证。
**CLI**:
```bash
python weiyun_skills/login.py --method cookies --cookies "uin=o012345678; skey=@abcdef1234; p_uin=o012345678; pt4_token=xxxxx; p_skey=xxxxx"
```
**Python**:
```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_str` | `string` | ✅ | - | 从浏览器复制的 Cookie 字符串 |
| `save_path` | `string` | ❌ | `cookies.json` | Cookies 保存路径 |
**输出参数**:
| 参数名 | 类型 | 说明 |
|--------|------|------|
| `success` | `boolean` | 是否验证成功 |
| `uin` | `string` | 用户 UIN |
| `nickname` | `string` | 用户昵称 |
| `save_path` | `string` | Cookies 保存路径 |
---
## 2. 文件管理 Skills
### 2.1 list_files — 列出文件
**描述**:列出微云指定目录下的所有文件和文件夹。
**CLI**:
```bash
python weiyun_skills/main.py list /
python weiyun_skills/main.py list /我的文档 --sort size --order desc
```
**Python**:
```python
files = client.list_files("/我的文档", sort_by="size", sort_order="desc")
```
**输入参数**:
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| `remote_path` | `string` | ❌ | `/` | 目录路径,默认根目录 |
| `sort_by` | `string` | ❌ | `name` | 排序字段:`name`/`size`/`time` |
| `sort_order` | `string` | ❌ | `asc` | 排序方向:`asc`/`desc` |
| `page` | `integer` | ❌ | `1` | 分页页码 |
| `page_size` | `integer` | ❌ | `100` | 每页数量 |
**输出参数**:
| 参数名 | 类型 | 说明 |
|--------|------|------|
| `files` | `array` | 文件列表 |
| `files[].file_id` | `string` | 文件唯一 ID |
| `files[].name` | `string` | 文件名 |
| `files[].type` | `string` | `file` 或 `folder` |
| `files[].size` | `integer` | 大小(字节) |
| `files[].size_str` | `string` | 可读大小(如 `2.5 MB`) |
| `files[].path` | `string` | 完整路径 |
| `files[].updated_at` | `string` | 最后修改时间 |
| `total` | `integer` | 总数量 |
**示例输出**:
```json
{
"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**:
```bash
python weiyun_skills/main.py upload ./report.pdf /我的文档/
python weiyun_skills/main.py upload ./big_video.mp4 /视频/ --overwrite
```
**Python**:
```python
result = client.upload_file("./report.pdf", "/我的文档/report.pdf", overwrite=True)
```
**输入参数**:
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| `local_path` | `string` | ✅ | - | 本地文件路径 |
| `remote_path` | `string` | ✅ | - | 微云目标路径 |
| `overwrite` | `boolean` | ❌ | `false` | 是否覆盖同名文件 |
**输出参数**:
| 参数名 | 类型 | 说明 |
|--------|------|------|
| `file_id` | `string` | 上传后的文件 ID |
| `name` | `string` | 文件名 |
| `size` | `integer` | 文件大小 |
| `remote_path` | `string` | 云端路径 |
| `md5` | `string` | 文件 MD5 |
| `uploaded_at` | `string` | 上传时间 |
---
### 2.3 download_file — 下载文件
**描述**:从微云下载文件到本地。
**CLI**:
```bash
python weiyun_skills/main.py download /我的文档/report.pdf ./downloads/
python weiyun_skills/main.py download /我的文档/report.pdf ./downloads/ --overwrite
```
**Python**:
```python
result = client.download_file("/我的文档/report.pdf", "./downloads/report.pdf")
```
**输入参数**:
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| `remote_path` | `string` | ✅ | - | 微云文件路径 |
| `local_path` | `string` | ✅ | - | 本地保存路径 |
| `overwrite` | `boolean` | ❌ | `false` | 是否覆盖本地文件 |
**输出参数**:
| 参数名 | 类型 | 说明 |
|--------|------|------|
| `local_path` | `string` | 本地保存路径 |
| `size` | `integer` | 文件大小 |
| `md5` | `string` | MD5 校验值 |
| `elapsed` | `float` | 下载耗时(秒) |
---
### 2.4 delete_file — 删除文件
**描述**:删除微云文件或文件夹(移入回收站)。
**CLI**:
```bash
python weiyun_skills/main.py delete /我的文档/old_file.pdf
python weiyun_skills/main.py delete /我的文档/old_file.pdf --permanent
```
**Python**:
```python
result = client.delete_file("/我的文档/old_file.pdf", permanent=False)
```
**输入参数**:
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| `remote_path` | `string` | ✅ | - | 文件/文件夹路径 |
| `permanent` | `boolean` | ❌ | `false` | 是否永久删除(跳过回收站) |
**输出参数**:
| 参数名 | 类型 | 说明 |
|--------|------|------|
| `deleted_path` | `string