TheNetsky / extensions-generic-0.8

Common CMS Extensions for Paperback 0.8
https://thenetsky.github.io/extensions-generic-0.8/
18 stars 26 forks source link

Asurascans error on loading a new chapter #35

Closed CoralCarl closed 11 months ago

CoralCarl commented 11 months ago

Asurascans shows Retry or Log Error on chapter load.

[ERROR] [2023-08-13T15:13:26.171Z] [ScrollBasedChapterRenderer:showErrorButton:83] Processing image failed. Processor: WebPProcessor(identifier: "com.yeatse.WebPProcessor"). Processing item: data(251782 bytes). Kingfisher.KingfisherError.processorError(reason: Kingfisher.KingfisherError.ProcessorErrorReason.processingFailed(processor: KingfisherWebP.WebPProcessor(identifier: "com.yeatse.WebPProcessor"), item: Kingfisher.ImageProcessItem.data(251782 bytes)))

Source WITH source version

TheNetsky commented 11 months ago

For all images?

CoralCarl commented 11 months ago

Only the first image, sorry. I thought it didn't load anything at all.

TheNetsky commented 11 months ago

I don't feel like fixing his, it's likely an issue caused by their temp domain.

hyoretsu commented 9 months ago

This is probably the same issue I tried to pinpoint, first image always being bugged and with a similar error to that (only from AsuraScans, not all MangaStream extensions). After following the code, it seems like it's an "issue" with the parser you're using (or to be more precise, something that the ts_reader they use avoids).

For AsuraScans, the pages array (see MangaStreamParser.ts#L147) content is this: (I'm testing on Youngest Marquis ch82, but the first link is also present on the first ch so it's likely the same for all chapters they post)

[
  "https://www.asurascans.com/wp-content/uploads/2021/04/page100-10.jpg",
  "https://asuracomics.gg/wp-content/uploads/custom-upload/80948/82/00_Legendary%20Youngest%20Son%20of%20the%20Marquis%20House%20copy.jpg",
  "https://asuracomics.gg/wp-content/uploads/custom-upload/80948/82/01.jpg",
  "https://asuracomics.gg/wp-content/uploads/custom-upload/80948/82/02.jpg",
  "https://asuracomics.gg/wp-content/uploads/custom-upload/80948/82/03.jpg",
  "https://asuracomics.gg/wp-content/uploads/custom-upload/80948/82/04.jpg",
  "https://asuracomics.gg/wp-content/uploads/custom-upload/80948/82/05.jpg",
  "https://asuracomics.gg/wp-content/uploads/custom-upload/80948/82/06.jpg",
  "https://asuracomics.gg/wp-content/uploads/custom-upload/80948/82/07.jpg",
]

The problem is that first "page" doesn't load anymore, it just redirects to their new website. And if you check what pages actually get rendered, it also isn't among them. Somewhere in their code, they remove that first entry and only leave the other ones.

Tl;dr if you want to fix this, although with a workaround, just change MangaStreamParser.ts#L147 from index.images.map((p: string) => pages.push(encodeURI(p))) to index.images.filter((p: string) => p !== "https://www.asurascans.com/wp-content/uploads/2021/04/page100-10.jpg").forEach((p: string) => pages.push(encodeURI(p))) or if you want to still render the original image even though they aren't, change it to a cached link from Wayback Machine

index.images.forEach((p: string) => {
    if (p === 'https://www.asurascans.com/wp-content/uploads/2021/04/page100-10.jpg') {
        p = `http://web.archive.org/web/20230628132952/${p}`
    }

    pages.push(encodeURI(p))
})

I was gonna PR it, even if it's pretty simple, but you may not want to use this hackish workaround so it's up to you. @TheNetsky