diff --git a/backend/internal/latest/browser.go b/backend/internal/latest/browser.go index 31ce28e..ba01bd0 100644 --- a/backend/internal/latest/browser.go +++ b/backend/internal/latest/browser.go @@ -44,10 +44,11 @@ var comixSeriesPathRe = regexp.MustCompile(`^/title/[^/?#]+/?$`) // sync that break silently and separately. The browser's own cookie jar // persists across polls, so the challenge is solved once every few hours. // -// The two sites differ in how the chapter list is read: kagane serves it from -// a JSON API that must be called from inside the page (so the request carries -// the clearance cookie), while novelfull renders it into the HTML so the -// cleared DOM is the payload. +// The three sites differ in what a cleared tab is asked for: kagane fetches a +// JSON API from inside the page (the list exists nowhere else), comix fetches +// its own Series URL from inside the page (the served HTML carries the facts, +// and rendering the SPA costs ~65 requests instead of one), and novelfull +// renders its list into the HTML so the cleared DOM is the payload. type BrowserFetcher struct { allocCtx context.Context cancel context.CancelFunc @@ -91,10 +92,9 @@ func (f *BrowserFetcher) Close() { } // Get navigates to seriesURL, lets any challenge resolve, then reads the -// payload the Site's registry entry describes — kagane's chapter-list API from -// inside the page so the request carries the clearance cookie, novelfull's -// served HTML. The returned body is whatever the Site's chapter list lives in, -// which is what the entry's LatestChapter parse expects. +// payload the Site's registry entry describes (the shapes are listed on +// BrowserFetcher). The returned body is whatever the Site's chapter list lives +// in, which is what the entry's LatestChapter parse expects. func (f *BrowserFetcher) Get(ctx context.Context, seriesURL string) (string, int, error) { var body string // Sorted order (browserBackedSites sorts) makes dispatch deterministic: diff --git a/backend/internal/latest/sites.go b/backend/internal/latest/sites.go index 6c4d3ac..12009b1 100644 --- a/backend/internal/latest/sites.go +++ b/backend/internal/latest/sites.go @@ -47,9 +47,9 @@ type browserRead struct { // Done reports whether the payload arrived. Done func(body string) bool // Fallback allows the plain-TLS fetcher when no browser is configured. - // False skips the Site instead. kagane is false — a plain fetch would - // only ever retrieve a challenge page — and novelfull is true, because - // its challenge is a live time-varying fact (AGENTS.md). + // False skips the Site instead. kagane and comix are false — a plain fetch + // would only ever retrieve a challenge page — and novelfull is true, + // because its challenge is a live time-varying fact (AGENTS.md). Fallback bool } diff --git a/backend/internal/latest/sites_test.go b/backend/internal/latest/sites_test.go index c852020..989aeb0 100644 --- a/backend/internal/latest/sites_test.go +++ b/backend/internal/latest/sites_test.go @@ -44,7 +44,10 @@ const challengeFixture = `