Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add KLMangaSH #976

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Add KLMangaSH #976

wants to merge 12 commits into from

Conversation

MikeZeDev
Copy link
Contributor

web/src/engine/websites/KLMangaSh.ts Outdated Show resolved Hide resolved
web/src/engine/websites/KLMangaSh.ts Outdated Show resolved Hide resolved
web/src/engine/websites/KLMangaSh.ts Outdated Show resolved Hide resolved
'X-Requested-With': 'XMLHttpRequest',
}
});
let { img_index, mes, going } = await FetchJSON<PageResult>(request);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The FetchPages method must avoid making too many requests.
Either parallelize the requests, or better move the logic to FetchImage.

Copy link
Contributor Author

@MikeZeDev MikeZeDev Jan 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ikr, but we DONT KNOW the real number of pages so both of your solutions are impossible.
The real number of pages is known once the website api return going = 0 ie. after the loop.

And we cant wait for the website to finish (using PageSinglePageJS) as they put a 1 second delay between requests, it will be way too long anyway.

Crappy website coding.

Copy link
Contributor

@ronny1982 ronny1982 Jan 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe there are some hints in RawLazy since it seems to use the same WordPress Theme

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've checked rawlazy before submitting that PR, since i saw the similarities. Rawlazy is simply using lazy loading, with one img element per page. Here we have nothing afaik.

Copy link
Contributor Author

@MikeZeDev MikeZeDev Jan 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean there is a dirty way. Make the request once, you get first two pages.
Then we have the page folder.

hoster.com/path/number.extension.

Since the pages urls follow a pattern we could send HEAD requests while incrementing number.
Should i go this way?

Copy link
Contributor

@ronny1982 ronny1982 Jan 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May find the last page by using divide and conquer algorithm, within 6 requests it would be possible to find the last API call which provides a non empty content (assuming there are < 128 pages).
See: ScanVFOrg

You may leave as is for now, may take a look into it later

web/src/engine/websites/KLMangaSh.ts Outdated Show resolved Hide resolved
web/src/engine/websites/KLMangaSh.ts Outdated Show resolved Hide resolved
@ronny1982
Copy link
Contributor

The filenames should have the same casing, either KLMangaSh or KLMangash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants