Skip to content

Blink surveillance footage CRON scraper for local drive back-up.

Notifications You must be signed in to change notification settings

vincenthang/watcher

Repository files navigation

Watcher

A python script to back up Blink video footage to your local drive, from the cloud.

How to use

Continuous Backup

Complete installation, then setup a daily cron job that runs run_cron.py at least once a day for continuous back-up. Make sure to set environment variables for your Blink login.

Set username and password (can be done in startup profile, or passed-through during the run command):

export BLINK_USERNAME=<YOUR_USERNAME>
export BLINK_PASSWORD=<YOUR_PASSWORD>

Set 2FA automation tokens (Outlook client supported only at the moment). This also requires a o365_token.txt in the root directory of the project as per the o365 library. See here for instructions on how to generate the o365_token.txt file.

export OUTLOOK_CLIENT_ID=<YOUR_OUTLOOK_CLIENT_ID>
export OUTLOOK_CLIENT_SECRET=<YOUR_OUTLOOK_CLIENT_SECRET>

Then run your cron job on :

# Example for every 12 hours
CRON EXPRESSION: 0 0 */12 ? * *
CRON JOB: poetry run python run_cron.py

The downloads will be sent to ./video_backup unless otherwise specified with -f <DIRECTORY> running run_cron.py.

Download All Footage Off The Cloud

The script allows you to download all footage off the cloud. Complete installation, then do the following.

Set username and password (can be done in startup profile, or passed-through during the run command):

export BLINK_USERNAME=<YOUR_USERNAME>
export BLINK_PASSWORD=<YOUR_PASSWORD>

Set 2FA automation tokens (Outlook client supported only at the moment). This also requires a o365_token.txt in the root directory of the project as per the o365 library. See here for instructions on how to generate the o365_token.txt file.

export OUTLOOK_CLIENT_ID=<YOUR_OUTLOOK_CLIENT_ID>
export OUTLOOK_CLIENT_SECRET=<YOUR_OUTLOOK_CLIENT_SECRET>

Run run_cron.py

poetry run python run_cron.py --all

The downloads will be sent to ./video_backup unless otherwise specified with -f <DIRECTORY> running run_cron.py.

Installation

Requires python 3.7.9:

pyenv install 3.7.9
pyenv virtualenv 3.7.9 watcher
pyenv local watcher
poetry install

Development

Complete installation, then install pre-commit.

poetry run pre-commit install

Testing

This project uses pytest.

poetry run pytest

About

Blink surveillance footage CRON scraper for local drive back-up.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages