bitwarden #43
1 changed files with 8 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue