How to Download DVR Session Recordings¶
Silo DVR session recordings are stored as files in Silo file storage. Use the
SDK's FileAPI to discover and download them.
Bucket ID
DVR recordings may be stored in a different bucket than your default
BUCKET_ID. If downloads fail with a "file not found" error, verify
the correct source bucket ID with your Silo administrator.
1. Find DVR recordings¶
from silo_sdk import FileAPI, load_config
config = load_config("config/default.json")
files = FileAPI(config)
# Search by content type (video files)
results = files.find_files(
bucket_id=config["BUCKET_ID"],
file_type="video/webm",
)
# Or search by path/name pattern
results = files.find_files(
bucket_id=config["BUCKET_ID"],
name="recording",
)
for f in results:
print(f"{f['file_id']} {f.get('name', 'unnamed')} {f.get('content_type', '')}")
2. Download a recording¶
from pathlib import Path
file_id = "your-file-id-here"
output_dir = Path("downloads")
output_dir.mkdir(exist_ok=True)
# Get file metadata first
info = files.get_file_info(file_id=file_id)
filename = info.get("name", f"{file_id}.webm")
# Download
files.download_file(
file_id=file_id,
output_path=str(output_dir / filename),
)
print(f"Downloaded: {output_dir / filename}")
3. Decrypt encrypted recordings¶
If your organization uses log encryption, DVR recordings may be encrypted.
Use the SDK's decrypt_video_file function:
from silo_sdk.logging.decrypt import decrypt_video_file
decrypt_video_file(
video_path="downloads/recording.webm.enc",
output_path="downloads/recording.webm",
key_name="your-key-name",
key_file="pvtkey.txt",
)
Requires the [decrypt] extra. From inside the extracted SDK directory:
4. Bulk download¶
from pathlib import Path
def download_all_recordings(files_api, bucket_id, output_dir):
"""Download all DVR recordings from a bucket."""
results = files_api.find_files(
bucket_id=bucket_id,
file_type="video/webm",
)
output_path = Path(output_dir)
output_path.mkdir(exist_ok=True)
for f in results:
name = f.get("name", f"{f['file_id']}.webm")
dest = str(output_path / name)
print(f"Downloading {name}...")
files_api.download_file(file_id=f["file_id"], output_path=dest)
print(f"Downloaded {len(results)} recordings")
download_all_recordings(files, config["BUCKET_ID"], "downloads")
MCP Server¶
The MCP server's a8_find_files and a8_download_file tools can also be used
to locate and download DVR recordings interactively.