Screenshot rein und Uhrzeit aus GPS

This commit is contained in:
2026-05-25 18:13:47 +02:00
parent 11d1a16281
commit 92c51b81ce
6 changed files with 551 additions and 202 deletions
@@ -98,13 +98,30 @@ class Handler(http.server.BaseHTTPRequestHandler):
return urllib.parse.urlsplit(self.path).path
def do_GET(self):
if self.normalized_path() != '/stream.mjpg':
path = self.normalized_path()
if path == '/snapshot.jpg':
frame = get_delayed_frame()
if frame is None:
self.send_error(503)
return
self.send_response(200)
self.send_header('Cache-Control', 'no-cache, private')
self.send_header('Pragma', 'no-cache')
self.send_header('Access-Control-Allow-Origin', '*')
self.send_header('Content-Type', 'image/jpeg')
self.send_header('Content-Length', str(len(frame)))
self.end_headers()
self.wfile.write(frame)
return
if path != '/stream.mjpg':
self.send_error(404)
return
self.send_response(200)
self.send_header('Age', '0')
self.send_header('Cache-Control', 'no-cache, private')
self.send_header('Pragma', 'no-cache')
self.send_header('Access-Control-Allow-Origin', '*')
self.send_header('Content-Type', 'multipart/x-mixed-replace; boundary=frame')
self.end_headers()
fps = 10