Catharsis World: add login to read chapters - #18036
Open
yuuues wants to merge 4 commits into
Open
Conversation
The site now gates chapter pages behind registration: without a session any chapter URL answers HTTP 404 with the theme's "page not found" template, so the HTML never carries the chapter-protector data that Madara needs to resolve the page list. Adds username/password preferences and an interceptor that POSTs to /wp-login.php when the wordpress_logged_in_* cookie is missing, guarded by a ReentrantLock so page prefetching does not fire one login per in-flight request. "testcookie" is deliberately omitted: WordPress only demands the test cookie when the form submits that field, and sending it without having fetched /wp-login.php first makes it reject the login. A 404 on a /serie/ path is translated into an actionable message instead of a bare "HTTP error 404", and retried once with a forced login to recover from an expired session. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Catharsis World started gating chapter pages behind registration. Without a session,
any chapter URL answers HTTP 404 with the theme's "page not found" template, so the
HTML never carries the
chapter-protectorpayload thatMadara.pageListParseneedsto resolve the page list — reading is currently broken for everyone.
This adds username/password preferences and a login interceptor.
How the site behaves
Verified against
catharsisworld.dig-it.info:POST /wp-login.phpwithouttestcookiediv#login_errorreports the unknown username)POST /wp-login.phpwithtestcookie=1and no prior cookiediv#login_error: "cookies are blocked or not allowed"protectornonce='protectornonce='presentImplementation notes
testcookieis deliberately not submitted. WordPress only checks the testcookie when the form sends that field, so omitting it authenticates directly
instead of needing a prior
GET /wp-login.phpjust to pick the cookie up.ReentrantLockwith a double check on the sessioncookie: page prefetching would otherwise fire one login per in-flight request.
/serie/are translated into a "log in" error.Anywhere else — a missing thumbnail, another host — a 404 is left as a real 404.
Since the site answers 404 rather than redirecting to the login form, that case is
indistinguishable from an expired cookie, and this recovers from a stale session or
a changed password without the user having to clear cookies by hand.
div#login_errortext. It is already inSpanish and also covers the notice from the site's Simba TFA plugin, so an account
with 2FA enabled reports why it failed instead of failing silently.
One deliberate deviation from CONTRIBUTING.md
The "Empty Lists vs. Exceptions" rule says a locked or empty chapter should return
emptyList()rather than throwing a hardcoded exception, so the app can show alocalized error. This PR throws
IOExceptioninstead. The reasoning:pageListParsenever runs. There is no emptypage list to return — only a request that failed.
emptyList()surfaces as "no pages found", which gives the reader no hint that anaccount is required. Pointing the user at the credential settings is the entire
point of the change.
src/ar/duskoryvilealready throwsIOExceptionwith a "log in via extensionsettings" message for the same situation, so there is precedent for auth gates
being treated differently from empty chapters.
Happy to switch to a plain
emptyList()if you would rather keep the rule strict.Checklist:
versionCodevalue inbuild.gradle.ktsbaseVersionCodeinbuild.gradle.kts(if updated multisrc theme code)contentWarningconfiguration inbuild.gradle.ktsappropriatelyidif a source's name or language were changedweb_hi_res_512.pngwhen adding a new extension🤖 I was asked to make it possible to register a username and password in order to log
in on the Catharsis World source, and to follow how other extensions that ask for
values do it. This pull request was opened by an AI agent (Claude Code). The site's
login protocol was verified against the live site, and the repository owner built the
extension and confirmed on-device that reading works with credentials configured, and
reviewed the diff before checking the AI-assisted box above.