Add timeout to mjpeg streams

This commit is contained in:
Paulus Schoutsen 2016-06-18 12:34:39 -07:00
parent 71157dbec9
commit 2508e9f9ff

View File

@ -46,10 +46,9 @@ class MjpegCamera(Camera):
return requests.get(self._mjpeg_url, return requests.get(self._mjpeg_url,
auth=HTTPBasicAuth(self._username, auth=HTTPBasicAuth(self._username,
self._password), self._password),
stream=True) stream=True, timeout=10)
else: else:
return requests.get(self._mjpeg_url, return requests.get(self._mjpeg_url, stream=True, timeout=10)
stream=True)
def camera_image(self): def camera_image(self):
"""Return a still image response from the camera.""" """Return a still image response from the camera."""