Fix plugins (#914)
* fix: novel hall search * bump novel hall version * fix: storyseeding * bumps StorySeedling version * fix: ltnovel, fans mtl, fannovel domain * fix: types * added wuxiaV
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
+1
-1
@@ -58,7 +58,7 @@ const makeInit = async (init?: FetchInit) => {
|
|||||||
*/
|
*/
|
||||||
export async function fetchApi(url: string, init?: FetchInit) {
|
export async function fetchApi(url: string, init?: FetchInit) {
|
||||||
init = await makeInit(init);
|
init = await makeInit(init);
|
||||||
// console.log(init.headers);
|
console.log(init.headers);
|
||||||
// console.log(url, init);
|
// console.log(url, init);
|
||||||
return await fetch(url, init as RequestInit);
|
return await fetch(url, init as RequestInit);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class StorySeedlingPlugin implements Plugin.PluginBase {
|
|||||||
name = 'StorySeedling';
|
name = 'StorySeedling';
|
||||||
icon = 'src/en/storyseedling/icon.png';
|
icon = 'src/en/storyseedling/icon.png';
|
||||||
site = 'https://storyseedling.com/';
|
site = 'https://storyseedling.com/';
|
||||||
version = '1.0.0';
|
version = '1.0.1';
|
||||||
|
|
||||||
async popularNovels(pageNo: number): Promise<Plugin.NovelItem[]> {
|
async popularNovels(pageNo: number): Promise<Plugin.NovelItem[]> {
|
||||||
let novels: Plugin.NovelItem[] = [];
|
let novels: Plugin.NovelItem[] = [];
|
||||||
@@ -25,11 +25,11 @@ class StorySeedlingPlugin implements Plugin.PluginBase {
|
|||||||
.replace("')", '') as string;
|
.replace("')", '') as string;
|
||||||
|
|
||||||
var data = new FormData();
|
var data = new FormData();
|
||||||
data.set('search', '');
|
data.append('search', '');
|
||||||
data.set('orderBy', 'recent');
|
data.append('orderBy', 'recent');
|
||||||
data.set('curpage', pageNo.toString());
|
data.append('curpage', pageNo.toString());
|
||||||
data.set('post', postValue);
|
data.append('post', postValue);
|
||||||
data.set('action', 'fetch_browse');
|
data.append('action', 'fetch_browse');
|
||||||
|
|
||||||
var response = await (
|
var response = await (
|
||||||
await fetchApi(url, { body: data, method: 'POST' })
|
await fetchApi(url, { body: data, method: 'POST' })
|
||||||
@@ -135,11 +135,11 @@ class StorySeedlingPlugin implements Plugin.PluginBase {
|
|||||||
.replace("')", '') as string;
|
.replace("')", '') as string;
|
||||||
|
|
||||||
var data = new FormData();
|
var data = new FormData();
|
||||||
data.set('search', searchTerm);
|
data.append('search', searchTerm);
|
||||||
data.set('orderBy', 'recent');
|
data.append('orderBy', 'recent');
|
||||||
data.set('curpage', pageNo.toString());
|
data.append('curpage', pageNo.toString());
|
||||||
data.set('post', postValue);
|
data.append('post', postValue);
|
||||||
data.set('action', 'fetch_browse');
|
data.append('action', 'fetch_browse');
|
||||||
|
|
||||||
var response = await (
|
var response = await (
|
||||||
await fetchApi(url, { body: data, method: 'POST' })
|
await fetchApi(url, { body: data, method: 'POST' })
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { defaultCover } from '@libs/defaultCover';
|
|||||||
class NovelHall implements Plugin.PluginBase {
|
class NovelHall implements Plugin.PluginBase {
|
||||||
id = 'novelhall';
|
id = 'novelhall';
|
||||||
name = 'Novel Hall';
|
name = 'Novel Hall';
|
||||||
version = '1.0.0';
|
version = '1.0.1';
|
||||||
icon = 'src/en/novelhall/icon.png';
|
icon = 'src/en/novelhall/icon.png';
|
||||||
filters?: Filters | undefined; //TODO: Filters Requires hideOnSelect
|
filters?: Filters | undefined; //TODO: Filters Requires hideOnSelect
|
||||||
site = 'https://novelhall.com/';
|
site = 'https://novelhall.com/';
|
||||||
@@ -104,19 +104,20 @@ class NovelHall implements Plugin.PluginBase {
|
|||||||
|
|
||||||
const novels: Plugin.NovelItem[] = [];
|
const novels: Plugin.NovelItem[] = [];
|
||||||
|
|
||||||
loadedCheerio('#article_list_content > li').each((idx, ele) => {
|
loadedCheerio('table tr').each((idx, ele) => {
|
||||||
const novelName = loadedCheerio(ele)
|
const novelName = loadedCheerio(ele)
|
||||||
.find('h3')
|
.find('td:nth-child(2)')
|
||||||
.text()
|
.text()
|
||||||
.replace(/\t+/g, '')
|
.replace(/\t+/g, '')
|
||||||
.replace(/\n/g, ' ');
|
.replace(/\n/g, ' ');
|
||||||
const novelCover = loadedCheerio(ele).find('img').attr('data-src');
|
const novelUrl = loadedCheerio(ele)
|
||||||
const novelUrl = loadedCheerio(ele).find('a').attr('href')?.slice(1);
|
.find('td:nth-child(2) a')
|
||||||
|
.attr('href');
|
||||||
if (!novelUrl) return;
|
if (!novelUrl) return;
|
||||||
|
|
||||||
const novel = {
|
const novel = {
|
||||||
name: novelName,
|
name: novelName,
|
||||||
cover: novelCover,
|
cover: defaultCover,
|
||||||
path: novelUrl,
|
path: novelUrl,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -11,22 +11,36 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "ltnovel",
|
"id": "ltnovel",
|
||||||
"sourceSite": "https://www.ltnovel.com",
|
"sourceSite": "https://www.ltnovels.com",
|
||||||
"sourceName": "Ltnovel"
|
"sourceName": "Ltnovel",
|
||||||
|
"options": {
|
||||||
|
"versionIncrements": 1
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "wuxiamtl",
|
"id": "wuxiamtl",
|
||||||
"sourceSite": "https://www.fansmtl.com",
|
"sourceSite": "https://www.fansmtl.org",
|
||||||
"sourceName": "Fans MTL"
|
"sourceName": "Fans MTL",
|
||||||
|
"options": {
|
||||||
|
"versionIncrements": 1
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "fannovel",
|
"id": "fannovel",
|
||||||
"sourceSite": "https://www.fannovel.com",
|
"sourceSite": "https://www.fannovels.org",
|
||||||
"sourceName": "FanNovel"
|
"sourceName": "FanNovel",
|
||||||
|
"options": {
|
||||||
|
"versionIncrements": 1
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "wuxiaspace",
|
"id": "wuxiaspace",
|
||||||
"sourceSite": "https://www.wuxiaspace.com",
|
"sourceSite": "https://www.wuxiaspace.com",
|
||||||
"sourceName": "Wuxia Space"
|
"sourceName": "Wuxia Space"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "wuxiav",
|
||||||
|
"sourceSite": "https://www.wuxiav.com",
|
||||||
|
"sourceName": "WuxiaV"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -6,11 +6,16 @@ import { load as parseHTML } from 'cheerio';
|
|||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import qs from 'qs';
|
import qs from 'qs';
|
||||||
|
|
||||||
|
interface ReadwnOptions {
|
||||||
|
versionIncrements?: number;
|
||||||
|
}
|
||||||
|
|
||||||
export interface ReadwnMetadata {
|
export interface ReadwnMetadata {
|
||||||
id: string;
|
id: string;
|
||||||
sourceSite: string;
|
sourceSite: string;
|
||||||
sourceName: string;
|
sourceName: string;
|
||||||
filters?: any;
|
filters?: any;
|
||||||
|
options?: ReadwnOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
class ReadwnPlugin implements Plugin.PluginBase {
|
class ReadwnPlugin implements Plugin.PluginBase {
|
||||||
@@ -26,7 +31,8 @@ class ReadwnPlugin implements Plugin.PluginBase {
|
|||||||
this.name = metadata.sourceName;
|
this.name = metadata.sourceName;
|
||||||
this.icon = `multisrc/readwn/${metadata.id.toLowerCase()}/icon.png`;
|
this.icon = `multisrc/readwn/${metadata.id.toLowerCase()}/icon.png`;
|
||||||
this.site = metadata.sourceSite;
|
this.site = metadata.sourceSite;
|
||||||
this.version = '1.0.1';
|
const versionIncrements = metadata.options?.versionIncrements || 0;
|
||||||
|
this.version = `1.0.${1 + versionIncrements}`;
|
||||||
this.filters = metadata.filters;
|
this.filters = metadata.filters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user