Quark Anonymous Download
Use scripts/quark_anonymous_download.py. It uses only Python 3 standard
library modules, an in-memory anonymous cookie jar, and Quark's public-share
endpoints. Never add account cookies, browser profiles, saved credentials, or
login steps.
Workflow
List before downloading unless the requested file name is exact and unambiguous:
python3 scripts/quark_anonymous_download.py list 'https://pan.quark.cn/s/SHARE_ID'Download one exact file, a uniquely matching name fragment, or all files:
python3 scripts/quark_anonymous_download.py download URL --name 'exact-file.zip' --output-dir OUTPUT python3 scripts/quark_anonymous_download.py download URL --contains '关键词' --output-dir OUTPUT python3 scripts/quark_anonymous_download.py download URL --all --output-dir OUTPUTIf
--containsmatches several files, stop and use the listed path with--name, or pass--latestonly when the user explicitly wants the newestupdated_atversion.Add
--incrementalwhen the user wants version history. It appends the remoteupdated_attimestamp in Beijing time, preserves older files, and skips an existing matching dated file.Report each completed file with its remote path, byte size, and SHA-256. Do not extract, execute, install, or inspect executable payloads unless the user separately asks.
Limits and failures
- Reissue a fresh temporary direct URL when a request fails with HTTP 412,
then use a
Rangerequest withReferer: https://pan.quark.cn/. - Treat API errors such as
download file size limit,require login, or a missing direct URL as a server-side anonymous-download restriction. Report the affected files; do not claim success and do not attempt a login bypass. - The script validates response ranges, final byte size, SHA-256, and writes with a temporary file followed by atomic replacement.
- Share IDs, file IDs, tokens, direct URLs, timestamps, availability, and hashes are remote and time-specific. Obtain them anew for every share.