Files
sutong 750f981c7e feat: init media-center skill
资源中心——从多渠道获取资源链接,转存到夸克网盘并整理归档。
- sources/tencent-doc: 腾讯文档读取
- sources/search: 网盘搜索
- storage/quark: 夸克网盘操作
- ref/: 来源 skill 参考归档

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-16 18:28:23 +08:00

89 lines
2.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 工作流:整理夸克网盘文件
对夸克网盘中已有的文件按规则分段整理归档。
## 步骤
### Step 1: 列出目标目录
```bash
mcporter call 'netdisk.list(cloud: "quark", path: "/要整理的目录")'
```
观察文件命名规律,确定分段方案。
### Step 2: 分析命名并确定分段规则
常见命名模式与分组建议:
| 文件命名示例 | 建议分段 | 说明 |
|-------------|---------|------|
| 第01集.mp4 ~ 第100集.mp4 | 01-30, 31-60, 61-90, 91-100 | 按30集一段 |
| E01.mp4 ~ E162.mp4 | 1-50, 51-100, 101-150, 151-162 | 按50集一段 |
| 遮天104 4K ~ 遮天162 4K | 101-120, 121-140, 141-150, 151-162 | 按20集一段 |
### Step 3: 创建分段文件夹
需要父目录的 FID(从 `netdisk.list` 输出的 `(ID: xxx)` 获取):
```bash
COOKIE="你的夸克Cookie"
# 批量创建目录
for name in "101-120" "121-140" "141-150"; do
curl -s -X POST "https://drive-h.quark.cn/1/clouddrive/file?pr=ucpro&fr=pc" \
-H "cookie: $COOKIE" \
-H "content-type: application/json" \
-H "origin: https://pan.quark.cn" \
-H "referer: https://pan.quark.cn/" \
-d "{\"pdir_fid\":\"<父FID>\",\"file_name\":\"$name\",\"file_type\":0,\"dir_init\":true}"
done
```
### Step 4: 移动文件到对应文件夹
按文件 FID 分组移动到各自的目标目录:
```bash
# 移动一批文件到目标目录
curl -s -X POST "https://drive-h.quark.cn/1/clouddrive/file/move?pr=ucpro&fr=pc" \
-H "cookie: $COOKIE" \
-H "content-type: application/json" \
-H "origin: https://pan.quark.cn" \
-H "referer: https://pan.quark.cn/" \
-d '{"action_type":1,"filelist":["<FID1>","<FID2>"],"to_pdir_fid":"<目标目录FID>"}'
```
> 注意:`filelist` 每次建议不超过 30 个 FID。
### Step 5: 验证最终结构
```bash
# 查看根目录(只剩子文件夹)
mcporter call 'netdisk.list(cloud: "quark", path: "/要整理的目录")'
# 抽查子目录内容
mcporter call 'netdisk.list(cloud: "quark", path: "/要整理的目录/101-120")'
```
## 完整示例(遮天整理)
```
整理前:遮.天(2023)/ ← 37个文件平铺(104-150集)
├── 104 4K.mp4
├── 108 4K.mp4
├── ...(37个文件散落)
整理后:遮.天(2023/
├── 101-120/ ← 104, 108, 109, 117-1207集)
├── 121-140/ ← 121-14020集)
├── 141-150/ ← 141-15010集)
└── 151-162/ ← 151-16211集,后续新增)
```
## 注意事项
- **FID 总在变**:每次列出目录时都要重新获取 FID,不要硬编码
- **移动是异步的**API 返回 `finish: true` 才能确认完成
- **先创建再移动**:文件夹不存在时 move 会失败