Repository navigation
Conversation
|
@matthewsong18 Thank you very much for this, but we can't accept it as it stands. |
Site errors because rate is too fast at 3000ms
Remove the extra delay between read-token authorization and chapter retrieval.
Volumes were messing up chapter order
2ff05e9 to
1183ec5
Compare
- 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.
1183ec5 to
8a38d60
Compare
- Based on Wuxiaworld parser using an observer - Typically narrows tab blocking from 3 seconds to 2 seconds
|
@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 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. |
| const { json: data } = await HttpClient.fetchJson(apiUrl); | ||
| const chapterListIsInvalid = !Array.isArray(data); | ||
| if (chapterListIsInvalid) { | ||
| throw new Error("Fenrir Realm returned an invalid chapter list."); |
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
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.", |
| const seriesCannotBeIdentified = !isSeriesPath || !hasSeriesSlug; | ||
| if (seriesCannotBeIdentified) { | ||
| throw new Error( | ||
| `Cannot identify the Fenrir Realm series from ${url.href}`, |
|
|
||
| if (tabMissing) { | ||
| throw new Error( | ||
| "The reading tab opened by WebToEpub was closed. Please do not close " + |
|
|
||
| promptForChapterRetry(url) { | ||
| const message = new Error( | ||
| "Fenrir Realm has not displayed the chapter. Open the chapter URL, " + |
| return true; | ||
| } | ||
| const accessIsBeingVerified = | ||
| reader.textContent.includes("Verifying access"); |
|
@matthewsong18 Feel free to correct me if you think I'm wrong. |
|
@matthewsong18 |
|
@matthewsong18 |
Closes #3106 #3028 #3058