Skip to content

Commit

Permalink
Merge branch 'foreign-affairs-spirillen-rules-squarespace.com' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
funilrys committed Dec 26, 2024
2 parents d43ba86 + d88ff7a commit c47a673
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion PyFunceble/checker/availability/extras/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,16 @@ def __init__(self, status: Optional[AvailabilityCheckerStatus] = None) -> None:
r"\.github\.io$": [(self.switch_to_down_if_status_code, 404)],
r"\.glitchz\.me$": [(self.switch_to_down_if_status_code, 403)],
r"\.godaddysites\.com$": [(self.switch_to_down_if_status_code, 404)],
r"\.hpg.com.br$": [(self.switch_to_down_if_status_code, 404)],
r"\.hpg\.com\.br$": [(self.switch_to_down_if_status_code, 404)],
r"^heylink\.me$": [(self.switch_to_down_if_status_code, 410)],
r"^heyl\.ink$": [(self.switch_to_down_if_status_code, 410)],
r"\.imgur\.com$": [self.handle_imgur_dot_com],
r"\.liveadvert\.com$": [(self.switch_to_down_if_status_code, 404)],
r"\.myhuaweicloudz\.com$": [(self.switch_to_down_if_status_code, 403)],
r"\.skyrock\.com$": [(self.switch_to_down_if_status_code, 404)],
r"\.squarespace.com$": [(self.switch_to_down_if_status_code, 404),
self.handle_squarespace_com,
],
r"\.sz.id$": [(self.switch_to_down_if_status_code, 302)],
r"\.translate\.goog$": [(self.switch_to_down_if_status_code, 403)],
r"\.tumblr\.com$": [(self.switch_to_down_if_status_code, 404)],
Expand Down Expand Up @@ -260,6 +265,25 @@ def handle_vercel_dot_app(self) -> "ExtraRulesHandler":

return self

def handle_squarespace_com(self) -> "ExtraRulesHandler":
"""
Handles the :code:`wordpress.com` case.
.. warning::
This method assume that we know that we are handling a blogspot domain.
"""

regex_squarespace = [r"This site has been deleted by the owner\."]

self.do_on_body_match(
self.req_url,
regex_squarespace,
method=self.switch_to_down,
allow_redirects=True,
)

return self

def __handle_active2inactive(self) -> "ExtraRulesHandler":
"""
Handles the status deescalation.
Expand Down

0 comments on commit c47a673

Please sign in to comment.