How to download Vidaoo recordings (script)

How to download Vidaoo recordings (script)

Overview

This guide explains how to securely download and convert your Vidaoo video recordings from S3 storage using a Node.js script.
The script authenticates via your Vidaoo API key, handles downloads in bulk, and automatically converts .webm recordings to .mp4.

 

 

Prerequisites

Before running the script, make sure the following are installed on your machine:

  • Node.js (v14 or higher)

  • npm (Node Package Manager)

  • FFmpeg (automatically installed via ffmpeg-static package)


How the Script works

The script performs the following operations:

Creates the download directory if it does not exist

Handles pre-signed S3 URLs for secure downloads

Downloads recordings from Vidaoo API with pagination support (100 at a time)

Skips already downloaded recordings

Automatically converts .webm files to .mp4 format

Deletes the original .webm files after conversion

Displays progress in the console

 

Installation, configuration and result

Clone this repository

Install dependencies:

npm install

Create a .env file in the root directory with the following variables:

# Required API_KEY=your_api_key_here # Optional DOWNLOAD_DIR=./download

Environment Variables

  • API_KEY (Required): Your Vidaoo API key. You can generate it from your Vidaoo account:

    1. Log in to your Vidaoo account

    2. Go to Users -> Tokens

    3. Generate a new token

    4. Copy the token value to your .env file

  • DOWNLOAD_DIR (Optional): Directory where recordings will be saved. Defaults to './download' in the project root

Run the script using:

npm start

The script will download the recordings, convert the files to .mp4 format, delete the original .webm files, displaying the progress in the console.

Find the recordings in the configured download directory (default: ./download) with the following naming convention: {recording_id}.mp4 for converted files

Remember that original files are removed after successful conversion.

 

Error Handling

The script includes error handling for:

  • Failed downloads

  • Failed conversions

  • Missing API key

  • Network issues

All errors are logged to the console, and the script continues processing other recordings even if some fail.