Hi,
Your snapshot.php script is not working as is with at least wanscam, imou, d-link ip cameras.
But if you add
curl_setopt($curl_handle, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
right before the lines
curl_setopt($curl_handle, CURLOPT_USERPWD, [...]
then is works very well.
Thanks and regards,