Question
RobertCordingly opened this issue · 5 comments
Hello, how difficult would it be to write a program that simply downloads all of the recordings automatically to a folder for each camera?
Not too hard.. There is an example piece of nodeJS script in issue 4 (#4) which loops through and displays URLs to each video.. Wouldnt be much of a stretch to take it to the next step..
Have a gander at that... Ive got a few days off soon. I may give it a go :-)
Cool. If you could figure out how to do that it would be really great. I've personally never worked with nodeJS so I'm having trouble figuring out how to run or use your API.
Although, If I can find a way to automatically download the video files then I would be able to write a program thats displays them better, basically just replacing the Ring app. The biggest problem I have with the Ring app is that it's incredibly difficult to go back in time. We have 5 cams that record all the time so to even go back 1 day we have to scroll through the list forever.
It could be so much better with a timeline like interface where scrolling adjusts time rather than a list of recordings. That's the basics of the program that I would like to write.
@RCordingly, did you figure it out? It should be really easy.
First get an auth token by sending a POST to:
POST https://api.ring.com/clients_api/session
Body payload:
device[metadata][device_model]=Test&device[metadata][device_name]=Test&device[metadata][resolution]=800x600&device[metadata][app_version]=1.3.810&device[metadata][app_instalation_date]=2017-08-11+22%3A16%3A45Z&device[metadata][manufacturer]=Test&device[metadata][device_type]=tablet&device[metadata][architecture]=x64&device[metadata][language]=en&device[os]=windows&device[hardware_id]=Test&device[app_brand]=ring
The auth token will be in the JSON response.
Then get the listing of recorded movements by calling:
GET https://api.ring.com/clients_api/doorbots/history?auth_token=authtoken&api_version=9
The JSON response will list all movements. Each movement has an id property. For each of these call:
GET https://api.ring.com/clients_api/dings/id/recording?auth_token=authtoken&api_version=9
This will return you a HTTP/1.1 302 Found with in the Location header the URL to the AmazonAWS cloud service where the MPEG4 encoded recording is stored. Just GET that URL from the Location header in the server response and save the body contents to your disk. There you'll have a playable MPEG4 recording which you can use with any movie player.
Not sure if it makes things easier for you, but I've just coded an API in C# which can download the recordings with just a few lines of code: https://github.com/KoenZomers/RingApi
Just added a simple example that downloads videos from history:
https://github.com/davglass/doorbot/blob/master/examples/download.js