Advertisement
Guest User

Ring get video url nodejs

a guest
Oct 23rd, 2020
1,277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'use strict';
  2. import { RingApi } from 'ring-client-api'
  3. import fs from 'fs';
  4.  
  5. let configdata = fs.readFileSync('config.json');
  6. let config = JSON.parse(configdata);
  7.  
  8. main()
  9.  
  10. async function main() {
  11.     const ringApi = new RingApi(config);
  12.     const locations = await ringApi.getLocations()
  13.     const loc = locations[0];
  14.  
  15.     var events = await loc.getCameraEvents();
  16.     // console.log(events.events[0]);
  17.     // var recording = await loc.cameras[0].getRecordingUrl(events.events[0].ding_id_str,{ transcoded: true })
  18.     var recording = await loc.cameras[0].getRecordingUrl(events.events[0].ding_id_str)
  19.     console.log(recording);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement