Skip to main content

SDK for interacting with Dahua NVRs over their peer-to-peer protocol.

Project description

OpenDahua

PyPI - Version

Python SDK for interacting with Dahua NVRs (Network Video Recorders) over their proprietary peer-to-peer protocol.

Installation

You can install OpenDahua with your favorite python package manager!

pip install opendahua

or

uv add opendahua

Usage

[!WARNING] Within the async with DahuaNVR(xxx) as nvr: block you should use async for all IO operations. The peer-to-peer connection might die if you don't do this.

import asyncio
from datetime import datetime, timedelta

from opendahua import DahuaNVR


async def main() -> None:
    async with DahuaNVR("SERIAL_NUMBER_HERE", "USERNAME_HERE", "PASSWORD_HERE") as nvr:
        all_video = await nvr.get_all_video(
            channel=1,
            time_start=datetime.now() - timedelta(days=1),
        )
        
        for video in all_video:
            path = nvr.download_video(video, "videos/")
            
            # Example: videos/ExampleNVR_ch1_20260601135935_20260601140002.dav
            print(f"Video path: {path}")
        
if __name__ == "__main__":
    asyncio.run(main())

Special thanks to

  • khoanguyen-3fc/dh-p2p: The reverse engineering work and proof-of-concept that make this project possible.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opendahua-1.0.3.tar.gz (28.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opendahua-1.0.3-py3-none-any.whl (65.6 kB view details)

Uploaded Python 3

File details

Details for the file opendahua-1.0.3.tar.gz.

File metadata

  • Download URL: opendahua-1.0.3.tar.gz
  • Upload date:
  • Size: 28.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for opendahua-1.0.3.tar.gz
Algorithm Hash digest
SHA256 1550e9951b793eefb3fbde233e7dcdbb2fcc0f1707063bb9d977297755f033a5
MD5 9efebb70b75ceac6830219f8986c74ed
BLAKE2b-256 cb34aebb418180c8b4a83be2af49dc7c05af3a77706b02d41321ae4d286a4853

See more details on using hashes here.

File details

Details for the file opendahua-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: opendahua-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 65.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for opendahua-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fa91a1317350cbd338ccc1c713f039ee210e1293425f9e1f1bfd4c5f7ee9c8da
MD5 904215d4c9f75d00fcce9ebe79edf74f
BLAKE2b-256 ff9329738bc263e18cea5632bf222ed916f9b550a10caa669880cfeb1316235d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page