Configuration reference¶
The defaults are tuned for a long list of image URLs on an ordinary computer and connection. Most people change nothing.
Set an option in any of these ways; they all end up in the same DownloadConfig:
All options¶
A flag shown as --no-adaptive turns a True default off. Options without a flag are available from Python and
INI files only.
Concurrency¶
concurrencydefault 32CLI --concurrencyStarting number of in-flight requests. With adaptive=True this is only a starting point.
max_concurrencydefault 256CLI --max-concurrencyHard ceiling for in-flight requests and the size of the connection pool.
adaptivedefault TrueCLI --no-adaptiveTune concurrency live: grow while throughput improves, back off on 429s and errors.
hedgedefault TrueCLI --no-hedgeNear the end of a batch, race a duplicate request against stragglers; first one wins.
warm_startdefault TrueRemember the best concurrency per host and start there next time.
profile_pathdefault ~/.machyon/profiles.jsonWhere warm-start profiles live. Default: ~/.machyon/profiles.json.
Retries and timeouts¶
max_retriesdefault 5CLI --retriesRetries per URL after the first attempt (timeouts, resets, 408/425/429/5xx), in each round: the pass and, with retry_failures, the final sweep.
backoffdefault 0.5Base seconds for exponential backoff with jitter.
timeoutdefault 15.0CLI --timeoutConnect timeout and maximum silence between received bytes, in seconds.
max_request_timedefault 120.0Hard cap for one attempt; extended automatically in proportion to large bodies.
max_retry_afterdefault 120.0Upper bound on how long a server's Retry-After may pause a host.
HTTP¶
headersdefault {}CLI --headerExtra request headers (auth tokens, cookies, ...).
refererdefault NoneCLI --refererValue of the Referer header sent with every request (hotlink-protected sites).
user_agentdefault browser identityThe User-Agent header. Default: one current, stable desktop browser identity.
verify_ssldefault TrueCLI --insecureVerify TLS certificates. Turn off only for hosts you trust (--insecure).
tls_trustdefault 'native'CLI --tls-trustWhere trusted CAs come from: "native" (OS store via truststore, like your browser), "certifi" (Mozilla bundle, like requests) or "python" (Python's defaults).
use_compressiondefault TrueFalse sends Accept-Encoding: identity.
Files¶
validatedefault TrueCLI --no-validateReject bodies that aren't images (HTML "soft 404" pages, JSON errors, ...).
verify_existingdefault FalseCLI --verify-existingBefore skipping a file that already exists, check it really is an image.
fsyncdefault FalseFlush every file to physical disk before renaming it into place (slower, power-loss safe).
stream_thresholddefault 4 MiBBodies larger than this (or of unknown size) stream to disk and can resume with Range.
write_threadsdefault min(32, 4 × CPUs)Threads for file I/O. Default: min(32, 4 x CPUs).
shard_sizedefault 200_000Rows planned at a time; keeps memory flat for inputs of any size.
Reporting¶
progressdefault TrueCLI --no-progressShow the progress bar.
log_dirdefault NoneCLI --logWrite a rotating machyon.log here. None = no log file.
metrics_dirdefault NoneCLI --metricsAppend a JSON entry per run to metrics_json_info.json here. None = off.
Where things are written¶
| Path | Written when | Contents |
|---|---|---|
<save_dir>/failed_downloads.jsonl |
Something failed | The failure ledger |
<save_dir>/failed_downloads.txt |
Something failed | The failed URLs, one per line |
<save_dir>/.<name>.machpart |
During a streamed download | A partial body, kept for resuming; removed when finished or abandoned |
~/.machyon/profiles.json |
After a run that downloaded something, with adaptive and warm_start on |
The concurrency learned per host |
<metrics_dir>/metrics_json_info.json |
metrics_dir is set |
One summary entry per run |
<log_dir>/machyon.log |
log_dir is set |
A rotating log |