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

Set 1 sec/chapter as default download rate #1378

Closed
dteviot opened this issue Jul 11, 2024 · 6 comments
Closed

Set 1 sec/chapter as default download rate #1378

dteviot opened this issue Jul 11, 2024 · 6 comments
Assignees

Comments

@dteviot
Copy link
Owner

dteviot commented Jul 11, 2024

From @gamebeaker

as an idea maybe select a value for Manual Throttle|Delay per chapter in the "default" configuration meaning if someone installs the extension for the first time. The reason is that a lot of sites have a cloudflare protection or something similar. I also know a few pages that if your IP gets on a blocklist they don't send a 4xx code but an empty document. And to get unblocked you have to wait.
If you want to implement it I would set 1 sec/chapter as default.

@Kiradien
Copy link
Collaborator

Just want to tack an addendum on here, it might be worth setting the rate parameter as a parser variable; different sites are 'good' at different speeds, CloudFlare pretty much demands 3-5 seconds depending on the domain.

@dteviot
Copy link
Owner Author

dteviot commented Jul 12, 2024

@Kiradien
I'm going to assume you mean "save value on a per site basis". If I'm wrong please correct.

@Kiradien
Copy link
Collaborator

"Save Value on a per site basis" would be a potential starting point for it, so long as the default for each site was configurable via its respective Parser.js. It's probably the 'best' solution, but also the most complicated.

The 'easiest' alternative is to have an extra object variable in Parser.js. amounting to [Minimum Delay] = 0, and calling Math.max(manualDelayPerChapterValue, this.[Minimum Delay]) before util.sleep.
Then we'd just set this.[Minimum Delay] = 3000-5000 inside the parser for the troublesome cloudflare sites, or longer on other domains that'd require/request it.
Under this option, I'd assume the goal of a 'checkbox' to ignore minimum delay would be desired. Icky front-end stuffs.

The main goal of this issue is to reduce the root cause of many-a-ticket, but the 1-second-delay is a stopgap without extensibility. There are dozens of ways to resolve it, aiming for by-domain configuration just seems best to me - whether that setting is code-only or not.

@Kiradien Kiradien self-assigned this Aug 7, 2024
Kiradien added a commit to Kiradien/WebToEpub that referenced this issue Aug 7, 2024
- Set basic parser to null/0 as minimum delay
- Set fanfiction parser to 3 seconds
- Set ScribbleHub parser to 3 seconds
- Added override to allow users to bypass minimum delay
- Selected Delay will be used if larger than default minimum
@Kiradien
Copy link
Collaborator

Kiradien commented Aug 7, 2024

Wow, I'm getting back to this message late, I blame travelling.
Kiradien@a28c612 - an example of what I was referring to. We just set that object variable in each parser where speed is a known issue.

We can also, if needed, set the global default minimum of Parser.js to 1000 for 1 second, if needed, but it does seem like a more tailored option might be better.

It's tested and works for ScribbleHub and Fanfiction.net in the above changeset, but those are just the ones I remember using Cloudflare.

The question is: Do we want to go with this approach?

This was referenced Aug 7, 2024
dteviot added a commit that referenced this issue Aug 8, 2024
@dteviot
Copy link
Owner Author

dteviot commented Aug 9, 2024

Test versions for Firefox and Chrome have been uploaded to https://drive.google.com/drive/folders/1B_X2WcsaI_eg9yA-5bHJb8VeTZGKExl8?usp=sharing. Pick the one suitable for you, follow the "How to install from Source (for people who are not developers)" instructions at https://github.com/dteviot/WebToEpub/tree/ExperimentalTabMode#user-content-how-to-install-from-source-for-people-who-are-not-developers and let me know how it goes.

@dteviot
Copy link
Owner Author

dteviot commented Aug 23, 2024

Updated version (0.0.0.167) has been submitted to Firefox and Chrome stores.
Firefox version is available now.
Chrome might be available in a few hours to 21 days.

@dteviot dteviot closed this as completed Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants