Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.3.9: Can't view media (401) #462

Closed
eskey0 opened this issue Nov 17, 2023 · 2 comments
Closed

1.3.9: Can't view media (401) #462

eskey0 opened this issue Nov 17, 2023 · 2 comments
Labels
Fixed Bug has been fixed.

Comments

@eskey0
Copy link

eskey0 commented Nov 17, 2023

Description

I'm having issues with the media playback, Im getting error 401 (that is what HA says) and if I try again it says its downloading, but it is not. I tried changing passwords for cloud and local account, and hard resseting the camera and re-adding it in app and HA. Iam probably missing something important here but I can't figure out

I have a firewall in between the camera and the HA instance, actually with ports 8800, 2020, 443, 554 open from the server to the cam, I tried with all communication allowed without success.

it is a tapo c200, camera in 1.3.9
integration in 5.4.6
I can do playback from the app

https://imgur.com/a/c57vB1Z

Reproduction Steps

1.- Reboot HA
2.- Go to media, camera, any record
3.- Try to play the video and get the error

Expected behavior

Watch the recorded video in the SD card from the cam

If applicable, add error logs.

No response

Device Firmware

1.3.9

Integration Version

5.4.6

Using stream component

No

Does camera work via official integrations?

Yes

Camera has all attributes filled out in developer tools

Yes

HASS Environment

Official image in proxmox VM

Search for similar issues

Yes

Additional information

I can provide any logs or make any tests

@JurajNyiri JurajNyiri changed the title Can't view media (401) 1.3.9: Can't view media (401) Nov 17, 2023
@JurajNyiri
Copy link
Owner

JurajNyiri commented Nov 17, 2023

In firmware 1.3.9 along other things, only for some cameras, they changed 443 communication to use SHA256 encryption instead of MD5 encryption. Sometimes it is MD5, sometimes it is SHA256.
Maybe they changed it for the media stream on 8800 as well.

I tested download with my camera on 1.3.9 and it still works as expected.

We might need to change it in pytapo in many places which currently md5 the admin password to do sha256 instead (and automatically detect correct hashing algorithm)
It would be very hard for me to debug this without a target device to test on, so you could try doing this:

  • Function md5digest in _utils.py
  • hashed_pwd in crypto.py
  • possibly also self.key and self.iv in crypto.py, challenge1 and challenge2 in session.py and finally also self._auth_data["response"] and self._authorization

Let me know how it goes and what you changed (create PR please), then I can automate the detection.

You could also port forward the camera and send me credentials via email so that I can use it to test and develop a fix, that would be the most efficient solution. That is how we implemented control support on 1.3.9 firmware thanks to 2 users sharing their cameras for me to test on.

@JurajNyiri JurajNyiri added the Help wanted Extra attention is needed label Nov 17, 2023
JurajNyiri added a commit that referenced this issue Nov 17, 2023
Fix #462: Can't view media on firmware 1.3.9 using sha256 encryption
@JurajNyiri
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed Bug has been fixed.
Projects
None yet
Development

No branches or pull requests

2 participants