Skip to content

Commit

Permalink
Added more documentation, allowed for empty passwords
Browse files Browse the repository at this point in the history
Signed-off-by: Edwin Hermans <edwin@madtech.cx>
  • Loading branch information
madeddie committed Sep 25, 2018
1 parent df1e4c4 commit 800d365
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
27 changes: 27 additions & 0 deletions README.md
Expand Up @@ -34,4 +34,31 @@ In the `examples` directory you'll find some implementation examples.

- `retrieve_stream_settings.py` loads input and output settings for one or more encoders and prints them and writes them to a json file.

Tested platforms
----------------

This code has been tested against the following devices:

- MultiStreamer DIG/IP
- Brutus II
- Brutus III

If you have tested this on another device, please let me know.

How to enable API
-----------------

To enable the REST API on your DVEO device, follow these steps:

1. Log in to web interface.
2. Click on the `SYSTEM SETUP` tab.
3. Open the `Web Server Setup` menu on the left.
4. Select the `API Web Server` submenu.
5. Check the `Enable API Web Server` box.
6. If you choose to set `Enable User Security` to `Yes`:

Fill in a password at `API User Password (apiuser)`.
7. Click the `Update` button.
8. `Restart` the service in the `Service Control` menu to the right. If it's stopped it'll be started.

[dveo]: https://dveo.com/
8 changes: 6 additions & 2 deletions dveo/api.py
Expand Up @@ -15,7 +15,8 @@ class API:
"""Instantiate a single DVEO API container object.
:param str address: IP address or hostname of encoder.
:param str password: Password for the apiuser account.
:param str password: Password for the apiuser account, if user security is disabled
anything is valid, like ''.
:param str username: (optional) apiuser username is usually locked to `apiuser`.
:param port: (optional) Port number configured for the API webserver,
defaults to `25599`.
Expand All @@ -40,7 +41,10 @@ def __init__(
self.address = address
self.port = port
self.username = username
self.password = password
if not password:
self.password = ""
else:
self.password = password
if data_format not in ("xml", "json"):
# TODO: raise some error
sys.exit("Invalid data_format set, use either xml or json.")
Expand Down

0 comments on commit 800d365

Please sign in to comment.