fix: Skip unparsable UAs

pull/79/head
Raphaël Vinot 2020-06-25 16:50:57 +02:00
parent cde3d29892
commit b818055f32
1 changed files with 2 additions and 0 deletions

View File

@ -84,6 +84,8 @@ class Lookyloo():
uas = Counter([entry.split('|', 1)[1] for entry in entries])
for ua, count in uas.most_common():
parsed_ua = UserAgent(ua)
if not parsed_ua.platform or not parsed_ua.browser:
continue
if parsed_ua.platform not in to_store:
to_store[parsed_ua.platform] = {}
if f'{parsed_ua.browser} {parsed_ua.version}' not in to_store[parsed_ua.platform]: