From e4a2b0752ce30af04ac09a49b8cf5f9d46a78235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Thu, 5 May 2022 16:30:52 +0200 Subject: [PATCH] chg: dirty improve default UA --- website/web/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/web/__init__.py b/website/web/__init__.py index e60d66d..30a4d98 100644 --- a/website/web/__init__.py +++ b/website/web/__init__.py @@ -803,7 +803,7 @@ def _prepare_capture_template(user_ua: Optional[str], predefined_url: Optional[s user_agents = get_user_agents() # get most frequest UA that isn't a bot (yes, it is dirty.) for ua in user_agents.pop('by_frequency'): - if 'bot' not in ua['useragent'].lower(): + if not any(blockedword in ua['useragent'].lower() for blockedword in ['bot', 'bing']): default_ua = ua break return render_template('capture.html', user_agents=user_agents, default=default_ua,