$ sudo apt install curl git python3 python3-distutils python3-pip libffi-dev libssl-dev
Follow the instructions at https://docs.docker.com/engine/install/ubuntu/
$ curl -sSL https://install.python-poetry.org | python3 -
$ source $HOME/.poetry/env
OR
$ pip install -U poetry
$ source $HOME/.poetry/env
$ git clone https://github.com/danielfernau/unifi-protect-video-downloader
$ cd unifi-protect-video-downloader
$ pip install pre-commit
$ pre-commit install
$ pre-commit run --all # first run
If no virtual environment exists yet, a new one will be created automatically.
$ poetry shell
It's recommended to switch to a virtual environment using poetry shell
before running this command.
$ poetry install
Once the environment has been set up, you can start editing the source files.
Poetry documentation can be found at https://python-poetry.org/docs/master/cli/
It's recommended to switch to a virtual environment using poetry shell
before running any of the commands below.
$ poetry run protect-archiver [OPTIONS] COMMAND [ARGS]...
$ poetry run flake8 protect_archiver
$ black protect_archiver
$ poetry run py.test -v
$ poetry build
$ cd ./dist
$ pip3 install protect_archiver*.whl
Replace protect_archiver*.whl
with a more specific file name if you have multiple versions in the ./dist
directory.
From within the project root directory run
$ docker build -t unifitoolbox/protect-archiver .
$ docker run --volume /path/on/host/machine:/downloads unifitoolbox/protect-archiver --help
Replace /path/on/host/machine
with an absolute path to your download directory and --help
with one of the supported commands and its parameters.
Have a look at the project's README.md for additional details.