agentleFS
OpenMinisOpenMinis/MinisSkills/quark-hub/SKILL.md

quark-hub

Skill438 starsChanged 3 months agoMITView on GitHub

Quark Cloud Drive file management tool. Supports login, directory listing, saving shared links to your drive, downloading files, and creating directories. Login now uses minis-browser-use instead of the original project's Playwright. Trigger this skill when the user mentions "Quark Cloud Drive", "Quark download", "Quark save", "quark", or "pan.quark.cn".

  • Installs packages

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No pip installation required: Only native Alpine packages are needed (preinstalled on iSH):

    line 22
  2. Very specific:

    If aiohttp is unavailable:

    line 29
  3. Distinctive:

    The script itself does not drive the browser: When the script exits with exit code 10, login is required.

    line 84
  4. Distinctive:

    Use for illegal purposes is strictly prohibited.

    line 128

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

quark-hub

A Minis version of the Quark Cloud Drive tool, adapted from ihmily/QuarkPanTool (Apache-2.0).

File Paths

FilePathDescription
Main script/var/minis/skills/quark-hub/quark_hub.pyEntry point for all commands
Share listing script/var/minis/skills/quark-hub/scripts/quark_share_ls.pyStandalone script; no login required
Cookie refresh script/var/minis/skills/quark-hub/scripts/refresh_cookie.shRefresh the Cookie with one command
Cookie cache~/.quark_hub_cookiePersists login state for reuse across sessions; permissions 600

Dependencies

No pip installation required. Only native Alpine packages are needed (preinstalled on iSH):

PackageSourcePurpose
aiohttpNative Alpine (py3-aiohttp)All async HTTP requests
Standard libraryBuilt into Pythonasyncio / json / re / urllib / threading, etc.

If aiohttp is unavailable:

apk add py3-aiohttp

Command Quick Reference

CommandLoginDescription
ls-share <url>🔓 Not requiredList files in the root directory of a shared link
tree-share <url>🔓 Not requiredRecursively expand the complete file tree of a shared link
info🔒 RequiredView account information and storage capacity
ls [fid]🔒 RequiredList your own cloud drive directory, including fid values
save <url> [fid]🔒 RequiredSave shared files to your cloud drive, automatically checking whether they already exist
dl <url> [dir]🔒 RequiredDownload files from your own cloud drive to local storage, with a background thread and progress
mkdir <name> [fid]🔒 RequiredCreate a cloud drive directory

⚡ Best Workflow for Saving and Downloading (Agents Must Read)

When downloading files shared by others, follow this order to avoid duplicate saves:

1. tree-share <url>           # See exactly what is in the share
2. ls [to_fid]                # Check whether the target cloud drive directory already has content with the same name
3a. Exists → download by fid directly    # Skip saving; use the existing fid to call api_get_download_urls
3b. Does not exist → save <url>          # Save to your drive (also checks internally and skips if it already exists)
4. ls [to_fid]                # Get the fid of the file after it has been saved
5. dl (pass extra_fids)       # Download in a background thread; automatically prints progress and 1-minute average speed

Key: the save command now automatically checks whether a file with the same name already exists in the target directory and skips saving if it does. However, the agent should still run ls before calling save to confirm and avoid unnecessary network requests.

Download Notes

  • dl / download_files_bg can download only files in your own cloud drive due to Quark API restrictions.
  • Files shared by others → first save to your drive → then ls to get the fid → then dl.
  • Downloads run in a background thread and print progress every 10 seconds (downloaded / total size / percentage / 1-minute average speed).
  • Download URLs point to Alibaba Cloud OSS, and headers must not include Content-Type (handled in the code).
  • Files such as subtitles can be renamed during download with the rename_map parameter, for example to match the video filename.

Code-Level API (for importing in scripts)

from quark_hub import (
    ensure_cookie,           # Get/validate the Cookie; sys.exit(10) if invalid
    api_get_download_urls,   # Pass a fid list → return a list of dicts containing download_url
    download_files_bg,       # Download in a background thread; pass items=[{file_name, download_url, save_name?}]
    api_list_all,            # List a cloud drive directory
)

Login Flow (performed by the agent)

The script itself does not drive the browser. When the script exits with exit code 10, login is required. The agent completes login as follows:

Step 1: Give the user a clickable login link

Please log in to Quark Cloud Drive first: [Click to log in to Quark Cloud Drive](https://pan.quark.cn)
Let me know once you have finished logging in.

Step 2: After the user confirms login, extract and save the Cookie

sh /var/minis/skills/quark-hub/scripts/refresh_cookie.sh

Step 3: Verify that login succeeded

python3 /var/minis/skills/quark-hub/quark_hub.py info

Usage Examples

S=/var/minis/skills/quark-hub/quark_hub.py

# 🔓 No login required
python3 $S ls-share   "https://pan.quark.cn/s/xxxxxxxx"
python3 $S tree-share "https://pan.quark.cn/s/xxxxxxxx"

# 🔒 Login required
python3 $S info
python3 $S ls
python3 $S ls <fid>
python3 $S save "https://pan.quark.cn/s/xxxxxxxx"         # Automatically checks existing content → skip or save
python3 $S save "https://pan.quark.cn/s/xxxxxxxx?pwd=1234" <target_fid>
python3 $S dl   "https://pan.quark.cn/s/xxxxxxxx" /var/minis/workspace/
python3 $S mkdir My Movies

Notes

  • Cookies are valid for about 7-30 days. Log in again after they expire.
  • Use for illegal purposes is strictly prohibited. This tool only calls the official Quark API.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.