Skip to content

Commit

Permalink
Special rule for squarespace.com
Browse files Browse the repository at this point in the history
  • Loading branch information
spirillen committed Dec 21, 2024
1 parent 56edd20 commit b386c54
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion PyFunceble/checker/availability/extras/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ def __init__(self, status: Optional[AvailabilityCheckerStatus] = None) -> None:
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)],
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 @@ -228,6 +230,25 @@ def handle_imgur_dot_com(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 b386c54

Please sign in to comment.