Quark Netdisk
by @stnjjjjj
Automate Quark Drive (夸克网盘): QR-code login, list/search, upload, create share links (expiry/passcode), and save others' shared links into your drive. Use whe...
clawhub install quark-netdisk📖 About This Skill
name: quark-netdisk description: "Automate Quark Drive (夸克网盘): QR-code login, list/search, upload, create share links (expiry/passcode), and save others' shared links into your drive. Use when user asks to operate Quark/夸克网盘, generate QR login, manage files under an allowlisted remote folder, create/share links, or transfer (转存) shared resources."
Quark Drive automation (夸克网盘)
Hard constraints (must follow)
references/config.json (or fallback references/config.example.json). Default allowlist should be /OpenClaw/**.Privacy & safety (publishable skill defaults)
references/session_api.json, references/cookies.json, references/login_token.json, references/qr_code.png
- (If enabled) references/index.json (may contain private filenames/paths)
Runtime / dependencies
requirements.txt exists for portability/reference.Config
references/config.jsonreferences/config.example.jsonKey fields (example names; see config.example.json):
remoteAllowlist: e.g. ["/OpenClaw/**"]localAllowlist: e.g. ["/path/to/Uploads"]loginTimeoutSecondsLogin workflow (QR)
Terminal (local)
1) Runlogin-prepare to generate QR
2) User scans in Quark App
3) Run login-wait to persist sessionAny OpenClaw channel (Telegram / WhatsApp / 飞书 ...)
Use orchestration pattern: 1) Run:channel-run ...
2) If exit code == 10 and JSON contains need_login: true:
- Send qr_png back to the current chat/channel
- Immediately start login-wait (poll every ~5s)
- When login succeeds, automatically reply in the same chat/channel (e.g. “登录成功”) and then re-run the original channel-run ... Machine-readable interaction exit codes (for orchestration):
need_login=trueneed_pick=true (multiple candidates; re-run with --pick)need_confirm=true (destructive ops; re-run with --confirm)Commands (scripts/quark_drive.py)
Invoke as:
python3 scripts/quark_drive.py [args...] Auth
loginlogin-prepare [--no-open]login-waitauth-statuschannel-run [args...] (preferred)telegram-run [args...] (alias)Browse
mkdir ls [--json] search [--allow-outside-openclaw] (privacy default: scoped to /OpenClaw/**)Upload
upload Share (create link)
#### Conversation contract (important) When the user asks to “生成分享链接/创建分享/分享某个文件(夹)”: 1) Search candidates first (do not ask user to provide full remote path). - Default: use server search. - If server search is insufficient and the user wants stronger fuzzy search, use a client-side fuzzy index and rank results by fuzzy score. - Privacy default: build the index in-memory (ephemeral) and do not write it to disk. - Only keep candidates whose resolved path is inside remote allowlist. 2) If multiple candidates: list them with index + path + type/size, ask user to pick. 3) Before creating the share, ask: - Expiry: 1 / 7 / 30 / 永久 - Passcode: 有 / 无 - If 有: ask for the code; if user does not provide, generate one (4–6 alnum). 4) If user does not answer: default to no passcode + permanent.
#### CLI
share-create [--days 1|7|30|0] [--passcode XXXX] [--title ...] share-create-auto [--pick N] [--days 1|7|30|0] [--passcode XXXX] [--local] [--allow-outside-openclaw] --pick is omitted, returns JSON with need_pick=true and a candidate list.Local index helpers:
index-build --root --max-items [--write] (may issue many API calls; without --write it does not persist)search-local [--top N] (builds ephemeral index; does not persist)Share (save others' share into my drive / 转存)
share-save [--passcode XXXX] [--to /OpenClaw/FromShares] [--no-wait] Notes:
Destructive
rename mv rm --confirm (soft-delete into /OpenClaw/.trash)purge-trash --days --confirm Troubleshooting
auth-status fails (401/403): session expired → run login flow again.share-save fails with “用户禁止转存自己的分享”: you tried saving your own link → test with someone else’s share.⚙️ Configuration
references/config.jsonreferences/config.example.jsonKey fields (example names; see config.example.json):
remoteAllowlist: e.g. ["/OpenClaw/**"]localAllowlist: e.g. ["/path/to/Uploads"]loginTimeoutSeconds📋 Tips & Best Practices
auth-status fails (401/403): session expired → run login flow again.share-save fails with “用户禁止转存自己的分享”: you tried saving your own link → test with someone else’s share.