Files
flowsint/flowsint-api/app/utils.py
2025-04-18 15:42:19 +02:00

5 lines
219 B
Python

from urllib.parse import urlparse
def extract_domain(url_or_domain: str) -> str:
parsed = urlparse(url_or_domain if "://" in url_or_domain else "http://" + url_or_domain)
return parsed.hostname or url_or_domain