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#

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 replicable strategy such as a hash.

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 (WARN: leaks the file structure)

False

string

API Reference