betterUserDetection

This commit is contained in:
SpudGunMan
2024-10-05 16:09:04 -07:00
parent 5434228df0
commit 34077c6818
2 changed files with 8 additions and 2 deletions
+4 -1
View File
@@ -151,7 +151,10 @@ def parse_log_file(file_path):
log_data['shameList'].insert(0, line)
# get the user who sent the message
user_match = re.search(r'From: (\w+)', line)
if 'To: ' in line:
user_match = re.search(r"From: '([^']+)'(?: To:|$)", line)
else:
user_match = re.search(r"From: (.+)$", line)
if user_match:
log_data['unique_users'].add(user_match.group(1))
+4 -1
View File
@@ -160,7 +160,10 @@ def parse_log_file(file_path):
log_data['shameList'].insert(0, line)
# get the user who sent the message
user_match = re.search(r'From: (\w+)', line)
if 'To: ' in line:
user_match = re.search(r"From: '([^']+)'(?: To:|$)", line)
else:
user_match = re.search(r"From: (.+)$", line)
if user_match:
log_data['unique_users'].add(user_match.group(1))