Skip to content

Request forbidden on type=cameras #164

Description

@anoriel

Hi everyone,

I tried to add another instance of MDAH with a Domoticz user with only some devices.
It seems that this user can't access to json.html?type=cameras with a 403 http error so I have update his own instance file mdah.js with this :

function DevCamera() {
var url = getURL() + "?type=cameras&rid=";
var res = requester('GET', url);
if(res.statusCode == 403){
return [];
}
var data = JSON.parse(res.body.toString('utf-8'));
var combo = [];
if (typeof data.result !== 'undefined' && data.result !== null) {
for (var i = 0; i < data.result.length; i++) {
var myfeed = {"id": "C"+i, "name": data.result[i].Name, "type": "DevCamera", "room": "Switches"};
var params = [];
params.push({"key": "localjpegurl", "value": data.result[i].ImageURL});
myfeed.params = params;
combo.push(myfeed);
}
}
return (combo);
};

The lines added are :

if(res.statusCode == 403){
return [];
}

If anyone have another solution...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions