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:
@@ -1,5 +1,5 @@
|
||||
import { load as parseHTML } from 'cheerio';
|
||||
import { fetchText, fetchFile } from '@libs/fetch';
|
||||
import { fetchText } from '@libs/fetch';
|
||||
import { FilterTypes, Filters } from '@libs/filterInputs';
|
||||
import { Plugin } from '@typings/plugin';
|
||||
import { NovelStatus } from '@libs/novelStatus';
|
||||
@@ -35,7 +35,7 @@ class Shu69 implements Plugin.PluginBase {
|
||||
const novels: Plugin.NovelItem[] = [];
|
||||
|
||||
loadedCheerio('div.book-coverlist').each((i, el) => {
|
||||
let url = loadedCheerio(el).find('a.cover').attr('href');
|
||||
const url = loadedCheerio(el).find('a.cover').attr('href');
|
||||
|
||||
const novelName = loadedCheerio(el).find('h4.name').text().trim();
|
||||
const novelCover = loadedCheerio(el).find('a.cover > img').attr('src');
|
||||
@@ -59,7 +59,7 @@ class Shu69 implements Plugin.PluginBase {
|
||||
const body = await fetchText(url);
|
||||
if (body === '') throw Error('无法获取小说内容,请检查网络');
|
||||
|
||||
let loadedCheerio = parseHTML(body);
|
||||
const loadedCheerio = parseHTML(body);
|
||||
|
||||
const novel: Plugin.SourceNovel = {
|
||||
path: novelPath,
|
||||
@@ -84,7 +84,7 @@ class Shu69 implements Plugin.PluginBase {
|
||||
novel.genres = '';
|
||||
|
||||
// Table of Content is on a different page than the summary page
|
||||
let chapters: Plugin.ChapterItem[] = [];
|
||||
const chapters: Plugin.ChapterItem[] = [];
|
||||
|
||||
const allUrl = loadedCheerio('dd.all > a').attr('href');
|
||||
if (allUrl) {
|
||||
@@ -156,12 +156,12 @@ class Shu69 implements Plugin.PluginBase {
|
||||
});
|
||||
if (body === '') throw Error('无法获取搜索结果,请检查网络');
|
||||
|
||||
let loadedCheerio = parseHTML(body);
|
||||
const loadedCheerio = parseHTML(body);
|
||||
|
||||
const novels: Plugin.NovelItem[] = [];
|
||||
|
||||
loadedCheerio('div.book-coverlist').each((i, el) => {
|
||||
let url = loadedCheerio(el).find('a.cover').attr('href');
|
||||
const url = loadedCheerio(el).find('a.cover').attr('href');
|
||||
|
||||
const novelName = loadedCheerio(el).find('h4.name').text().trim();
|
||||
const novelCover = loadedCheerio(el).find('a.cover > img').attr('src');
|
||||
|
||||
Reference in New Issue
Block a user