f
This commit is contained in:
@@ -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 []
|
||||
|
||||
Reference in New Issue
Block a user