fix(latest): asura cover fetch always failed #180

Merged
sulthan merged 1 commits from fix/asura-cover-fetch into main 2026-12-04 23:33:41 +07:00
Owner

Summary

Two independent breaks, both measured live 2026-12-04:

 asura cover
-  og:image  -> https://asurascans.com/og/comics/<slug>.jpg   (1200x630 social card, host 403-challenges plain TLS)
+  coverUrl prop (astro-island) -> https://cdn.asurascans.com/asura-images/covers/<slug>.<hash>.webp

 TLSCoverFetcher.Fetch
-  User-Agent: Go-http-client/2.0   -> 403, cf-mitigated: challenge
+  User-Agent: chromeUA             -> 200 image/webp
  • sites.go: new asuraCover; demonic and lightnovelworld keep ogImageCover.
  • cover.go: cover requests send chromeUA.

Evidence

  • Before: Go net/http on the CDN cover with the default UA got 403 text/html with cf-mitigated: challenge. The page's og:image fetched through TLSCoverFetcher got fetch cover: status 403.
  • After: a live end-to-end run did TLSFetcher page fetch (200), then coverFrom("asura") returned the .79fa90.webp CDN URL, then fetchCoverBytes returned 590,774 bytes of image/webp.
  • New TestCoverFetcherSendsBrowserUserAgent: a fake CDN refuses any non-Chrome UA. TestCoverFrom asura case uses the live page shape, og social card plus coverUrl prop.
  • go vet ./internal/latest clean, go test ./internal/latest ok.

Merge Danger

Door: two-way

Blast Radius: asura covers plus the UA on every TLS cover fetch.

Blank asura covers fill on their next poll. A series that already stores a cover address keeps it until a forced poll.

## Summary Two independent breaks, both measured live 2026-12-04: ```diff asura cover - og:image -> https://asurascans.com/og/comics/<slug>.jpg (1200x630 social card, host 403-challenges plain TLS) + coverUrl prop (astro-island) -> https://cdn.asurascans.com/asura-images/covers/<slug>.<hash>.webp TLSCoverFetcher.Fetch - User-Agent: Go-http-client/2.0 -> 403, cf-mitigated: challenge + User-Agent: chromeUA -> 200 image/webp ``` - `sites.go`: new `asuraCover`; demonic and lightnovelworld keep `ogImageCover`. - `cover.go`: cover requests send `chromeUA`. ## Evidence - **Before:** Go `net/http` on the CDN cover with the default UA got `403 text/html` with `cf-mitigated: challenge`. The page's og:image fetched through `TLSCoverFetcher` got `fetch cover: status 403`. - **After:** a live end-to-end run did `TLSFetcher` page fetch (200), then `coverFrom("asura")` returned the `.79fa90.webp` CDN URL, then `fetchCoverBytes` returned 590,774 bytes of `image/webp`. - New `TestCoverFetcherSendsBrowserUserAgent`: a fake CDN refuses any non-Chrome UA. `TestCoverFrom` asura case uses the live page shape, og social card plus `coverUrl` prop. - `go vet ./internal/latest` clean, `go test ./internal/latest` ok. ## Merge Danger **Door:** two-way **Blast Radius:** asura covers plus the UA on every TLS cover fetch. Blank asura covers fill on their next poll. A series that already stores a cover address keeps it until a forced poll.
sulthan added 1 commit 2026-12-04 23:29:15 +07:00
- asura og:image is now a 1200x630 social card on the challenged main host; read the astro-island coverUrl prop instead.
- cdn.asurascans.com challenges Go's default User-Agent; TLSCoverFetcher now sends chromeUA.
sulthan merged commit 743823d67a into main 2026-12-04 23:33:41 +07:00
Sign in to join this conversation.