Add support for archiving recordings to S3 storage if enabled

This commit is contained in:
Sergey Krashevich 2023-05-23 22:44:56 +03:00
parent 07cdec0718
commit 361e8604c8
No known key found for this signature in database
GPG Key ID: 625171324E7D3856
2 changed files with 3 additions and 3 deletions

View File

@ -1323,7 +1323,7 @@ def recordings(camera_name):
def recording_clip(camera_name, start_ts, end_ts):
download = request.args.get("download", type=bool)
if current_app.frigate_config.storage.s3.enabled:
if current_app.frigate_config.storage.s3.enabled or current_app.frigate_config.storage.s3.archive:
s3 = StorageS3(current_app.frigate_config)
recordings = (

View File

@ -26,7 +26,7 @@ bandwidth_equation = Recordings.segment_size / (
class StorageS3:
def __init__(self, config: FrigateConfig) -> None:
self.config = config
if self.config.storage.s3.enabled:
if self.config.storage.s3.enabled or self.config.storage.s3.archive:
if self.config.storage.s3.endpoint_url.startswith('http://'):
session = boto_session()
session.set_config_variable('s3',
@ -65,7 +65,7 @@ class StorageS3:
return s3_filename
def download_file_from_s3(self, s3_file_name) -> str:
if self.config.storage.s3.enabled:
if self.config.storage.s3.enabled or self.config.storage.s3.archive:
# Create a temporary directory
temp_dir = tempfile.gettempdir()