diff options
author | garret <garret@airmail.cc> | 2024-07-02 16:19:48 +0100 |
---|---|---|
committer | garret <garret@airmail.cc> | 2024-07-02 18:23:35 +0100 |
commit | e7b3f87211253fd7b98ddaddc05a364890415f6b (patch) | |
tree | ce34bbec053d1886e37fefc267970476d11bd41d /fetch-status.py | |
parent | 20709f327345010469dbf370dd60e32fd97c6278 (diff) | |
download | agora-status-e7b3f87211253fd7b98ddaddc05a364890415f6b.tar.gz agora-status-e7b3f87211253fd7b98ddaddc05a364890415f6b.tar.bz2 agora-status-e7b3f87211253fd7b98ddaddc05a364890415f6b.zip |
detect cloudflare block
Diffstat (limited to 'fetch-status.py')
-rwxr-xr-x | fetch-status.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fetch-status.py b/fetch-status.py index 9aa2480..88e3bb7 100755 --- a/fetch-status.py +++ b/fetch-status.py @@ -36,6 +36,7 @@ profile_post = soup.find("div", attrs={ }) is_loginwall = soup.find("html", class_='has-no-js template-login') != None +is_cloudflare_block = soup.find("title").text == "Just a moment..." if profile_post is None: print("Content-Type: text/plain; charset=utf-8") if is_loginwall: @@ -43,6 +44,11 @@ if profile_post is None: print() print("🚨🚨🚨 schizo alert! 🚨🚨🚨") print("it won't work if you don't expose your profile to the public, sorry") + elif is_cloudflare_block: + print("status: 403") + print() + print("blocked by cloudflare :(") + print("i've found it to work from my home ip, probably this is hosted on a datacentre one...") else: print("Status: 500") print() |