fix empty regex

This commit is contained in:
insert 2025-06-01 12:22:41 -04:00
parent a35f66c387
commit 95a68cfc46
Signed by: insert
GPG key ID: A70775C389ACF105

View file

@ -184,7 +184,7 @@ def video_check(info, *, incomplete):
vid_details["channel"] = info.get("channel")
print(info.get("channel"))
print(info.get("title"))
banned_video = re.compile(os.getenv("BLOCK_REGEX",""), re.IGNORECASE).findall(f"{vid_details['title']} {vid_details['channel']}")
banned_video = re.compile((os.getenv("BLOCK_REGEX","^\b$") if os.getenv("BLOCK_REGEX","^\b$") != "" else "^\b$"), re.IGNORECASE).findall(f"{vid_details['title']} {vid_details['channel']}")
if (duration and duration >= ((float(os.getenv("MAX_MIN")) * 60) + 480)) or banned_video:
return "video too long" #TODO why is this an issue if its the second video played