diff --git a/.gitignore b/.gitignore index 8064a44..9662100 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +.vscode __pycache__ logins.js \ No newline at end of file diff --git a/README.md b/README.md index 7efac83..315ca1a 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,11 @@ python bitwarden.py Then choose your Bitwarden json export (needs to be unencrypted :c ) and it will open a nice looking website presenting the duplicates in your browser. +## Requirements + +- Python 3.7 at least +- Modern browser (tested with Firefox 88 and Chrome 86) + ## Demonstration ![Demonstration](https://i.imgur.com/PlXPOCT.png) diff --git a/bitwarden.py b/bitwarden.py index 0af5e80..85fd748 100644 --- a/bitwarden.py +++ b/bitwarden.py @@ -23,7 +23,7 @@ # %% Get items and folders from file with open(filename, encoding="utf-8") as f: - data: dict[list[dict]] = json.load(f) + data = json.load(f) folders = data.get("folders", []) items = data.get("items", []) @@ -42,7 +42,7 @@ def domains(entry): def transform(url): match = re.match(r"(\w+:\/\/)?([\w.]+)(\/?.*)", url) if match: - return ".".join(match.group(2).removeprefix("www.").split(".")[-2:]) + return ".".join(match.group(2).split(".")[-2:]) return "" return set(filter(None, (transform(uri.get("uri")) for uri in entry.get("uris", []))))