block: match directly on url

This commit is contained in:
Iain Learmonth 2022-04-19 14:32:53 +01:00
parent 018494bd58
commit 7747461e60

View file

@ -33,11 +33,10 @@ def check_blocks():
continue continue
for url in results[vp]: for url in results[vp]:
if "cloudfront.net" in url: if "cloudfront.net" in url:
slug = url[len('https://'):][:-len('.cloudfront.net')] print(f"Found {url} blocked")
print(f"Found {slug} blocked")
proxy = Proxy.query.filter( proxy = Proxy.query.filter(
Proxy.provider == "cloudfront", Proxy.provider == "cloudfront",
Proxy.slug == slug Proxy.url == f"https://{url}"
).first() ).first()
if not proxy: if not proxy:
print("Proxy not found") print("Proxy not found")