dteviot / WebToEpub

A simple Chrome (and Firefox) Extension that converts Web Novels (and other web pages) into an EPUB.
Other
649 stars 123 forks source link

Password Protected Chapter Input #1278

Open satiricalnightmare opened 2 months ago

satiricalnightmare commented 2 months ago

I read translated webnovels and they often have each chapter password protected, sometimes different passwords for different chapters. I've tried running the software as usual and those chapters just come up blank with something like "password: "

It'd be nice if there was a way to input passwords for each chapter that required them, although I know this is a longshot. I assume it would be difficult to add a feature that inputs something before each chapter can be read.

The only alternative I can think of is going to each page and inputting the password and trying to use the extension to add this chapter to a pre-existing epub, but as far as I know if can't read each chapter individually from its page of text.

It would probably help if I provided websites. The websites I've encountered that do this are chrysanthemum garden and peachpitting. These sites also have features that disable right clicking, and jumble text or replace sections with nonsense when making epubs. They've been quite difficult to get around. As I said I know this feature would be a longshot and a huge bother to implement, but I'm sure there are others besides me who have encountered this problem and I might as well be the one to put it out there.

dteviot commented 2 months ago

@satiricalnightmare

  1. Re: chrysanthemum garden jumbling text: https://github.com/dteviot/WebToEpub/issues/967
  2. I am not aware of any chapters on ChrysanthemumGarden that require passwords. I'm not prepared to go hunting on the site looking for them either. If you want me to investigate, you'll need to provide me with multiple examples of story and chapter with issues.
  3. I'm also not aware of passwords required for peachpitting.com. So, links or it doesn't happen.
satiricalnightmare commented 2 months ago

Of course! here’s a few

https://peachpitting.com/novel/fp/fp-15/

https://chrysanthemumgarden.com/novel-tl/soft/soft-18/

Here’s one from each site. Usually they have the first few unlocked as a preview and then have passwords for later chapters. Peachpitting sometimes requires different passwords for different parts in the novel. So this is the same novel as above, but requires a different password.

https://peachpitting.com/novel/fp/fp-123/

dteviot commented 2 months ago

@satiricalnightmare Without passwords, it's hard to be sure, but I suspect basic process, at least for ChrysanthemumGarden would be to customize fetchChapter() for that parser. Logic would be something like:

  1. Fetch chapter from normal URL.
  2. If content includes a form with id of "password-lock"
  3. POST a form with the password.
  4. I'd expect the response from the POST request to be a chapter with the actual desired text. https://developer.mozilla.org/en-US/docs/Learn/Forms/Sending_and_retrieving_form_data

I note the form on the site says:

Due to a recent event, we're temporarily locking some of the novels on our site.

So, you could just wait until the chapters are unlocked.

Peachpitting would probably be something similar, although I'm not sure how you'd know which password to use for a chapter. Note that the rules for this site for getting a password include promising you won't try to create an epub from the site. So, having WebToEpub able to do this would probably violate Google's rules for Chrome apps.