fix pass2bw
This commit is contained in:
parent
fd68579042
commit
49c93c82e0
1 changed files with 8 additions and 1 deletions
|
|
@ -43,13 +43,20 @@ def process_csv(input_file, output_file):
|
|||
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', ' ')
|
||||
new_row['notes'] = re.sub(r'\s+', ' ', new_row['notes']).strip()
|
||||
|
||||
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