Giter Site home page Giter Site logo

gferraro / cptv-download Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thecacophonyproject/cptv-download

0.0 2.0 0.0 81 KB

Bulk download & upload thermal video recordings from a Cacophony Project API server

License: GNU General Public License v3.0

Python 100.00%

cptv-download's Introduction

cptv-download

This tool supports bulk downloading of thermal video recordings in CPTV and MP4 format from a Cacophony API instance. Videos are grouped into directories by the tagged animal type. Recordings are downloaded in parallel.

usage: cptv-download.py [-h] [-s SERVER] [--start-date START_DATE]
                        [--end-date END_DATE] [-r RECENT] [-t TAG] [-i IGNORE]
                        [-v] [-x] [-l LIMIT] [--mp4] [-m TAG_MODE]
                        out_folder user password

positional arguments:
  out_folder            Root folder to place downloaded files in.
  user                  API server username
  password              API server password

optional arguments:
  -h, --help            show this help message and exit
  -s SERVER, --server SERVER
                        CPTV file server URL
  --start-date START_DATE
                        If specified, only files recorded on or after this
                        date will be downloaded.
  --end-date END_DATE   If specified, only files recorded before or on this
                        date will be downloaded.
  -r RECENT, --recent RECENT
                        Download files only from the previous n days
                        (overwrites start-date and end-date
  -t TAG, --tag TAG     Specific tag to download, of if not specified all non
                        ignored tags will be downloaded - can use multiple
                        times
  -i IGNORE, --ignore IGNORE
                        Tag to ignore - can use multiple times
  -v, --verbose         Print additional information
  -x, --auto-delete     If enabled clips found in sub-folders other than their
                        tag folder will be deleted.
  -l LIMIT, --limit LIMIT
                        Limit number of downloads
  --mp4                 add if you want to download mp4 files
  -m TAG_MODE, --tagmode TAG_MODE
                        Select videos by only a particular tag mode. Default
                        is only selects videos tagged by both humans and
                        automatic

cptv-upload

This tool supports uploading of single audio and thermal video recordings into a Cacophony API instance. This is particularly useful for injecting recordings into a developer API server instance.

usage: cptv-upload.py [-h] server_url username password devicename filename

positional arguments:
  server_url  Server (base) url to send the CPTV files to
  username    Username to upload as
  password    Password to authenticate with
  devicename  Device to upload on behalf of
  filename    File to upload

optional arguments:
  -h, --help  show this help message and exit

Installation

These tools require Python 3.6 or later.

  • Create a virtualenv using your preferred method.
  • Install dependencies: pip install -r requirements.txt
  • Run with: ./cptv-download.py or ./cptv-upload.py

Configuration

Use --help to see how to configure program.

Queries

By default the most recent 100 recordings accessible to the user account are queried but API.query() does support a number of filtering options. The API server supports arbitrary queries so feel free to extend API.query() if required.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.