Add TopLiba (#1003)

* test

* cleanup

deleted unused `fetchFile` import
replaced fetch with `fetchApi`

* eslint

* fix

* fix multi

* Hmm, what to do next.

* test URLSearchParams

* fix
This commit is contained in:
Rider21
2024-06-30 07:28:11 +03:00
committed by GitHub
parent 938e3b16a3
commit fae73534dd
121 changed files with 10534 additions and 8079 deletions
+5 -8
View File
@@ -148,22 +148,19 @@ class LightNovelWorld implements Plugin.PagePlugin {
const loadedCheerio = parseHTML(body);
let chapterText = loadedCheerio('#chapter-container').html() || '';
const chapterText = loadedCheerio('#chapter-container').html() || '';
return chapterText;
}
async searchNovels(
searchTerm: string,
pageNo: number,
): Promise<Plugin.NovelItem[]> {
async searchNovels(searchTerm: string): Promise<Plugin.NovelItem[]> {
const url = `${this.site}lnsearchlive`;
const link = `${this.site}search`;
const response = await fetchApi(link).then(r => r.text());
const token = parseHTML(response);
let verifytoken = token('#novelSearchForm > input').attr('value');
const verifytoken = token('#novelSearchForm > input').attr('value');
let formData = new FormData();
const formData = new FormData();
formData.append('inputContent', searchTerm);
const results = await fetchApi(url, {
@@ -172,7 +169,7 @@ class LightNovelWorld implements Plugin.PagePlugin {
body: formData,
}).then(r => r.json());
let novels: Plugin.NovelItem[] = [];
const novels: Plugin.NovelItem[] = [];
const loadedCheerio = parseHTML(results.resultview);