ups/lib/util.py
ngn ab580d6a18
Some checks failed
format / build (push) Failing after 6s
initial commit
Signed-off-by: ngn <ngn@ngn.tf>
2025-05-02 18:20:24 +03:00

17 lines
388 B
Python

from urllib.parse import urlparse, ParseResult
from typing import List
def validate_url(url: str) -> ParseResult:
try:
parsed = urlparse(url)
if all([parsed.scheme, parsed.netloc]):
return parsed
return None
except Exception:
return None
def validate_list(_list: List[str]) -> bool:
return _list is not None and len(_list) != 0