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 -5
View File
@@ -1,5 +1,5 @@
import { Parser } from 'htmlparser2';
import { fetchApi, fetchFile } from '@libs/fetch';
import { fetchApi } from '@libs/fetch';
import { Plugin } from '@typings/plugin';
import { Filters, FilterTypes } from '@libs/filterInputs';
import { NovelStatus } from '@libs/novelStatus';
@@ -86,7 +86,7 @@ class RoyalRoad implements Plugin.PluginBase {
let isSpan = 0;
let isTags = false;
let isGenres = false;
let genreArray: string[] = [];
const genreArray: string[] = [];
let isFooter = false;
let isScript = false;
let chapterJson: ChapterEntry[] = [];
@@ -226,7 +226,7 @@ class RoyalRoad implements Plugin.PluginBase {
const parser = new Parser({
onopentag(name, attribs) {
if (isChapter && name === 'div') {
let stylediv = attribs['style'];
const stylediv = attribs['style'];
if (stylediv) {
chapterText += `<div style="${stylediv}">`;
isStyleText = true;
@@ -235,7 +235,7 @@ class RoyalRoad implements Plugin.PluginBase {
}
}
if (isChapter && name === 'table') {
let w = attribs['width'];
const w = attribs['width'];
if (w) {
chapterText += `<table width="${w}">`;
} else {
@@ -249,7 +249,7 @@ class RoyalRoad implements Plugin.PluginBase {
chapterText += `<tr>`;
}
if (isChapter && name === 'td') {
let w1 = attribs['width'];
const w1 = attribs['width'];
if (w1) {
chapterText += `<td width="${w1}">`;
} else {