Skip to content

Fix fenrir realm verifying message - #3115

Merged
dteviot merged 10 commits into
dteviot:ExperimentalTabModefrom
matthewsong18:fix-fenrir-realm-verifying-message
Nov 5, 2026
Merged

dteviot merged 10 commits into
dteviot:ExperimentalTabModefrom
matthewsong18:fix-fenrir-realm-verifying-message

Conversation

@matthewsong18

@matthewsong18 matthewsong18 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor
  • To get the actual chapters instead of a “verifying access” message, I studied how Fenrir Realm loads its content. I guessed they had switched to API requests and that was indeed how they were retrieving the chapter contents.
  • Getting the API response wasn't enough though because the chapter content was encrypted. I used AI to figure out how the site decrypts the content and implemented that in the parser.
  • I noticed in the responses with the encrypted chapters that they mentioned a "fragments-v1" and learned that there's supposedly a "fragments-v2" incoming. What that means is that there's going to be another way to decrypt the chapters. But randomly testing novels on the site show that they're all using v1. I only implemented v1, but I split chapter retrieval and decryption into smaller, abstracted functions so the affected parts can be updated easily in the future.
  • To make Turnstile challenges easier to resolve, I added custom handling that links to the chapter page when authorization is required. It brings you to the chapter, where you can complete the Turnstile, instead of bringing you to the API request.

Closes #3106 #3028 #3058

@dteviot

dteviot commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

@matthewsong18 Thank you very much for this, but we can't accept it as it stands.
Having an extension decrypt encrypted content violates Google's terms of service for an extension.
Please see https://github.com/dteviot/WebToEpub/wiki/FAQ#request-to-decryptdescramble-text-for-sites-eg-chrysanthemumgarden-dragontea-ink for how WebToEpub works around this rule.

@matthewsong18
matthewsong18 marked this pull request as draft November 4, 2026 17:25
@matthewsong18
matthewsong18 force-pushed the fix-fenrir-realm-verifying-message branch from 2ff05e9 to 1183ec5 Compare November 5, 2026 02:08
- Based on NoveliParser using chrome extension API
- Chrome documentation is transitioning to browser.* namespace, but
  minimum required version is 148. Our manifest lists 120, so I left it
  as chrome.
@matthewsong18
matthewsong18 force-pushed the fix-fenrir-realm-verifying-message branch from 1183ec5 to 8a38d60 Compare November 5, 2026 03:19
- Based on Wuxiaworld parser using an observer
- Typically narrows tab blocking from 3 seconds to 2 seconds
@matthewsong18

matthewsong18 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor Author

@dteviot Since we're not allowed to decrypt ourselves, I took inspiration from NoveliParser and used the chrome.tabs API (which is being migrated to browser.* as mentioned in the docs but requires minimum Chrome 148) to open the chapters inside of a new tab, wait for the site itself to decrypt the chapter, then read the rendered html.

The main trade-off is a massively longer download time. This is because the throttle only controls the delay between chapter tabs. But on each tab, we can't control the requests Fenrir Realm makes while loading the site. This caused their rate limit to trigger until I raised the minimum throttle to 10 seconds. On top of this, each tab takes around 2 seconds to grab the chapter contents (improved from 3 seconds by using an observer). Each chapter takes around 12 seconds to download.

Downloads now take roughly 3 times as long, but the parser works without performing decryption itself.

@matthewsong18
matthewsong18 marked this pull request as ready for review November 5, 2026 03:35
const { json: data } = await HttpClient.fetchJson(apiUrl);
const chapterListIsInvalid = !Array.isArray(data);
if (chapterListIsInvalid) {
throw new Error("Fenrir Realm returned an invalid chapter list.");

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Text that is shown to a user should go in https://github.com/dteviot/WebToEpub/blob/ExperimentalTabMode/plugin/_locales/en/messages.json, so it can be translated. (At least in theory.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll try to use those i18n messages from now on.

const identifiersAreInvalid = !hasNumericId || !hasSlug;
if (identifiersAreInvalid) {
throw new Error(
"Fenrir Realm returned invalid chapter identifiers.",

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Ditto

const seriesCannotBeIdentified = !isSeriesPath || !hasSeriesSlug;
if (seriesCannotBeIdentified) {
throw new Error(
`Cannot identify the Fenrir Realm series from ${url.href}`,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Ditto


if (tabMissing) {
throw new Error(
"The reading tab opened by WebToEpub was closed. Please do not close " +

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Ditto


promptForChapterRetry(url) {
const message = new Error(
"Fenrir Realm has not displayed the chapter. Open the chapter URL, " +

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Ditto.

return true;
}
const accessIsBeingVerified =
reader.textContent.includes("Verifying access");

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Ditto

@dteviot

dteviot commented Nov 5, 2026

Copy link
Copy Markdown
Owner

@matthewsong18
My complements on your ingenuity.
Unfortunately, I believe this is still in violation of Google's ToCs. The fact that we're letting the Browser do the decrypting rather than WebToEpub really doesn't make a difference. Ultimately, we're still packaging the unprotected content.
FYI. the relevant ToC is number 5 on this list. https://developer.chrome.com/docs/webstore/program-policies/malicious-and-prohibited.

Feel free to correct me if you think I'm wrong.

@dteviot

dteviot commented Nov 5, 2026

Copy link
Copy Markdown
Owner

@matthewsong18
Going to suggest, you could add this to the "experimental" folder under "parsers". Then it's available for private builds. It just doesn't get included in the versions we submit to Google or Firefox stores.

@dteviot
dteviot merged commit 4d03d3c into dteviot:ExperimentalTabMode Nov 5, 2026
1 check passed
@dteviot

dteviot commented Nov 5, 2026

Copy link
Copy Markdown
Owner

@matthewsong18
On second thoughts, let's push our luck

@matthewsong18
matthewsong18 deleted the fix-fenrir-realm-verifying-message branch November 5, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't download from site (FenrirRealm) which requires quick verification

2 participants