mirror of
https://github.com/ThePhaseless/Byparr.git
synced 2025-03-15 09:50:20 +08:00
check if url is valid
This commit is contained in:
parent
4bb8960cad
commit
a09272662b
7
main.py
7
main.py
@ -51,11 +51,16 @@ def read_item(request: LinkRequest) -> LinkResponse:
|
|||||||
start_time = int(time.time() * 1000)
|
start_time = int(time.time() * 1000)
|
||||||
# request.url = "https://nowsecure.nl"
|
# request.url = "https://nowsecure.nl"
|
||||||
logger.info(f"Request: {request}")
|
logger.info(f"Request: {request}")
|
||||||
|
|
||||||
|
# Check is string is url
|
||||||
|
if not (request.url.startswith("http://") or request.url.startswith("https://")):
|
||||||
|
return LinkResponse.invalid(request.url)
|
||||||
|
|
||||||
response: LinkResponse
|
response: LinkResponse
|
||||||
|
|
||||||
# start_time = int(time.time() * 1000)
|
# start_time = int(time.time() * 1000)
|
||||||
with SB(
|
with SB(
|
||||||
uc=True, locale_code="en", test=False, ad_block=True, xvfb=consts.USE_XVFB
|
uc=True, locale_code="en", test=False, ad_block=True, xvfb=consts.USE_XVFB, headless=True
|
||||||
) as sb:
|
) as sb:
|
||||||
try:
|
try:
|
||||||
sb: BaseCase
|
sb: BaseCase
|
||||||
|
Loading…
x
Reference in New Issue
Block a user