Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

pytapo

Latest version: v3.4.39

Overview

Last scanned
23 Nov 2026
Published
23 Nov 2026
PyPI package Publisher: max007
496 Stars
104 Forks
13 Versions
350.7K Downloads
Python Repo language

Scan summary

pytapo was last scanned on 23 Nov 2026 at version 3.4.39. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 13 versions; the latest 5 were published within 3 days (21–23 Nov 2026).
  • Findings: No rules fired in version 3.4.39.
  • Downloads: 350,671 downloads.

Versions

13 versions published
Versions and the rules that fired in each
VersionPublishedStatus
3.4.39 LATEST 23 Nov 2026 No rules fired
3.4.38 21 Nov 2026 No rules fired
3.4.37 21 Nov 2026 No rules fired
3.4.36 21 Nov 2026 Not shown
3.4.35 21 Nov 2026 Not shown

No rules fired in 3.4.39

Findings

Findings for v3.4.39. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 3.4.39; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

PyTapo

Python library for communication with Tapo Cameras.

Used inside Home Assistant Integration HomeAssistant-Tapo-Control.

Pre-Requirements

  • Python3.13
  • PIP modules installed

Install:

python3 -m pip install pytapo

Usage examples:

Initiate library:
from pytapo import Tapo

user = "" # user you set in Advanced Settings -> Camera Account
password = "" # password you set in Advanced Settings -> Camera Account
host = "" # ip of the camera, example: 192.168.1.52

tapo = Tapo(host, user, password)

print(tapo.getBasicInfo())

Authentication

Depending on your camera model and firmware version, the authentication method varies.

Normally you should be able to authenticate using the "camera account" created via the Tapo App (Settings > Advanced settings > Camera account).

In case of a similar stack trace:

Traceback (most recent call last):
  File "/home/user/Projects/pytapo/pytapo/__init__.py", line 41, in __init__
    self.basicInfo = self.getBasicInfo()
  File "/home/user/Projects/pytapo/pytapo/__init__.py", line 232, in getBasicInfo
    return self.performRequest(
  File "/home/user/Projects/pytapo/pytapo/__init__.py", line 95, in performRequest
    self.ensureAuthenticated()
  File "/home/user/Projects/pytapo/pytapo/__init__.py", line 61, in ensureAuthenticated
    return self.refreshStok()
  File "/home/user/Projects/pytapo/pytapo/__init__.py", line 80, in refreshStok
    raise Exception("Invalid authentication data")
Exception: Invalid authentication data

Attempt to authenticate using admin as user and your TP-Link cloud account password as password.

Some newer firmware (for example Tapo C200 5.0 on 1.4.6) no longer accepts that login and answers with -40211. These cameras use a SPAKE2+ login instead, which pytapo detects and uses automatically. It needs your TP-Link cloud account password, passed either as password or as cloudPassword:

tapo = Tapo(host, "admin", password, cloudPassword=cloud_password)

Downloading Recordings

Integration supports downloading recordings saved on camera's SD card.

See example script. You need to call it with following ENV values:

  • HOST: IP Address of your camera
  • PASSWORD_CLOUD: Tapo cloud account password, it is required to access the recordings, everything is still local
  • OUTPUT: Directory where you wish to save all the recordings
  • DATE: Date for which to download recordings in format of YYYYMMDD, for example 20230221.

You also need to have ffmpeg installed as that is used for converting the streams to watchable file.

Performance notes

Recordings are downloaded through the camera's encrypted streaming protocol (/stream). The camera does not expose the raw MP4 files directly, so a true "file copy" is not possible; the stream is AES-decrypted and the resulting MPEG-TS data is remuxed into an MP4 container by ffmpeg (the video track is copied as-is, the audio track is re-encoded to AAC).

Two stream requests exist for this. By default the Downloader sends the download request, the one the Tapo app sends when you tap download on a recording: the camera delivers the clip as fast as the link allows (about 10x realtime on Wi-Fi), with the full frame rate and the audio, and ends the stream itself at end_time. The older playback request plays the recording at realtime speed and keeps going past end_time, so a one minute clip takes a minute to download. If a camera does not accept the download request, the Downloader falls back to playback on its own.

The camera also keeps a thumbnail for every recording on the SD card (the picture the Tapo app shows in its playback list). You can fetch it without downloading the clip:

from pytapo.media_stream.snapshot import getRecordingSnapshot, getRecordingSnapshots

jpeg = await getRecordingSnapshot(tapo, recording["startTime"])      # bytes, or None
async for jpeg in getRecordingSnapshots(tapo, [r["startTime"] for r in recordings]):
    ...                                                               # one media session for all

Only recordings triggered by a detection have one; for a timed (continuous) recording the camera stays silent until the timeout, so filter on video_type first.

The same request also gives a picture of what the camera sees right now, without RTSP or ffmpeg:

from pytapo.media_stream.snapshot import getSnapshot

jpeg = await getSnapshot(tapo)      # bytes (640x360 on a C510W, about 0.2 s), or None

You can tune the download behavior with the following Downloader parameters:

  • output: mp4 (default, remuxed with ffmpeg) or ts to keep the MPEG-TS exactly as the camera sends it, no ffmpeg involved for the file itself. VLC and most players read it directly, audio included.
  • method: download (default) or playback, see above.
  • window_size: Affects throughput and stability. Higher values usually download faster but can cause some cameras to stop responding. Common values are 50 (stable) or 200 (default).
  • progressInterval: Minimum time in seconds between progress updates (default 1.0). Increasing this value reduces CPU overhead because the library no longer runs an ffprobe subprocess on every chunk just to report progress. Use progressInterval=0 to restore the previous per-chunk behavior.
  • stall_timeout: Seconds to wait for data before treating the stream as stalled and retrying (default 120).

Two-way audio and native WebRTC

Use pytapo.media_stream.talk.Talk as an async context manager and call await talk.write(audio) with paced mono G.711 A-law audio at 8 kHz. A configured cloud password is required. To play a file or URL instead, call await talk.play(source) inside that context. This requires FFmpeg and sends audio at its playback rate. Pass on_interrupt=stop_playback to Talk to let live talk stop the playback session.

For native WebRTC, install pytapo[webrtc] and use pytapo.media_stream.webrtc.WebRTCSession: call answer(offer_sdp), forward ICE candidates with add_candidate(candidate), and call close() when the viewer leaves. Sessions using the same controller and stream settings share their camera input; the last close() releases it. Direct streaming requires FFmpeg.

Contributions:

Contributions to pytapo are welcomed.

By creating a PR you acknowledge and agree that you are not breaking any TOS, law and/or have a permission to provide and share the code changes.

Owner of this repository is not legally responsible for any PRs or code changes to this project created by 3rd parties.

When you make a new change to the code base, make sure to have 100% unit test coverage, see below for more information about tests.

Test instructions

Set the following environment variables:

PYTAPO_USER - user you set in Advanced Settings -> Camera Account

PYTAPO_PASSWORD - password you set in Advanced Settings -> Camera Account

PYTAPO_IP - ip of the camera, example: 192.168.1.52

Install pre-commit and tox from pip.

Run pre-commit install and pre-commit install -t pre-push.

Then run tox to run all the tests.

Linters are ran on every commit.

Tests are ran on push.

Your camera may do all the actions supported by this library, including, but not limited to, move, change privacy mode and reboot while tests are running. Camera does not format SD card during tests.

After the tests are done, your camera should be in the initial state.

Thank you

FAQ

See https://github.com/JurajNyiri/HomeAssistant-Tapo-Control?tab=readme-ov-file#troubleshooting--faq

Disclaimer

Pytapo is an unofficial module for achieving interoperability with Tapo cameras.

Author is in no way affiliated with Tp-Link or Tapo.

All the api requests used within the library are available and published on the internet (examples linked above) and this module is purely just a wrapper around those https requests.

Author does not guarantee functionality of this library and is not responsible for any damage.

All product names, trademarks and registered trademarks in this repository, are property of their respective owners.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • pypi-releases pytapo

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Microsoft's Official agent framework Hijacked
AI & VibeSec

BREAKING: Hijacked Releases of Microsoft’s Official agent-framework Steals Azure and CI Credentials

Copy of Template Design OX Blog (3)
Research

Ruby2Shell: Ruby Memory Corruption Flaws Expose Applications to Remote Code Execution, But is it an Actual Risk?

Frame 2085668439 (1)
Group 1261154229