Output Structure
Relevant source files
The following files were used as context for generating this wiki page:
abx-dl follows a standardized output convention designed for both human readability and machine interoperability. By default, the tool writes results into the current working directory, though users can specify a custom location using the --output flag. The output consists of a central manifest file and a hierarchy of subdirectories organized by the plugins that produced the content.
The primary goal of this structure is to provide a comprehensive archive of a URL's state, including rendered HTML, media files, metadata, and execution logs. This structure is compatible with the larger ArchiveBox ecosystem.
Sources: README.md:214-220, skills/abx-dl/SKILL.md:46-52
Directory Hierarchy
When a URL is processed, abx-dl generates a root directory containing the primary manifest and multiple subdirectories. Each subdirectory corresponds to a specific plugin (e.g., wget, screenshot, pdf) that successfully extracted content.
The diagram shows the standard layout of an archive run where multiple plugins have been enabled.
Key Components
| Component | Description |
|---|---|
index.jsonl | The main manifest containing metadata, snapshot info, and result records in JSONL format. |
title/title.txt | Contains the plain-text title of the archived page. |
favicon/favicon.ico | The site's favicon or touch icons. |
screenshot/screenshot.png | A full-page visual capture of the rendered site. |
pdf/output.pdf | The rendered page saved as a PDF document. |
wget/ | A directory containing a recursive mirror of the site files. |
singlefile/output.html | A self-contained HTML snapshot including assets. |
Sources: README.md:231-245, skills/abx-dl/SKILL.md:46-52
The Manifest File (index.jsonl)
The index.jsonl file serves as the database for the archive run. It uses the JSON Lines format, where each line is a valid JSON object representing a specific event or data record.
Record Types
The manifest includes several distinct object types defined in the system's data models:
- Snapshot: Records the initial URL and metadata for the archive attempt.
- ArchiveResult: Records the output of a specific plugin hook, including the status (succeeded/failed) and paths to generated files.
- Tag: Represents labels or tags assigned to the snapshot.
- Process: Contains technical details about the execution of a hook, including command arguments, environment variables, and exit codes.
The relationship between the primary data entities found within the index.jsonl manifest.
Sources: abx_dl/models.py:270-335, abx_dl/cli.py:590-605
File Metadata and Discovery
abx-dl utilizes an automated scanning mechanism to identify and catalog files produced during execution. The OutputFile model tracks the physical attributes of these files without requiring the system to read their contents.
OutputFile Data Structure
| Field | Type | Description |
|---|---|---|
path | str | Relative path to the file from the output root. |
extension | str | The file extension (e.g., "png", "html"). |
mimetype | str | The guessed MIME type based on the extension. |
size | int | The size of the file in bytes. |
Sources: abx_dl/output_files.py:19-25
Excluded Internal Artifacts
Not every file in the output directory is considered a "result." The system explicitly ignores process-related artifacts and metadata files to keep the manifest clean. Files with the following suffixes are excluded from the ArchiveResult output file list:
.stdout.log.stderr.log.log.pid.sh.meta.json
Sources: abx_dl/output_files.py:16, server/server.py:175-180
Implementation Details
JSONL Generation
Records are appended to index.jsonl using the write_jsonl helper. Models implement a to_jsonl() method that filters out None values and adds a type discriminator for easy parsing.
# From abx_dl/models.py
def to_jsonl(self) -> str:
d = {k: v for k, v in self.model_dump().items() if v is not None}
d["type"] = "ArchiveResult"
return json.dumps(d, default=str)
Sources: abx_dl/models.py:330-340
MIME Type Detection
MIME types are determined using the standard mimetypes library, with custom additions for specialized types like application/warc.
# From abx_dl/output_files.py
def guess_mimetype(path: str | Path) -> str:
path_str = path.as_posix() if isinstance(path, Path) else str(path)
mimetype, encoding = mimetypes.guess_type(path_str, strict=False)
if mimetype:
return mimetype
# ... handles gzip and fallbacks
return ""
Sources: abx_dl/output_files.py:28-44
Summary
The abx-dl output structure provides a deterministic, plugin-centric view of web archives. By combining a machine-readable JSONL manifest with a human-navigable directory hierarchy, the system ensures that archived data is both discoverable and verifiable. Metadata scanning further enriches this structure by providing file-level details like MIME types and sizes without adding significant overhead to the archiving process.
Sources: README.md:214-220, abx_dl/models.py:1-10