pytapo
pytapo copied to clipboard
Successfully downloaded C420 camera recordings.
I have successfully downloaded the video recorded by the C420 via the H200 Hub.
Unfortunately, I could not achieve this with the current code as it is, and a few modifications were necessary.
Here is the code I modified.
https://github.com/GracefulTabby/pytapo https://github.com/GracefulTabby/pytapo/commit/e144ae8e1f9729375b3cf4ae99e2fa2173d5ba65 https://github.com/GracefulTabby/pytapo/blob/main/experiments/DownloadRecordingsViaHub.py
I am not good at writing clean code like you guys.
If possible, can someone create a pull request as a good code?
Of course, it can be used as is. I have successfully backed up my camera with this code.
I was able to work with the latest firmware.
C420 : V1.27 Build 20230426 rel.34233
H200 : 1.2.18 Build 20230510 rel.65350
I have tried the following and got to this point. I put a proxy (mitmproxy) between the iPhone and the H200 and monitored between port 443 and port 8800.
Basically, everything is communicated through the Hub, specifying the ChildID to the Hub.
To get a list of recorded videos, the C420 seemed to use searchVideoWithUTC
and searchDetectionList
while other cameras seemed to use searchVideoOfDay
.
I have made sure to use getRecordingsUTC when C420 is used for the camera.
Also, when retrieving the stream, it seems necessary to give a query parameter instead of a POST parameter.
Something called PlayerID also needs to be included in the query parameter or header, but this was a constant value when communicating between the iPhone and H200.
It is probably the UUID assigned to the Tapo account.
For some reason, this PlayerID also worked with a randomly generated UUID. There does not appear to be any particular check.
This is as far as I was able to go with my capabilities.