f
This commit is contained in:
@@ -335,7 +335,22 @@ def normalize_urls(value: Any) -> List[str]:
|
||||
" ").replace(",",
|
||||
" ").split():
|
||||
if token:
|
||||
yield token
|
||||
t_low = token.lower()
|
||||
# Heuristic: only yield tokens that look like URLs or common address patterns.
|
||||
# This prevents plain tags (e.g. "tag1, tag2") from leaking into URL fields.
|
||||
is_p_url = t_low.startswith(("http://",
|
||||
"https://",
|
||||
"magnet:",
|
||||
"torrent:",
|
||||
"ytdl://",
|
||||
"data:",
|
||||
"ftp:",
|
||||
"sftp:"))
|
||||
is_struct_url = ("." in token and "/" in token
|
||||
and not token.startswith((".",
|
||||
"/")))
|
||||
if is_p_url or is_struct_url:
|
||||
yield token
|
||||
return
|
||||
|
||||
if isinstance(raw, (list, tuple, set)):
|
||||
|
||||
Reference in New Issue
Block a user