This commit is contained in:
2026-01-12 04:05:52 -08:00
parent 6076ea307b
commit 9981424397
11 changed files with 646 additions and 682 deletions

View File

@@ -1670,16 +1670,23 @@ class HydrusNetwork(Store):
raw_urls: Any = meta.get("known_urls"
) or meta.get("urls") or meta.get("url") or []
def _is_url(s: Any) -> bool:
if not isinstance(s, str):
return False
v = s.strip().lower()
return bool(v and ("://" in v or v.startswith(("magnet:", "torrent:"))))
if isinstance(raw_urls, str):
val = raw_urls.strip()
return [val] if val else []
return [val] if _is_url(val) else []
if isinstance(raw_urls, list):
out: list[str] = []
for u in raw_urls:
if not isinstance(u, str):
continue
u = u.strip()
if u:
if u and _is_url(u):
out.append(u)
return out
return []