evaluate --norefresh arg before calling the --getseed branch

This commit is contained in:
strohitv 2025-08-11 14:14:32 +02:00 committed by GitHub
parent 0fc5254a09
commit db62861798
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

24
s3s.py
View File

@ -1844,6 +1844,18 @@ def main():
check_statink_key() check_statink_key()
set_language() set_language()
global DISABLE_REFRESH_RC
DISABLE_REFRESH_RC = None
if rc_value is not None:
try:
DISABLE_REFRESH_RC = int(rc_value)
except ValueError:
print("Number provided for --norefresh must be an integer. Exiting.")
sys.exit(1)
if DISABLE_REFRESH_RC < 0:
print("RC for --norefresh must be 0 or positive! Exiting.")
sys.exit(1)
# i/o checks # i/o checks
############ ############
if getseed and any(re.search("^(--getseed|--skipprefetch|--norefresh|[0-9]+)$", arg) is None for arg in sys.argv[1:]): if getseed and any(re.search("^(--getseed|--skipprefetch|--norefresh|[0-9]+)$", arg) is None for arg in sys.argv[1:]):
@ -1876,18 +1888,6 @@ def main():
print("Minimum number of seconds in monitoring mode is 60. Exiting.") print("Minimum number of seconds in monitoring mode is 60. Exiting.")
sys.exit(0) sys.exit(0)
global DISABLE_REFRESH_RC
DISABLE_REFRESH_RC = None
if rc_value is not None:
try:
DISABLE_REFRESH_RC = int(rc_value)
except ValueError:
print("Number provided for --norefresh must be an integer. Exiting.")
sys.exit(1)
if DISABLE_REFRESH_RC < 0:
print("RC for --norefresh must be 0 or positive! Exiting.")
sys.exit(1)
# export results to file: -o flag # export results to file: -o flag
################################# #################################
if outfile: if outfile: