pyaarlo icon indicating copy to clipboard operation
pyaarlo copied to clipboard

Possible to download videos from base station storage?

Open phene opened this issue 3 years ago • 10 comments

Is it possible to download video files saved to the base station using this library?

phene avatar Jan 18 '22 00:01 phene

I can use this library to do a lot of things with my Arlo cameras, but unfortunately, it doesn't seem to have any functions to download the videos stored on the base station. Another user came up with a proof of concept here: https://github.com/jesserockz/python-arlo-ratls-poc It was apparently written before the change to using 2FA security, so I haven't been able to make it work. I've tried to incorporate it into this library on my own but haven't been successful due to my lack of python knowledge.

As a workaround, I bought a WIFI storage card and use it in my base station. I've written a program that polls the SD card for new files and downloads them to my webserver. It is quite a kludge. This is not ideal but at least I can view the videos.

Jeff-Rand avatar Jan 18 '22 11:01 Jeff-Rand

Thanks for the lead! I bet I can get that working with this library.

phene avatar Jan 18 '22 21:01 phene

Let me know how this goes. I want to get this integrated into Pyarlo - or made a requirement so I can hook into it - I've just been busy elsewhere for the last few weeks.

twrecked avatar Jan 21 '22 12:01 twrecked

I actually got this working to the point of automatically downloading videos from my base station, but I suspect there's some refactoring that needs to be done to better fit with the existing code base. I'll try to clean it up a bit this weekend and submit a PR.

Through this I learned that not all of my recordings are being uploaded to the cloud...

phene avatar Jan 21 '22 17:01 phene

Sounds awesome, I would love to get rid of my external WiFi solution. And you are correct about some recordings not uploading to the cloud. I had the same issue and decided to get the recordings straight from the base station and eliminate the need to pay for the cloud. I've been running without a cloud subscription for a year now.

Jeff-Rand avatar Jan 21 '22 17:01 Jeff-Rand

I just had a chance to try phene's support-ratls branch, but I'm getting ModuleNotFoundError: No module named 'cryptography'

Could someone point me to where I can find the cryptography module on GitHub? Sorry, I'm a total newb.

Jeff-Rand avatar Jan 27 '22 12:01 Jeff-Rand

I just added it to the requirements.txt -- sorry about that!

https://pypi.org/project/cryptography/

phene avatar Jan 27 '22 17:01 phene

Thanks! I have cryptography installed now and I tried your example. I get the messages: Connecting to base station Arlo Base: A283087RA0E9F Downloading media from Arlo Base... request-error=URLError

followed by a long error message ending in: line 321, in _fetch_library if "data" in data: TypeError: argument of type 'NoneType' is not iterable

Jeff-Rand avatar Jan 27 '22 18:01 Jeff-Rand

@Jeff-Rand are there any days in which you don't have videos within the library_days period? I've pushed a fix for that specific error, but I'm concerned about the details of that URLError.

Consider adding self._arlo.warning(f"Downloading {self.video_url} to {filename}...") to the top of both download_video methods in media.py. I wonder if you have non-2k videos on your base station, which is causing it to load the wrong object. If you can send me some some of the output, I could probably mitigate it.

Also, can we move this discussion to the PR?

phene avatar Jan 27 '22 19:01 phene

@Jeff-Rand I've updated the branch to support non-2k videos on the base station.

phene avatar Jan 27 '22 20:01 phene