Stop recording after specified duration

hightide
Dan Howe 5 years ago
parent 9bb2f864e0
commit 17351683b9

@ -4,6 +4,7 @@ Open an automated selenium webdriver, and download images from Live View mode.
""" """
import os import os
import sys
import time import time
import pytz import pytz
from io import BytesIO from io import BytesIO
@ -160,6 +161,10 @@ def get_next_image(driver, cookies):
if current_time not in t: if current_time not in t:
t.append(current_time) t.append(current_time)
# Check if recording has completed
if t[-1] - t[0] > RECORDING_DURATION:
sys.exit()
# Count images collected # Count images collected
n = len(t) n = len(t)

Loading…
Cancel
Save