From 17351683b97410e4c0e7e82359797d662e06d9f4 Mon Sep 17 00:00:00 2001 From: Dan Howe Date: Thu, 28 Nov 2019 11:40:24 +1100 Subject: [PATCH] Stop recording after specified duration --- spectur_live_view.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spectur_live_view.py b/spectur_live_view.py index 390b99a..f74a0ed 100644 --- a/spectur_live_view.py +++ b/spectur_live_view.py @@ -4,6 +4,7 @@ Open an automated selenium webdriver, and download images from Live View mode. """ import os +import sys import time import pytz from io import BytesIO @@ -160,6 +161,10 @@ def get_next_image(driver, cookies): if current_time not in t: t.append(current_time) + # Check if recording has completed + if t[-1] - t[0] > RECORDING_DURATION: + sys.exit() + # Count images collected n = len(t)