fix(NovelMania): load chapter text from truncated streamed responses - #2607
Merged
Merged
Conversation
The site now serves chapter pages as a streamed React SSR response. In the app the document was arriving truncated (~36 KB, missing the chapter data), so `parseChapter` returned an empty chapter. - Send browser-like headers (User-Agent, Accept-Language, Referer, cookies) - Retry with different read strategies (text/arrayBuffer, Accept-Encoding identity/gzip) until the stream end marker (`$_TSR.e()`) is present - Make the `content` regex tolerant to quoted keys/whitespace - Throw a clear error instead of returning an empty chapter - Bump version to 2.0.2 Tested in the app: chapters of "86: Eighty Six" load correctly again. - [x] Update version code if an existing plugin was modified - [x] Test changes in Plugin Playground or the app - [ ] Reference related issues in the PR body - [x] Commit messages follow `type(scope): description`
|
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
rajarsheechatterjee
approved these changes
Sep 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Chapters of Novel Mania open blank in the app.
parseChapterreads thechapter text from the React SSR
$Rdata stream embedded in the page, butthe document the app receives is cut off (~36 KB, ending in the middle of
the
matchesarray), so the chapter data is never present and an emptychapter is returned. The same page loads fine in a desktop browser, where
the stream is complete and
content:"..."is present.Changes
and the
nm_vid/PARAGLIDE_LOCALEcookies;nm_vidis a random id).text()/arrayBuffer(), withdefault,
identityandgzipAccept-Encoding) and stop at the first onethat contains the end-of-stream marker
$_TSR.e(). If none is complete,keep the longest body.
contentregex tolerant to quoted keys and whitespace.\/and\'indecodeJsString.returning an empty chapter that looks like a successful load.
Notes
$_TSR.e()missing, HTML cut at the samelength on every request) and that the combination of the changes above
fixes it, but I did not isolate which single change is responsible.
Testing
Tested in the LNReader app (Poco X8 Pro / Android 16): chapters of
"86: Eighty Six" load correctly again.
type(scope): description