fix(subscribestar): route .art creators to .adult; clear source failure on disable
Two pre-merge fixes: 1. SubscribeStar .art age wall: the 18+ cookie doesn't clear the age gate on the .art domain (keeps 302'ing to /age_confirmation_warning even with the cookie — Elasid #54116), but the same creator is reachable on .adult where the cookie works. _normalize_ss_host rewrites subscribestar.art → subscribestar.adult at request time (stored Source.url untouched), logged so it's visible in walk logs. .com/.adult pass through. 2. Disabling a source now clears its failure state (last_error, error_type, consecutive_failures) so subs you pause (not paying for) stop lingering as 'failing'. Only the explicit disable clears — an unrelated edit to an already-disabled source leaves state alone. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CDgx8bQS5YrGRK76v8HUnM
This commit is contained in:
@@ -22,6 +22,7 @@ from backend.app.services.subscribestar_client import (
|
||||
SubscribeStarClient,
|
||||
SubscribeStarDriftError,
|
||||
_parse_ss_datetime,
|
||||
_split_creator_url,
|
||||
)
|
||||
from backend.app.services.subscribestar_downloader import SubscribeStarDownloader
|
||||
from backend.app.services.subscribestar_ingester import (
|
||||
@@ -82,6 +83,25 @@ def test_parse_ss_datetime_variants():
|
||||
assert _parse_ss_datetime("nonsense") is None
|
||||
|
||||
|
||||
def test_split_creator_url_rewrites_art_to_adult():
|
||||
# The .art age wall doesn't clear with the 18+ cookie; the same creator is
|
||||
# reachable on .adult (Elasid, event #54116). Requests must route to .adult.
|
||||
base, slug = _split_creator_url("https://subscribestar.art/elasid")
|
||||
assert base == "https://subscribestar.adult"
|
||||
assert slug == "elasid"
|
||||
# www. prefix + trailing path still normalizes the host only.
|
||||
base, slug = _split_creator_url("https://www.subscribestar.art/elasid/posts")
|
||||
assert base == "https://www.subscribestar.adult"
|
||||
assert slug == "elasid"
|
||||
|
||||
|
||||
def test_split_creator_url_leaves_com_and_adult_untouched():
|
||||
assert _split_creator_url("https://subscribestar.adult/sabu")[0] == \
|
||||
"https://subscribestar.adult"
|
||||
assert _split_creator_url("https://www.subscribestar.com/sabu")[0] == \
|
||||
"https://www.subscribestar.com"
|
||||
|
||||
|
||||
def test_date_parses_when_wrapped_in_permalink_anchor():
|
||||
# Image posts wrap the date in an <a> permalink; a plain regex missed them
|
||||
# → null dates (cheunart 2026-06-17). gallery-dl's method handles both.
|
||||
|
||||
Reference in New Issue
Block a user