Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions maigret/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ def desc(self):
# ("Checking your browser"), turning blocked probes into false CLAIMED
# hits on absence-only message checks (3dcadforums.com -> eng-tips.com).
'/.stile/challenge': CheckError('Bot protection', 'Stile challenge'),
# A lapsed or suspended site: the host answers HTTP 200 on every path with
# the same page, so a status_code check reads every username as claimed
# (wavedream.wiki: "Account Suspended" page, unshittified.club: Sedo
# for-sale page after the domain expired).
'<title>Account Suspended': CheckError('Site-specific', 'Hosting account suspended'),
'cdn.sedo.com/c7r/domain-details/': CheckError(
'Site-specific', 'Domain is parked for sale (Sedo)'
),
}

PROXY_RECOMMENDATION = (
Expand Down
18 changes: 18 additions & 0 deletions tests/test_error_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,24 @@ def test_pow_challenge_pages_are_bot_protection():
assert pow_js.type == "Bot protection"


def test_suspended_and_parked_sites_are_errors_not_accounts():
# Both answer 200 on every path, so every username would read as claimed.
suspended = detect_error_page(
"<html><head><title>Account Suspended - HostDash</title>", 200, {}, ignore_403=False
)
parked = detect_error_page(
'<script type="module" src="https://cdn.sedo.com/c7r/domain-details/assets/index.js">',
200,
{},
ignore_403=False,
)

assert suspended.type == "Site-specific"
assert "suspended" in suspended.desc
assert parked.type == "Site-specific"
assert "parked" in parked.desc


def test_linkedin_999_is_an_error_not_an_absence():
# LinkedIn serves 999 to blocked clients for existing and non-existing
# profiles alike. Passing it through to the status_code branch reported
Expand Down