quark-search
Original:🇺🇸 English
Translated
1 scriptsChecked / no sensitive code detected
Search, validate, and save cloud drive resources via PanSou aggregation API and local Quark desktop APP integration. This skill should be used when the user wants to find and download resources from cloud drives (网盘资源搜索下载), especially when they mention keywords like "搜资源", "找片", "下载", "网盘", "夸克", "quark", "panso", "盘搜". Requires Quark desktop APP running and logged in with membership.
2installs
Sourcepsylch/quark-search
Added on
NPX Install
npx skill4agent add psylch/quark-search quark-searchTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Quark Search — 网盘资源搜索与下载
Automate the full workflow: search resources → validate links → save to Quark cloud drive → download locally, by combining the PanSou aggregation API with the local Quark desktop APP.
All operations use the CLI script at . It outputs JSON to stdout ( or ) and logs progress to stderr.
${SKILL_PATH}/scripts/quark_search.py{"ok": true, "data": {...}}{"ok": false, "error": "...", "code": "..."}Prerequisites Check
Before any operation, verify the environment:
bash
python3 ${SKILL_PATH}/scripts/quark_search.py checkResponse: — confirms APP is running and logged in.
{"ok": true, "data": {"isLogin": true, ...}}If the command fails with , instruct the user to launch Quark APP. If is , instruct the user to log in first.
"code": "app_not_running"isLoginfalseWorkflow — Quick Search (recommended)
A single command searches PanSou, validates all links in parallel, and fetches file details for the top results:
bash
python3 ${SKILL_PATH}/scripts/quark_search.py search "KEYWORD" --top 5Options:
| Flag | Default | Description |
|---|---|---|
| | Number of top valid results to return with details |
| off | Skip validation (faster, but may include dead links) |
| | PanSou results per page |
| | PanSou page number |
Success response ():
ok: truejson
{
"ok": true,
"data": {
"keyword": "三体",
"total": 1234,
"valid_count": 8,
"results": [
{
"pwd_id": "abc123def",
"url": "https://pan.quark.cn/s/abc123def",
"note": "三体全集 4K",
"source": "plugin:libvio",
"datetime": "2025-01-15",
"stoken": "xxx",
"detail": {
"pwd_id": "abc123def",
"pdir_fid": "0",
"total": 3,
"list": [
{"file_name": "三体S01E01.mkv", "size": 4294967296, "dir": false, "fid": "f1"},
{"file_name": "Extras", "size": 0, "dir": true, "fid": "f2", "include_items": 5}
]
}
}
]
}
}Key fields:
- — total results across all drive types from PanSou
total - — how many quark links passed validation
valid_count - — share ID for save command
results[].pwd_id - — files/folders in the share
results[].detail.list[] - —
results[].detail.list[].dirif folder (more reliable than file_type)true - — use with
results[].detail.list[].fidcommand to browse subfoldersdetail
No quark results: When is empty but > 0, the response includes showing available results on other drive types. Report these to the user.
resultstotaltype_countsPriority: Always prioritize type results since the user has Quark membership. The script handles this automatically.
quarkWorkflow — Step-by-step
For granular control, use individual subcommands:
Validate Links
bash
python3 ${SKILL_PATH}/scripts/quark_search.py validate PWD_ID_OR_URL [...]Accepts multiple pwd_ids or full share URLs. Returns validation status for each:
| Meaning | Action |
|---|---|---|
| Share is alive | Proceed. Response includes |
| Share expired (code 41004) | Skip, mark as expired |
| Share deleted (code 41006) | Skip, mark as invalid |
| Other error | Skip |
Get File Details
bash
python3 ${SKILL_PATH}/scripts/quark_search.py detail PWD_ID --stoken STOKEN [--fid FID]Fetches the file listing for a share. Use to browse into a subfolder (pass the folder's from a previous detail response).
--fidfidHealth Check
bash
python3 ${SKILL_PATH}/scripts/quark_search.py health [--refresh]Shows PanSou API status and the / lists used for search. Health data is cached for 24 hours at . Use to force a fresh fetch.
channelsplugins~/.cache/quark-search/health.json--refreshPresent Results to User
Format results clearly:
搜索 "三体" 找到 X 个有效夸克网盘资源:
1. [有效] 三体全集 4K — 3个文件,来源: plugin:libvio
https://pan.quark.cn/s/abc123
2. [有效] 三体 第一季 1080P — 1个文件夹(42项),来源: channel:yunpanx
https://pan.quark.cn/s/def456
3. [已失效] 三体合集 — 分享已过期Ask the user which one to save.
Save
When the user selects a resource, trigger the Quark APP to open the share link:
bash
python3 ${SKILL_PATH}/scripts/quark_search.py save PWD_ID_OR_URLThe script tries three methods in order: (preferred) → deeplink → browser fallback. The response indicates which method succeeded.
desktop_share_visitingdesktop_callerAfter a successful APP save (method or ), inform the user:
desktop_share_visitingdesktop_caller已在夸克 APP 中打开分享链接窗口。注意:弹出的窗口可能很小,请留意任务栏/Dock 上的夸克图标。 在 APP 中点击「保存到网盘」按钮完成保存。保存后文件会出现在你的网盘中,可以直接在 APP 中下载到本地。
If the response method is , open the URL in the browser instead and inform the user to save from the web page.
browser_fallbackBatch Processing
When the user wants to search and save multiple resources, loop through the search → present → save workflow for each keyword. Validate all links first via the command, then trigger APP saves sequentially.
searchError Handling
| Error | Detection | Resolution |
|---|---|---|
| Quark APP not running | | Tell user to launch Quark APP |
| Not logged in | | Tell user to log in |
| No search results | | Suggest different keywords |
| All links invalid | | Try alternative keywords or drive types |
| Share has password | | Ask user for the extraction code (提取码) |
| PanSou API error | | Retry or try later |
Important Notes
- All share validation APIs are public (no authentication needed)
- The local Quark APP API at requires no authentication
localhost:9128 - The actual save-to-drive operation happens in the Quark APP UI (user clicks one button)
- Download-to-local is handled by Quark APP's built-in download manager
- Do not attempt to call Quark's authenticated remote APIs directly