How mikf/gallery-dl works
gallery-dl is a command-line gallery and collection downloader. A user supplies site URLs and options; the CLI hands work to the job runner, which uses site-specific extractors to obtain media URLs and metadata, then selects downloaders to save files. Configuration, naming, logging, archives, and postprocessors shape that flow. The map preserves the documented breadth of supported sites and optional media handling. Some subsystem links rely on the source index’s import references; unsampled implementations are not treated as inspected.
Main entry points: job.py Job runner · common.py Extractor base · extractor Site extractors · http.py HTTP and media transfer
Components 25
CLI and orchestration
- Options and CLI
gallery_dl/option.py - Job runner
gallery_dl/job.py
Extraction and authentication
- Extractor registry
gallery_dl/extractor/__init__.py - Site extractors
gallery_dl/extractor - Extractor base
gallery_dl/extractor/common.py - OAuth flows
gallery_dl/extractor/oauth.py - Cookie loading
gallery_dl/cookies.py
Download and output
- Downloader registry
gallery_dl/downloader/__init__.py - HTTP and media transfer
gallery_dl/downloader/http.py - Downloader base
gallery_dl/downloader/common.py - Logging and output
gallery_dl/output.py
Configuration and naming
- Configuration
gallery_dl/config.py - File paths
gallery_dl/path.py - Formatting
gallery_dl/formatter.py
Archives and postprocessing
- Download archive
gallery_dl/archive.py - Postprocessor registry
gallery_dl/postprocessor/__init__.py - Postprocessor base
gallery_dl/postprocessor/common.py - File postprocessing
gallery_dl/postprocessor
Shared runtime
- Shared utilities
gallery_dl/util.py - Date and time
gallery_dl/dt.py - Text utilities
gallery_dl/text.py - Errors and control
gallery_dl/exception.py
Other components
- CLI user
- Danbooru service
- Local files
Connections 27
- CLI user → Options and CLI: supplies URLs
- Options and CLI → Job runner: starts jobs
gallery_dl/option.py - Job runner → Extractor registry: selects extractor
gallery_dl/job.py - Extractor registry → Site extractors: resolves site
- Site extractors → Danbooru service: requests content
- Site extractors → Extractor base: uses base
gallery_dl/extractor/deviantart.py - Extractor base → Configuration: reads settings
gallery_dl/extractor/common.py - Extractor base → Cookie loading: loads cookies
gallery_dl/extractor/common.py - Site extractors → OAuth flows: offers authorization
gallery_dl/extractor/oauth.py - Job runner → Downloader registry: selects downloader
gallery_dl/job.py - Downloader registry → HTTP and media transfer: dispatches transfer
- HTTP and media transfer → Downloader base: uses base
gallery_dl/downloader/http.py - Downloader base → Configuration: reads settings
gallery_dl/downloader/common.py - Job runner → File paths: prepares paths
gallery_dl/job.py - Job runner → Formatting: formats metadata
gallery_dl/job.py - Formatting → Shared utilities: evaluates expressions
gallery_dl/formatter.py - HTTP and media transfer → Local files: writes media
- Job runner → Logging and output: reports progress
gallery_dl/job.py - Job runner → Download archive: tracks downloads
gallery_dl/job.py - Job runner → Postprocessor registry: configures processors
gallery_dl/job.py - Postprocessor registry → File postprocessing: selects processor
- File postprocessing → Postprocessor base: uses base
gallery_dl/postprocessor/exec.py - Postprocessor base → Download archive: opens archive
gallery_dl/postprocessor/common.py - Extractor base → Date and time: normalizes dates
gallery_dl/extractor/common.py - Extractor base → Errors and control: raises extraction errors
gallery_dl/extractor/common.py - HTTP and media transfer → Errors and control: handles transfer errors
gallery_dl/downloader/http.py - Shared utilities → Text utilities: uses text helpers
gallery_dl/util.py