agent crash fix

This commit is contained in:
KatKatKateryna
2024-09-23 11:27:16 +02:00
parent 8bbd50265e
commit 6bf99294db
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
access_log
error_log
error_log*
# Byte-compiled / optimized / DLL files
__pycache__/
+3 -1
View File
@@ -200,7 +200,9 @@ def landing_page():
browser_list = ["Chrome", "Safari", "Firefox", "Edg/", "Trident/"]
print(agent)
if "YaBrowser/" in agent:
if agent is None:
return error_screen("User-Agent not specified")
elif "YaBrowser/" in agent or "yandex" in agent.lower():
raise ValueError("Your browser is not supported.")
for br in browser_list:
if br in agent: