Updated the app to handle cooler urls

This commit is contained in:
Boyan 2024-12-08 00:23:17 +01:00
parent f47af5a139
commit b7cd6c331a

View File

@ -84,7 +84,8 @@ def verify_link(link:str) -> bool:
if not link.startswith('http://') and not link.startswith('https://'):
link = 'http://' + link
reg = r'^(https?:\/\/)(([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,})(:\d+)?(\/[a-zA-Z0-9@:%_\+.~#?&//=]*)?$'
return False if not re.match(reg, link) else True
return bool(re.match(reg, link))
@app.route('/form', methods=['GET', 'POST'])
def form():