core.storage#

Base module for Storage modules – modular components that store media objects in various locations.

Module Contents#

class core.storage.Storage#

Bases: auto_archiver.core.BaseModule

Base class for implementing storage modules in the media archiving framework.

Subclasses must implement the get_cdn_url and uploadf methods to define their behavior.

store(media: auto_archiver.core.Media, url: str, metadata: auto_archiver.core.Metadata = None) None#
abstract get_cdn_url(media: auto_archiver.core.Media) str#

Returns the URL of the media object stored in the CDN.

abstract uploadf(file: IO[bytes], key: str, **kwargs: dict) bool#

Uploads (or saves) a file to the storage service/location.

upload(media: auto_archiver.core.Media, **kwargs) bool#
set_key(media: auto_archiver.core.Media, url, metadata: auto_archiver.core.Metadata) None#

takes the media and optionally item info and generates a key