fix: Delete duplicate validate_url method

This commit is contained in:
Suraj Shetty 2021-05-17 22:09:19 +05:30 committed by GitHub
parent 75ea09f9df
commit 8c8291ae38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -846,11 +846,3 @@ def groupby_metric(iterable: typing.Dict[str, list], key: str):
for item in items:
records.setdefault(item[key], {}).setdefault(category, []).append(item)
return records
def validate_url(url_string):
try:
result = urlparse(url_string)
return result.scheme and result.scheme in ["http", "https", "ftp", "ftps"]
except Exception:
return False