feat: advanced url processing, whitespaces issue

This commit is contained in:
Terry Geng 2020-03-12 21:04:37 +08:00
parent 2c4e7c3370
commit 4f12a7c903

View File

@ -302,7 +302,7 @@ def get_url_from_input(string):
else:
return False
match = re.search("(http|https)://(.*)?/(.*)", string, flags=re.IGNORECASE)
match = re.search("(http|https)://(\S*)?/(\S*)", string, flags=re.IGNORECASE)
if match:
url = match[1].lower() + "://" + match[2].lower() + "/" + match[3]
return url