From 826ada0ff42d9b5e144ec21d96db6c27fd927686 Mon Sep 17 00:00:00 2001 From: 5Litt <111200444+5Litt@users.noreply.github.com> Date: Sun, 19 Oct 2025 09:10:57 +0000 Subject: [PATCH] Automatically remove non-primary Discord invites, X, Telegram and .onion links (#13) --- make_fmhy_bookmarks.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/make_fmhy_bookmarks.py b/make_fmhy_bookmarks.py index 5172322..fb787b2 100644 --- a/make_fmhy_bookmarks.py +++ b/make_fmhy_bookmarks.py @@ -273,6 +273,12 @@ def parse_bookmark_line(line: str) -> Tuple[str, str, str, BookmarkLine | None]: level1, level2, level3 = hierarchy_match.groups() matches = url_pattern.findall(line) + # Remove non-primary Discord invites, X, Telegram and .onion links + filters = {"Discord", "X", "Telegram", ".onion"} + for matched_link in matches.copy(): + if matched_link[0] in filters: + matches.remove(matched_link) + # Check if line contains starred content is_starred = "⭐" in line or "🌟" in line