<option value="digest">Digest</option>
</select>
</td>
- <td><span class="help-mark" title="the authentication mode to use when accessing the stream (use Basic instead of Digest if you encounter issues with third party apps)">?</span></td>
+ <td><span class="help-mark" title="the authentication method used by the stream (choose Basic instead of Digest if you encounter issues with third party apps); surveillance credentials will be used">?</span></td>
</tr>
{% endif %}
<tr class="settings-item advanced-setting">
logging.debug('connected to rtsp netcam')
- stream.write('\r\n'.join([
+ lines = [
'OPTIONS %s RTSP/1.0' % url.encode('utf8'),
'CSeq: 1',
- 'User-Agent: motionEye',
+ 'User-Agent: motionEye'
+ ]
+
+ if data['username']:
+ auth_header = 'Authorization: ' + build_basic_header(data['username'], data['password'])
+ lines.append(auth_header)
+
+ lines += [
'',
''
- ]))
+ ]
+
+ stream.write('\r\n'.join(lines))
seek_rtsp()
if data.endswith('200 '):
seek_server()
+ elif data.endswith('401 '):
+ handle_error('authentication failed')
+
else:
handle_error('rtsp netcam returned erroneous response: %s' % data)