Some checks failed
format / build (push) Failing after 6s
Signed-off-by: ngn <ngn@ngn.tf>
17 lines
388 B
Python
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
|