@@ -9,7 +9,6 @@ import '@fontsource/roboto/700.css';
|
||||
import 'cheerio';
|
||||
import 'htmlparser2';
|
||||
import 'dayjs';
|
||||
import 'qs';
|
||||
import 'protobufjs';
|
||||
|
||||
const { fetch: originalFetch } = window;
|
||||
|
||||
@@ -2,15 +2,15 @@ import { load as parseHTML } from 'cheerio';
|
||||
import { fetchText } from '@libs/fetch';
|
||||
import { FilterTypes, Filters } from '@libs/filterInputs';
|
||||
import { Plugin } from '@typings/plugin';
|
||||
// import { encode } from 'urlencode';
|
||||
import { encode } from 'urlencode';
|
||||
import { NovelStatus } from '@libs/novelStatus';
|
||||
|
||||
class XinShu69 implements Plugin.PluginBase {
|
||||
id = '69xinshu';
|
||||
name = '69书吧';
|
||||
icon = 'src/cn/69xinshu/icon.png';
|
||||
site = 'https://www.69shu.pro';
|
||||
version = '0.1.1';
|
||||
site = 'https://69shu.biz';
|
||||
version = '0.1.2';
|
||||
|
||||
async popularNovels(
|
||||
pageNo: number,
|
||||
@@ -32,20 +32,14 @@ class XinShu69 implements Plugin.PluginBase {
|
||||
|
||||
const novelsList =
|
||||
pageNo === 1
|
||||
? loadedCheerio('div.newbox > ul > li')
|
||||
? loadedCheerio('.newlistbox > ul > li')
|
||||
: loadedCheerio('li');
|
||||
novelsList.each((i, e) => {
|
||||
const novelUrl = loadedCheerio(e)
|
||||
.find('li > div > h3 > a:nth-child(2)')
|
||||
.attr('href');
|
||||
|
||||
novelsList.each((i, e) => {
|
||||
const novelUrl = loadedCheerio(e).find('div > h3 > a').attr('href');
|
||||
if (novelUrl) {
|
||||
const novelName = loadedCheerio(e)
|
||||
.find('li > div > h3 > a:nth-child(2)')
|
||||
.text();
|
||||
const novelCover = loadedCheerio(e)
|
||||
.find('li > a > img')
|
||||
.attr('data-src');
|
||||
const novelName = loadedCheerio(e).find('div > h3 > a').text();
|
||||
const novelCover = loadedCheerio(e).find('a > img').attr('data-src');
|
||||
|
||||
const novel = {
|
||||
name: novelName,
|
||||
@@ -150,7 +144,7 @@ class XinShu69 implements Plugin.PluginBase {
|
||||
|
||||
const searchUrl = `${this.site}/modules/article/search.php`;
|
||||
const formData = new FormData();
|
||||
// formData.append('searchkey', encode(searchTerm, 'gbk'));
|
||||
formData.append('searchkey', encode(searchTerm, 'gbk'));
|
||||
formData.append('searchtype', 'all');
|
||||
|
||||
const body = await fetchText(
|
||||
@@ -159,12 +153,11 @@ class XinShu69 implements Plugin.PluginBase {
|
||||
'gbk',
|
||||
);
|
||||
if (body === '') throw Error('无法获取搜索结果,请检查网络');
|
||||
|
||||
const loadedCheerio = parseHTML(body);
|
||||
|
||||
const novels: Plugin.NovelItem[] = [];
|
||||
|
||||
loadedCheerio('div.newbox > ul > li').each((i, e) => {
|
||||
loadedCheerio('.newbox > ul > li').each((i, e) => {
|
||||
const novelUrl = loadedCheerio(e).find('a').attr('href')!;
|
||||
const novelName = loadedCheerio(e).find('div.newnav > h3').text();
|
||||
const novelCover = loadedCheerio(e).find('img').attr('data-src');
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Plugin } from '@typings/plugin';
|
||||
import { fetchApi } from '@libs/fetch';
|
||||
import { CheerioAPI, load as parseHTML } from 'cheerio';
|
||||
import qs from 'qs';
|
||||
import { Filters, FilterTypes } from '@libs/filterInputs';
|
||||
|
||||
class LibReadPlugin implements Plugin.PluginBase {
|
||||
@@ -131,7 +130,7 @@ class LibReadPlugin implements Plugin.PluginBase {
|
||||
Origin: this.site,
|
||||
},
|
||||
method: 'POST',
|
||||
body: qs.stringify({ searchkey: searchTerm }),
|
||||
body: new URLSearchParams({ searchkey: searchTerm }).toString(),
|
||||
});
|
||||
if (!r.ok)
|
||||
throw new Error(
|
||||
|
||||
@@ -2,7 +2,6 @@ import { load as parseHTML } from 'cheerio';
|
||||
import { fetchApi } from '@libs/fetch';
|
||||
import { Plugin } from '@typings/plugin';
|
||||
import { Filters, FilterTypes } from '@libs/filterInputs';
|
||||
import qs from 'qs';
|
||||
|
||||
class NovelsOnline implements Plugin.PluginBase {
|
||||
id = 'NO.net';
|
||||
@@ -119,7 +118,7 @@ class NovelsOnline implements Plugin.PluginBase {
|
||||
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
||||
},
|
||||
method: 'POST',
|
||||
body: qs.stringify({ q: searchTerm }),
|
||||
body: new URLSearchParams({ q: searchTerm }).toString(),
|
||||
}).then(res => res.text());
|
||||
|
||||
const $ = parseHTML(result);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Plugin } from '@typings/plugin';
|
||||
import { fetchApi } from '@libs/fetch';
|
||||
import { CheerioAPI, load as parseHTML } from 'cheerio';
|
||||
import qs from 'qs';
|
||||
import { Filters, FilterTypes } from '@libs/filterInputs';
|
||||
|
||||
class FreeWebNovel implements Plugin.PluginBase {
|
||||
@@ -134,7 +133,7 @@ class FreeWebNovel implements Plugin.PluginBase {
|
||||
Origin: this.site,
|
||||
},
|
||||
method: 'POST',
|
||||
body: qs.stringify({ searchkey: searchTerm }),
|
||||
body: new URLSearchParams({ searchkey: searchTerm }).toString(),
|
||||
});
|
||||
if (!r.ok)
|
||||
throw new Error(
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { fetchApi } from '@libs/fetch';
|
||||
import { Plugin } from '@typings/plugin';
|
||||
import { load as parseHTML } from 'cheerio';
|
||||
import qs from 'qs';
|
||||
|
||||
class Agitoon implements Plugin.PluginBase {
|
||||
id = 'agit.xyz';
|
||||
@@ -29,7 +28,7 @@ class Agitoon implements Plugin.PluginBase {
|
||||
'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
||||
},
|
||||
method: 'POST',
|
||||
body: qs.stringify({
|
||||
body: new URLSearchParams({
|
||||
mode: 'get_data_novel_list_p',
|
||||
novel_menu: showLatestNovels ? '1' : '3',
|
||||
np_day: new Date().getDay(),
|
||||
@@ -41,7 +40,7 @@ class Agitoon implements Plugin.PluginBase {
|
||||
np_genre_ex_2: '00',
|
||||
list_limit: 20 * (pageNo - 1),
|
||||
is_query_first: pageNo == 1,
|
||||
}),
|
||||
}).toString(),
|
||||
});
|
||||
if (!res.ok) {
|
||||
throw new Error(
|
||||
@@ -95,13 +94,13 @@ class Agitoon implements Plugin.PluginBase {
|
||||
'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
||||
},
|
||||
method: 'POST',
|
||||
body: qs.stringify({
|
||||
body: new URLSearchParams({
|
||||
mode: 'get_data_novel_list_c',
|
||||
wr_id_p: novelPath,
|
||||
page_no: '1',
|
||||
cnt_list: '10000',
|
||||
order_type: 'Asc',
|
||||
}),
|
||||
}).toString(),
|
||||
});
|
||||
|
||||
const resJson = (await res.json()) as responseBook;
|
||||
@@ -145,11 +144,11 @@ class Agitoon implements Plugin.PluginBase {
|
||||
'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
||||
},
|
||||
method: 'POST',
|
||||
body: qs.stringify({
|
||||
body: new URLSearchParams({
|
||||
mode: 'get_data_novel_list_p_sch',
|
||||
search_novel: searchTerm,
|
||||
list_limit: 0,
|
||||
}),
|
||||
}).toString(),
|
||||
});
|
||||
const resJson = (await rawResults.json()) as response;
|
||||
const novels: Plugin.NovelItem[] = [];
|
||||
|
||||
@@ -25,7 +25,6 @@ class TopLiba implements Plugin.PluginBase {
|
||||
});
|
||||
|
||||
if (searchTerm) data.append('q', searchTerm);
|
||||
|
||||
const body = await fetchApi(this.site + '/?' + data.toString()).then(res =>
|
||||
res.text(),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user