diff options
-rwxr-xr-x | fetch-status.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/fetch-status.py b/fetch-status.py index 26bfb56..9aa2480 100755 --- a/fetch-status.py +++ b/fetch-status.py @@ -35,12 +35,18 @@ profile_post = soup.find("div", attrs={ "data-lb-id": re.compile(r"profile\-post\-\d+") }) +is_loginwall = soup.find("html", class_='has-no-js template-login') != None if profile_post is None: print("Content-Type: text/plain; charset=utf-8") - print("Status: 403") - print() - print("🚨🚨🚨 schizo alert! 🚨🚨🚨") - print("it won't work if you don't expose your profile to the public, sorry") + if is_loginwall: + print("Status: 403") + print() + print("🚨🚨🚨 schizo alert! 🚨🚨🚨") + print("it won't work if you don't expose your profile to the public, sorry") + else: + print("Status: 500") + print() + print("it didn't work for some reason, possibly you don't have any posts on your profile") quit() print("Content-Type: text/html; charset=utf-8") |