Code Monkey home page Code Monkey logo

amdacli's Introduction

amdacli: Amcrest / Dahua Command CLI

Run HTTP configuration commands across Amcrest or Dahua IP camera(s).

Interact with a single camera, or several in one command!

Installation

  1. Download the latest Go compiler from https://golang.org/dl/.
  2. Follow the instructions for your operating system (https://go.dev/doc/install).
  3. Install the program:
go install github.com/BourgeoisBear/amdacli@latest

Help

USAGE
  amdacli [OPTION].. HOSTS [COMMAND]...

Batch API access to Amcrest & Dahua IP cameras.

If COMMAND(s) are given, runs each command against each HOST (i.e. camera),
then terminates. If no commands are provided, starts in interactive mode, where
commands can be supplied from the console.  Ctrl-d exits interactive mode.

OPTION
  -a    always prepend hostname to results (even when there is only one host)
  -c    force colors (even in pipelines)

HOSTS
  Comma-separated list of camera hosts to interact with, where each host takes
  the format 'http(s)://username:password@hostname'.  If the protocol is left
  unspecified, 'http://' is assumed.

  Example: "admin:mypass1@doorcam,https://admin:[email protected]"

COMMAND
  PropertyName
    Get current value of PropertyName via configManager.cgi.
    Example: Multicast.TS[0]

  PropertyName=NewValue
    Set value of PropertyName to NewValue via configManager.cgi.
    Example: Multicast.TS[0].TTL=1

  /RequestURL
    Forward raw request URL to camera API.
    Does not URL-encode parameters like other commands.
    URL parameters must be encoded manually.
    Example: /cgi-bin/global.cgi?action=setCurrentTime&time=2011-7-3%2021:02:32

PUTTING IT TOGETHER
  Interactive Mode:
    amdacli 'user:userpass@mycam'

  Command Mode:
    amdacli 'user:userpass@mycam' 'Multicast.TS[0]' 'AlarmServer.Enable=false'

Useful API Calls

Query

Action Call
Fetch current settings All
Get system info /cgi-bin/magicBox.cgi?action=getSystemInfo
Get software version /cgi-bin/magicBox.cgi?action=getSoftwareVersion
Get device class /cgi-bin/magicBox.cgi?action=getDeviceClass
Get machine name /cgi-bin/magicBox.cgi?action=getMachineName
Get vendor /cgi-bin/magicBox.cgi?action=getVendor
Get language capabilities /cgi-bin/magicBox.cgi?action=getLanguageCaps
Get current time /cgi-bin/global.cgi?action=getCurrentTime
Get encode config capability /cgi-bin/encode.cgi?action=getConfigCaps[&channel=<chan_num>]
Get recording capability /cgi-bin/recordManager.cgi?action=getCaps
Get event management capability /cgi-bin/eventManager.cgi?action=getCaps
Get PTZ capability /cgi-bin/ptz.cgi?action=getCurrentProtocolCaps[&channel=<chan_num>]

Alter

Action Call
Reboot /cgi-bin/magicBox.cgi?action=reboot
Shutdown /cgi-bin/magicBox.cgi?action=shutdown
Set current time /cgi-bin/global.cgi?action=setCurrentTime&time=YYYY-M-D%20H:m:s

amdacli's People

Contributors

bourgeoisbear avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.