fix(latest): read asura cover from coverUrl prop and send Chrome UA
- 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.
This commit is contained in:
@@ -286,9 +286,11 @@ const lnwOngoingFixture = `<script type="application/ld+json">{
|
||||
"creativeWorkStatus": "https://schema.org/ActiveActionStatus"
|
||||
}</script>`
|
||||
|
||||
// Trimmed from https://asurascans.com/comics/chronicles-of-the-demon-faction-f886a8af
|
||||
// (redirected to ...-00dcbf97) on 2026-08-10.
|
||||
const asuraCoverFixture = `<meta property="og:image" content="https://cdn.asurascans.com/asura-images/covers/chronicles-of-the-demon-faction.d4dcb8.webp">`
|
||||
// Trimmed from https://asurascans.com/comics/chronicles-of-the-demon-faction-ce13e3a9
|
||||
// on 2026-12-04. og:image is a social card, not the cover; the cover is the
|
||||
// astro-island coverUrl prop.
|
||||
const asuraCoverFixture = `<meta property="og:image" content="https://asurascans.com/og/comics/chronicles-of-the-demon-faction.jpg">` +
|
||||
`<astro-island props="{"seriesTitle":[0,"Chronicles of the Demon Faction"],"coverUrl":[0,"https://cdn.asurascans.com/asura-images/covers/chronicles-of-the-demon-faction.d4dcb8.webp"]}"></astro-island>`
|
||||
|
||||
// Trimmed from https://demonicscans.org/manga/Catastrophic-Necromancer on 2026-08-10.
|
||||
// The source publishes the raw space in this URL.
|
||||
@@ -321,7 +323,7 @@ func TestCoverFrom(t *testing.T) {
|
||||
wantCover string
|
||||
}{
|
||||
{
|
||||
name: "asura uses published metadata URL",
|
||||
name: "asura reads coverUrl prop, not og social card",
|
||||
site: "asura", body: asuraCoverFixture, wantOK: true,
|
||||
wantCover: "https://cdn.asurascans.com/asura-images/covers/chronicles-of-the-demon-faction.d4dcb8.webp",
|
||||
},
|
||||
@@ -352,10 +354,10 @@ func TestCoverFrom(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "later metadata cover survives empty match",
|
||||
site: "asura",
|
||||
body: `<meta property="og:image" content="">` + asuraCoverFixture,
|
||||
site: "demonic",
|
||||
body: `<meta property="og:image" content="">` + demonicCoverFixture,
|
||||
wantOK: true,
|
||||
wantCover: "https://cdn.asurascans.com/asura-images/covers/chronicles-of-the-demon-faction.d4dcb8.webp",
|
||||
wantCover: "https://readermc.org/images/thumbnails/Catastrophic%20Necromancer.webp",
|
||||
},
|
||||
{
|
||||
name: "page without cover is empty",
|
||||
|
||||
Reference in New Issue
Block a user