oae / kaizoku

Self-hosted manga downloader
https://kaizoku.app
MIT License
563 stars 33 forks source link

Getting a lot of "X invalid chapter filter pattern: -1" in mangal #88

Closed Belphemur closed 1 year ago

Belphemur commented 1 year ago

Describe the bug

Hello,

I see a lot of job failing with "X invalid chapter filter pattern: -1"

It seems Kaizoku send a wrong chapter number (I guess because Mangal is weird in its chapter numbering ?).

Error: Command failed with exit code 1: mangal inline --source FlameScans --query The World After the Fall --manga exact --chapters -1 -d
X invalid chapter filter pattern: -1
    at makeError (/app/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/error.js:60:11)
    at handlePromise (/app/node_modules/.pnpm/execa@5.1.1/node_modules/execa/index.js:118:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async downloadChapter (/app/.next/server/pages/api/trpc/[trpc].js:1755:55)
    at async external_bullmq_.Worker.concurrency [as processFn] (/app/.next/server/pages/api/trpc/[trpc].js:530:20)
    at async Worker.processJob (/app/node_modules/.pnpm/bullmq@3.6.2/node_modules/bullmq/dist/cjs/classes/worker.js:370:28)
    at async Worker.retryIfFailed (/app/node_modules/.pnpm/bullmq@3.6.2/node_modules/bullmq/dist/cjs/classes/worker.js:492:24)

Reproduction steps

  1. Add a manga
  2. Download all chapters
  3. Get the error in the jobs

Expected behavior

Don't try to download chapter -1

Additional context

No response

oae commented 1 year ago

Kaizoku uses index from mangal source. Make sure flamescans source's chapter index starts from 1 and not 0. You can check the index with following command

mangal inline --source FlameScans --query "The World After the Fall" --manga exact --chapters all -j
Belphemur commented 1 year ago

Hoo that makes sense.

FlameScans actually have a chapter 0 for all their scans. It's a teaser chapter.

I guess I can simply update the source that I modified from the AsuraScans to avoid the chapter 0.

Unrelated to this issue, but I got some case of corrupt chapters (size of 1 kB), when I run manually the command line, it fixes it. Could Kaizoku do that by default, check the size and retry the job if only a couple of kB ?

Sent from Nine


From: Osman Alperen Elhan @.***> Sent: Tuesday, April 4, 2023 18:00 To: oae/kaizoku Cc: Antoine Aflalo; Author Subject: Re: [oae/kaizoku] Getting a lot of "X invalid chapter filter pattern: -1" in mangal (Issue #88)

Kaizoku uses index from mangal source. Make sure flamescans source's chapter index starts from 1 and not 0. You can check the index with following command

mangal inline --source FlameScans --query "The World After the Fall" --manga exact --chapters all -j

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

oae commented 1 year ago

Normally Mangal should fail if it can't download a chapter. I think it is related to this issue https://github.com/metafates/mangal/issues/135

Also, the current queue system in kaizoku doesn't support rate limiting, so you get a 1kb if the source has request limits. I am in the process of the rewrite to fix this

Belphemur commented 1 year ago

That the thing, mangal doesn't crash, it creates a empty cbz. No error message, no stacktrace, no failed job.