Skip to content

Configuration

The Bearodactyl edited this page Nov 6, 2025 · 6 revisions

Configuration is loaded in this order:

  1. Global e62rs file (e.g. ~/.config/e62rs.toml, ~/AppData/Roaming/e62rs.yaml, or ~/Library/Application Support/e926.json) — optional.
  2. Local e62rs file (e.g. e62rs.toml, e62rs.yaml, or e62rs.json) — optional.
  3. Environment variables prefixed with E62RS_.
  4. Defaults defined in code.

Top-Level Configuration (E62Rs)

Key Type Default Description
progress_format SizeFormat MegaBytes Format for displaying download progress.
post_count u64 320 Number of posts returned per search.
base_url String "https://e621.net" API base URL.
display ImageDisplay see Image Display Image preview/display settings.
http HttpConfig see HTTP Config HTTP client options.
cache CacheConfig see Cache Config Caching options.
performance PerformanceConfig see Performance Config Performance tuning.
ui UiConfig see UI Config UI/console options.
search SearchCfg see Search Config Search tuning.
completion CompletionCfg see Completion Config Autocompletion settings.
login LoginCfg see Login Config Login credentials.
autoupdate AutoUpdateCfg see AutoUpdate Config Auto-update settings.
download DownloadCfg see Download Config Download settings.
explorer ExplorerCfg see Explorer Config Downloads explorer settings.
gallery GalleryCfg see Gallery Config Media server settings.
logging LoggingCfg see Logging Config Logging settings
blacklist Vec<String> ["young", "rape", "feral", "bestiality"] Blacklisted tags to always filter out.

HTTP Configuration (HttpConfig)

Key Type Default Description
pool_max_idle_per_host usize 32 Max idle connections per host.
pool_idle_timeout_secs u64 90 Idle timeout for pooled connections.
timeout_secs u64 30 Request timeout.
connect_timeout_secs u64 10 Connection establishment timeout.
max_connections usize 15 Max concurrent connections.
http2_prior_knowledge bool true Enable HTTP/2 prior knowledge.
tcp_keepalive_secs u64 60 TCP keep-alive seconds.
tcp_keepalive bool true Enable TCP keep-alive.
user_agent String auto-generated User-Agent string in format: <project>/<version> (by <username> on e621).

Cache Configuration (CacheConfig)

Key Type Default Description
enabled bool true Enable/disable caching.
cache_dir String ".cache" Cache directory.
ttl_secs u64 3600 Cache time-to-live (seconds).
tti_secs u64 1800 Cache time-to-idle (seconds).
max_size_mb u64 500 Max cache size in MB.
max_entries usize 10000 Maximum number of entries in memory cache.
use_lru_policy bool false Use LRU eviction policy (false = TinyLFU).
enable_stats bool true Enable cache statistics tracking.
cleanup_interval_secs u64 300 Auto-cleanup interval in seconds.
enable_compression bool false Enable compression for cached data.
compression_level u8 6 Compression level (1-9).
post_cache PostCacheConfig see Post Cache Config Post-specific caching settings.

Post Cache Configuration (PostCacheConfig)

Key Type Default Description
enabled bool true Enable post cache.
max_posts usize 50000000 Maximum number of posts to cache.
enable_wal bool true Enable write-ahead logging for crash recovery.
page_size_kb usize 4 Database page size in KB.
auto_compact bool true Enable automatic compaction.
compact_threshold_percent u8 25 Compaction threshold (% wasted space).

Performance Configuration (PerformanceConfig)

Key Type Default Description
concurrent_downloads usize 15 Number of concurrent downloads.
prefetch_enabled bool true Enable prefetching posts.
prefetch_batch_size usize 10 Number of posts per prefetch batch.
preload_images bool true Enable image preloading.
max_preload_size_mb u64 100 Max preload size (MB).

UI Configuration (UiConfig)

Key Type Default Description
progress_refresh_rate u64 20 Progress bar refresh rate (Hz).
detailed_progress bool true Show detailed progress.
auto_clear_progress bool true Clear progress bars after completion.
pagination_size usize 20 Posts per page in listings.
colored_output bool true Enable colored console output.

Image Display Configuration (ImageDisplay)

Key Type Default Description
width u64 800 Max display width.
height u64 600 Max display height.
image_when_info bool true Show image in post info.
sixel_quality u8 100 Quality for sixel conversion (1–100).
resize_method String "lanczos3" Resize algorithm (nearest, linear, cubic, gaussian, lanczos3).

Search Configuration (SearchCfg)

Key Type Default Description
min_posts_on_tag u64 2 Minimum number of posts for a tag to appear in suggestions.
min_posts_on_pool u64 2 Minimum number of posts for a pool to appear in suggestions.
show_inactive_pools bool true Show inactive pools.
sort_pools_by_post_count bool false Sort pools by number of posts.
sort_tags_by_post_count bool true Sort tags by number of posts.
min_post_score i64 0 Minimum score a post must have to appear in results.
max_post_score i64 Maximum score a post can have to appear in results.
reverse_tags_order bool false Reverse alphabetic order of tag sorting.
fetch_threads usize 8 Number of threads to use when fetching post data.

Completion Configuration (CompletionCfg)

Key Type Default Description
tag_similarity_threshold f64 0.8 Threshold for fuzzy tag autocompletion (0–1 range).
tags String "data/tags.csv" Path to tags CSV file for autocompletion.
pools String "data/pools.csv" Path to pools CSV file for autocompletion.

Login Configuration (LoginCfg)

Key Type Default Description
login bool true Whether to login.
username String "" Your username.
api_key String "" Your API key.

AutoUpdate Configuration (AutoUpdateCfg)

Key Type Default Description
tags bool true Whether to auto-update tags.
pools bool true Whether to auto-update pools.

Download Configuration (DownloadCfg)

Key Type Default Description
download_dir String "downloads" Directory where posts are saved.
output_format String "$artists[3]/$rating/$tags[3] - $id - $date $time - $score.$ext" Filename template (see Filename Formatting).
save_metadata bool true Save post metadata alongside the file.

Explorer Configuration (ExplorerCfg)

Key Type Default Description
recursive_scan bool true Enable recursive directory scanning.
show_scan_progress bool true Show scanning progress for directories with many files.
progress_threshold usize 100 Minimum number of files before showing progress (0 = always show).
default_sort String "date_newest" Default sort order for explorer.
posts_per_page usize 20 Number of posts to display per page in explorer.
cache_metadata bool true Cache scanned metadata in memory for faster subsequent access.
auto_display_image bool true Automatically display image when viewing post details.
slideshow_wait_secs u64 5 The amount of time between images when playing a slideshow.

Gallery Configuration (GalleryCfg)

Key Type Default Description
enabled bool true Enable the media gallery server.
port u16 23794 Port to run the gallery server on.
enable_metadata_filtering bool true Enable metadata-based filtering (requires saved post metadata).
cache_metadata bool true Cache metadata in memory for faster filtering.
auto_open_browser bool false Automatically open browser when starting server.
load_threads usize 8 Number of threads to use for loading your downloads.
theme String "rose-pine" Color scheme to use for the gallery.

Logging Configuration (LoggingCfg)

Key Type Default Description
enable bool true Whether to enable logging.
level String "info" The max level to log at.
log_format String "Pretty" The format to use for logging.
ansi bool true Whether to enable ANSI for things like colors.
event_targets bool false Whether to display event targets on log messages.
line_numbers bool false Whether to denote line numbers on log messages.

Filename Formatting

The output_format setting controls how filenames are generated when saving posts. Forward slashes denote subfolders.

Simple Placeholders

These placeholders insert a single value:

Basic Post Information:

  • $id → post ID
  • $rating → rating (e.g. "safe", "questionable", "explicit")
  • $rating_first → first character of rating (s, q, e)
  • $md5 → MD5 hash of file
  • $ext → file extension

Scores & Engagement:

  • $score → total post score
  • $score_up → upvote score
  • $score_down → downvote score
  • $fav_count → number of favorites
  • $comment_count → number of comments

File Metadata:

  • $width / $height → file dimensions in pixels
  • $aspect_ratio → aspect ratio (width/height)
  • $orientation"portrait", "landscape", or "square"
  • $resolution → resolution category ("SD", "HD", "FHD", "QHD", "4K", "8K")
  • $megapixels → megapixel count (rounded to 1 decimal)
  • $size → file size in bytes
  • $size_mb → file size in megabytes (rounded to 2 decimals)
  • $size_kb → file size in kilobytes (rounded to 2 decimals)
  • $file_type → media type ("image", "video", "flash", "unknown")

Video-Specific:

  • $duration → video duration in seconds (0 if not applicable)
  • $duration_formatted → video duration as MM:SS or HH:MM:SS

User Information:

  • $artist → first listed artist (or "unknown")
  • $uploader → uploader username
  • $uploader_id → uploader user ID
  • $approver_id → approver ID (or "none")

Tag Counts:

  • $tag_count → total number of tags
  • $artist_count → number of artist tags
  • $tag_count_general → number of general tags
  • $tag_count_character → number of character tags
  • $tag_count_species → number of species tags
  • $tag_count_copyright → number of copyright tags

Pool Information:

  • $pool_ids → comma-separated list of pool IDs
  • $pool_count → number of pools the post is in

Relationships:

  • $has_children"yes" if post has children, "no" otherwise
  • $parent_id → parent post ID (or "none")

Flags:

  • $is_pending"yes" if pending approval, "no" otherwise
  • $is_flagged"yes" if flagged, "no" otherwise
  • $is_deleted"yes" if deleted, "no" otherwise
  • $has_notes"yes" if has notes, "no" otherwise

Date/Time Placeholders

Post Creation Date:

  • $year, $month, $day → creation date components
  • $hour, $minute, $second → creation time components
  • $date → shorthand for $year-$month-$day
  • $time → shorthand for $hour-$minute-$second
  • $datetime → shorthand for $year-$month-$day $hour-$minute-$second
  • $timestamp → Unix timestamp of upload

Post Update Date:

  • $year_updated, $month_updated, $day_updated → last update date components
  • $date_updated → shorthand for $year_updated-$month_updated-$day_updated

Download Time:

  • $now_year, $now_month, $now_day → download date components
  • $now_hour, $now_minute, $now_second → download time components
  • $now_date → shorthand for $now_year-$now_month-$now_day
  • $now_time → shorthand for $now_hour-$now_minute-$now_second
  • $now_datetime → shorthand for $now_year-$now_month-$now_day $now_hour-$now_minute-$now_second
  • $now_timestamp → Unix timestamp at download time

Indexed Placeholders

These placeholders allow you to extract multiple items from lists. They support several range syntaxes:

Syntax:

  • $key[N] → first N items (e.g., $tags[5])
  • $key[L..R] → items from index L to R (exclusive) (e.g., $tags[2..5])
  • $key[N..] → all items from index N onwards (e.g., $artists[1..])
  • $key[..N] → items from start to index N (exclusive) (e.g., $sources[..3])

Available indexed placeholders:

  • $tags[...] → general tags, joined by commas
  • $artists[...] → artist tags, joined by commas
  • $characters[...] → character tags, joined by commas
  • $species[...] → species tags, joined by commas
  • $copyright[...] → copyright tags, joined by commas
  • $sources[...] → source domains, joined by commas

Examples:

# First 3 tags
output_format = "$tags[3] - $id.$ext"
# → "anthro, digital_media, solo - 123456.png"

# Tags 2 through 5
output_format = "$tags[2..5] - $id.$ext"
# → "fur, blue_eyes, sitting - 123456.png"

# All artists except the first
output_format = "$artists[1..]/$id.$ext"
# → "collaborator1, collaborator2/123456.png"

# First 2 sources
output_format = "$sources[..2] - $id.$ext"
# → "twitter.com, deviantart.com - 123456.png"

# Organize by primary artist, include other artists in filename
output_format = "$artists[..1]/$artists[1..] - $id.$ext"
# → "primary_artist/collab1, collab2 - 123456.png"

Complete Examples

Organize by rating and year:

output_format = "$rating_first/$year/$artist/$id.$ext"

s/2024/artistname/123456.png

Organize by resolution and orientation:

output_format = "$resolution/$orientation/$id-$score.$ext"

4K/landscape/123456-42.png

Organize by franchise with character range:

output_format = "$copyright[1]/$characters[..2]/$id-$megapixels MP.$ext"

pokemon/pikachu, eevee/123456-2.1 MP.png

Organize by primary artist with collaborators:

output_format = "$artists[..1]/$tags[3] - $artists[1..] - $id.$ext"

main_artist/anthro, digital, solo - collab1, collab2 - 123456.png

Organize by media type with selective tags:

output_format = "$file_type/$artist-$tags[2..5]-$id.$ext"

image/artistname-tag3, tag4, tag5-123456.png

Complex format with multiple metadata and ranges:

output_format = "$rating/$year-$month/$artists[..2]/$tags[..3] - $id-$score-$resolution.$ext"

explicit/2024-03/artist1, artist2/tag1, tag2, tag3 - 123456-42-FHD.png