Local Storage#

Module type

storage

LocalStorage: A storage module for saving archived content locally on the filesystem.

Features#

  • Saves archived media files to a specified folder on the local filesystem.

  • Maintains file metadata during storage using shutil.copy2.

  • Supports both absolute and relative paths for stored files, configurable via save_absolute.

  • Automatically creates directories as needed for storing files.

Notes#

  • Default storage folder is ./archived, but this can be changed via the save_to configuration.

  • The save_absolute option can reveal the file structure in output formats; use with caution.

Configuration Options#

YAML#

# steps configuration
steps:
...
  storages:
  - local_storage
...

# module configuration
...

local_storage:
  path_generator: flat
  filename_generator: static
  save_to: ./local_archive
  save_absolute: false

Command Line:#

Option

Description

Default

Type

local_storage.path_generator

Optional. how to store the file in terms of directory structure: ‘flat’ sets to root; ‘url’ creates a directory based on the provided URL; ‘random’ creates a random directory.

flat

string

local_storage.filename_generator

Optional. how to name stored files: ‘random’ creates a random string; ‘static’ uses a hash, with the settings of the ‘hash_enricher’ module (defaults to SHA256 if not enabled)

static

string

local_storage.save_to

Optional. folder where to save archived content

./local_archive

string

local_storage.save_absolute

Optional. whether the path to the stored file is absolute or relative in the output result inc. formatters (Warning: saving an absolute path will show your computer’s file structure)

False

bool

API Reference