Generated
+2267
-62
File diff suppressed because it is too large
Load Diff
+3
-4
@@ -32,7 +32,6 @@
|
||||
"dayjs": "^1.11.10",
|
||||
"htmlparser2": "^9.1.0",
|
||||
"protobufjs": "^7.2.6",
|
||||
"qs": "^6.11.2",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-redux": "^9.1.2",
|
||||
@@ -46,7 +45,6 @@
|
||||
"@eslint/js": "^9.5.0",
|
||||
"@types/eslint__js": "^8.42.3",
|
||||
"@types/eslint-config-prettier": "^6.11.3",
|
||||
"@types/qs": "^6.9.15",
|
||||
"@types/react": "^18.2.66",
|
||||
"@types/react-dom": "^18.2.22",
|
||||
"@types/react-window": "^1.8.8",
|
||||
@@ -60,11 +58,12 @@
|
||||
"image-size": "^1.1.1",
|
||||
"lint-staged": "^15.2.2",
|
||||
"prettier": "^3.2.5",
|
||||
"terser": "^5.34.1",
|
||||
"terser": "^5.36.0",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.5.2",
|
||||
"typescript-eslint": "^7.14.1",
|
||||
"vite": "^5.2.0"
|
||||
"vite": "^5.2.0",
|
||||
"vite-plugin-node-polyfills": "^0.22.0"
|
||||
},
|
||||
"lint-staged": {
|
||||
"**/*.{js,ts,jsx,tsx}": "prettier --write"
|
||||
|
||||
@@ -4,7 +4,6 @@ import { Plugin } from '@typings/plugin';
|
||||
import { NovelStatus } from '@libs/novelStatus';
|
||||
import { load as parseHTML } from 'cheerio';
|
||||
import dayjs from 'dayjs';
|
||||
import qs from 'qs';
|
||||
|
||||
type ReadwnOptions = {
|
||||
versionIncrements?: number;
|
||||
@@ -204,12 +203,12 @@ class ReadwnPlugin implements Plugin.PluginBase {
|
||||
Origin: this.site,
|
||||
},
|
||||
method: 'POST',
|
||||
body: qs.stringify({
|
||||
body: new URLSearchParams({
|
||||
show: 'title',
|
||||
tempid: 1,
|
||||
tbname: 'news',
|
||||
keyboard: searchTerm,
|
||||
}),
|
||||
}).toString(),
|
||||
}).then(res => res.text());
|
||||
const loadedCheerio = parseHTML(result);
|
||||
|
||||
|
||||
@@ -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(),
|
||||
);
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react-swc';
|
||||
import { nodePolyfills } from 'vite-plugin-node-polyfills';
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
@@ -7,7 +8,7 @@ const dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react({ devTarget: 'es5' })],
|
||||
plugins: [nodePolyfills(), react({ devTarget: 'es5' })],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@libs': path.resolve(dirname, './src/libs'),
|
||||
|
||||
Reference in New Issue
Block a user