mirror of
https://github.com/fmhy/bookmarks.git
synced 2026-03-11 08:55:39 +00:00
Automatically remove non-primary Discord invites, X, Telegram and .onion links (#13)
This commit is contained in:
parent
4264db5dc4
commit
826ada0ff4
1 changed files with 6 additions and 0 deletions
|
|
@ -273,6 +273,12 @@ def parse_bookmark_line(line: str) -> Tuple[str, str, str, BookmarkLine | None]:
|
||||||
level1, level2, level3 = hierarchy_match.groups()
|
level1, level2, level3 = hierarchy_match.groups()
|
||||||
matches = url_pattern.findall(line)
|
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
|
# Check if line contains starred content
|
||||||
is_starred = "⭐" in line or "🌟" in line
|
is_starred = "⭐" in line or "🌟" in line
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue