Get Snapshot 401 Unauthorized
Wade-BuildOtto opened this issue · comments
having the same issue with all onvif node packages, none are accepting username:password no matter how I pass it to them including this package as well.
the sample server - has the same issue.
agsh/onvif - same issue
// Initialize the OnvifDevice object device.init().then(() => { // Get the data of the snapshot console.log('fetching the data of the snapshot...'); return device.fetchSnapshot(); }).then((res) => { // Save the data to a file fs.writeFileSync('snapshot.jpg', res.body, {encoding: 'binary'}); console.log('Done!'); }).catch((error) => { console.error(error); });
return Error: 401 Unauthorized
@Wade-BuildOtto : any solution to this ?
I gave up on onvif most camera are running cgi scripts and I just access them directly with authorization digest user:pass but it depends on the unit. amcrest has been working out for me.