fix pass2bw

This commit is contained in:
sid 2026-05-18 16:08:01 +02:00
parent fd68579042
commit 49c93c82e0

View file

@ -42,6 +42,14 @@ def process_csv(input_file, output_file):
for col, default_val in default_values.items():
if col not in new_row:
new_row[col] = default_val
folder = new_row.get('folder', '')
name = new_row.get('name', '')
if folder.startswith('www') and name:
if not name.startswith('http://') and not name.startswith('https://'):
new_row['login_uri'] = f'https://{name}'
else:
new_row['login_uri'] = name
if new_row['notes']:
new_row['notes'] = new_row['notes'].replace('\n', ' ').replace('\r', ' ')
@ -49,7 +57,6 @@ def process_csv(input_file, output_file):
notes = new_row['notes']
if notes:
# Look for pattern: "login: USERNAME"
match = re.search(r'login:\s*(\S+)', notes, re.IGNORECASE)
if match:
username = match.group(1)