Skip to content

Downloader

codemicro edited this page Jan 11, 2020 · 5 revisions

Setup

Requirements: Python 3.7 or above

  1. Run pip install -r requirements.txt to install all required dependencies (or pip3 on Linux).
  2. Copy settings.json.example to settings.json, remove the first line, and fill in the appropriate details.
    • download_dir is the path to the folder all downloads will be downloaded into. This can be either relative or absolute.
    • endpoint should be left alone
    • auth_key is your internal API authentication key
  3. Run dlclient.py, as sudo if on Linux to ensure the script has write permission to the downloads directory. If you do so, you must ensure you ran pip3 as sudo too.

What it does

Every 10 (?) seconds, the program will poll the internal API to retrieve the next available download link. If one is found, it will download that link using the provided information, and immediately move onto the next link. If no links are found, the program will wait another 10 seconds.

Errors and logging

If any error is thrown, it will be picked up by loguru, and logged in a file called error.log which will be created in the same directory as the script. The script then quits. It is important to monitor if the script has failed or not, and restart it if possible.

Clone this wiki locally