fix: Plugins (#578)

* test

* test

* fix

* any

* update

* update

* fix LightNovelReader

* Why did I do that

* typo

* fix

* type

* unused icons have been removed

* madara...

* ops

* fix

* close #563

* update

* LitSpace

* fix jaomix

* fix renovels

* fix ficbook

* update ficbook
This commit is contained in:
Rider21
2023-10-30 09:45:33 +03:00
committed by GitHub
parent 5258464743
commit ac96c62066
244 changed files with 45894 additions and 18184 deletions
+7 -5
View File
@@ -1,4 +1,4 @@
import cheerio from "cheerio";
import { load as parseHTML } from "cheerio";
import { fetchApi, fetchFile } from "@libs/fetch";
import { Chapter, Novel, Plugin } from "@typings/plugin";
@@ -18,7 +18,7 @@ export const popularNovels: Plugin.popularNovels = async function (page) {
const result = await fetchApi(url);
const body = await result.text();
let loadedCheerio = cheerio.load(body);
let loadedCheerio = parseHTML(body);
let novels: Novel.Item[] = [];
@@ -48,7 +48,7 @@ export const parseNovelAndChapters: Plugin.parseNovelAndChapters =
const result = await fetchApi(url, {}, pluginId);
const body = await result.text();
let loadedCheerio = cheerio.load(body);
let loadedCheerio = parseHTML(body);
let novel: Novel.instance = { url };
@@ -100,7 +100,7 @@ export const parseChapter: Plugin.parseChapter = async function (chapterUrl) {
const result = await fetchApi(url, {}, pluginId);
const body = await result.text();
let loadedCheerio = cheerio.load(body);
let loadedCheerio = parseHTML(body);
let chapterText = loadedCheerio(".chapter-content").html();
return chapterText;
@@ -112,7 +112,7 @@ export const searchNovels: Plugin.searchNovels = async function (searchTerm) {
const result = await fetchApi(url);
const body = await result.text();
let loadedCheerio = cheerio.load(body);
let loadedCheerio = parseHTML(body);
let novels: Novel.Item[] = [];
@@ -138,3 +138,5 @@ export const searchNovels: Plugin.searchNovels = async function (searchTerm) {
return novels;
};
export const fetchImage: Plugin.fetchImage = fetchFile;