Closed vonnieda closed 7 years ago
Nevermind on the "how did you capture" question. Got that sorted and now working to determine why recordings not working.
I suspect that something about this API has been blacklisted. I used Charles Proxy to proxy requests from the Ring app, checked some responses and compared them. Overall it all looks basically the same, but when Ring requests history it gets good history IDs back and when this API requests history it gets alllllmost the same IDs, but the last few digits are zero. Almost looks like the IDs are being rounded, or something.
Example: From Ring App:
[{
"id": 6443483651709223703,
"created_at": "2017-07-16T21:27:26.000Z",
"answered": false,
"events": [],
"kind": "motion",
"favorite": false,
"snapshot_url": "",
"recording": {
"status": "ready"
},
"doorbot": {
"id": 276XXXX,
"description": "Front Door"
}
}, {
"id": 6443483561514910487,
"created_at": "2017-07-16T21:27:05.000Z",
"answered": true,
"events": [],
"kind": "ding",
"favorite": false,
"snapshot_url": "",
"recording": {
"status": "ready"
},
"doorbot": {
"id": 276XXXX,
"description": "Front Door"
}
}
From this API:
[
{
"id": 6443483651709224000,
"created_at": "2017-07-16T21:27:26.000Z",
"answered": false,
"events": [],
"kind": "motion",
"favorite": false,
"snapshot_url": "",
"recording": {
"status": "ready"
},
"doorbot": {
"id": 276XXXX,
"description": "Front Door"
}
},
{
"id": 6443483561514911000,
"created_at": "2017-07-16T21:27:05.000Z",
"answered": true,
"events": [],
"kind": "ding",
"favorite": false,
"snapshot_url": "",
"recording": {
"status": "ready"
},
"doorbot": {
"id": 276XXXX,
"description": "Front Door"
}
}
Good catch.. Looks like the number is too big for Javascript to handle it :(
Since I'm just JSON.parse
ing the content, I may have to munge it.. Looking now..
Ah, didn't even consider that! I thought I was looking at the raw responses, though, not the parsed ones. Might be mistaken and can't check for a few days.
On Tue, Jul 25, 2017 at 11:56 AM Dav Glass notifications@github.com wrote:
Good catch.. Looks like the number is too big for Javascript to handle it :(
Since I'm just JSON.parseing the content, I may have to munge it.. Looking now..
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/davglass/doorbot/issues/7#issuecomment-317853788, or mute the thread https://github.com/notifications/unsubscribe-auth/ABIKc0v2npI0k-v7UO2CXfpwSOU2Z150ks5sRkh_gaJpZM4OZa8T .
I'm pretty sure that I was able to reproduce it. The parsed response is rounded by JS since the int
is too big for it. I think I have a working RegExp
that will convert them to String
.
Right now I'm fighting with the 401
that comes back from this API far too often. Seeing if I can work around with with some param changes/re-auth/timers/etc..
Can you give doorbot@2.0.0
a shot? I've refactored it, so your code will need to change. It's all in the readme. But it should fix this and the random 401
errors.
Working great now @davglass, thank you!
Looks like maybe the API for recordings has changed. I get this for every ID:
If you don't have time to fix this, would you mind describing how you captured the original dumps? Maybe I can replicate it and fix it.