chg: dirty improve default UA

pull/406/head
Raphaël Vinot 2022-05-05 16:30:52 +02:00
parent fa3d84da81
commit e4a2b0752c
1 changed files with 1 additions and 1 deletions

View File

@ -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,