Skip to content

Commit f3e916c

Browse files
committed
chapter response is a json
Signed-off-by: K1ngfish3r <26593485+K1ngfish3r@users.noreply.github.com>
1 parent 22156cb commit f3e916c

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

plugins/multisrc/readnovelfull/template.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,15 @@ export class ReadNovelFullPlugin implements Plugin.PluginBase {
524524
novel.chapters = [];
525525
} else {
526526
const ajaxBody = await ajaxResult.text();
527+
let ajaxHtml = ajaxBody;
528+
try {
529+
const json = JSON.parse(ajaxBody);
530+
if (typeof json.html === 'string') {
531+
ajaxHtml = json.html;
532+
}
533+
} catch {
534+
// eslint
535+
}
527536
const ajaxChapters: Plugin.ChapterItem[] = [];
528537
let tempAjaxChapter: Partial<Plugin.ChapterItem> = {};
529538

@@ -578,7 +587,7 @@ export class ReadNovelFullPlugin implements Plugin.PluginBase {
578587
},
579588
});
580589

581-
ajaxParser.write(ajaxBody);
590+
ajaxParser.write(ajaxHtml);
582591
ajaxParser.end();
583592
novel.chapters = ajaxChapters;
584593
}

0 commit comments

Comments
 (0)