fix: Plugins (#578)
* test * test * fix * any * update * update * fix LightNovelReader * Why did I do that * typo * fix * type * unused icons have been removed * madara... * ops * fix * close #563 * update * LitSpace * fix jaomix * fix renovels * fix ficbook * update ficbook
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import { load as parseHTML } from "cheerio";
|
||||
import { fetchFile, fetchApi } from "@libs/fetch";
|
||||
import { Novel, Plugin, Chapter } from "@typings/plugin";
|
||||
import { FilterInputs } from "@libs/filterInputs";
|
||||
import { defaultCover } from "@libs/defaultCover";
|
||||
import { NovelStatus } from "@libs/novelStatus"
|
||||
import { parseMadaraDate } from "@libs/parseMadaraDate";
|
||||
@@ -14,19 +15,24 @@ export const version = "1.0.0";
|
||||
export const site = "https://meionovel.id/";
|
||||
const baseUrl = site;
|
||||
|
||||
export const popularNovels: Plugin.popularNovels = async (pageNo, {showLatestNovels}) => {
|
||||
export const popularNovels: Plugin.popularNovels = async (pageNo, {filters, showLatestNovels}) => {
|
||||
const novels: Novel.Item[] = [];
|
||||
const sortOrder = showLatestNovels
|
||||
? '?m_orderby=latest'
|
||||
: '/?m_orderby=rating';
|
||||
|
||||
let url = site + "novel" + '/page/' + pageNo + sortOrder;
|
||||
let url = site;
|
||||
|
||||
if (filters?.genres) {
|
||||
url += "novel-genre/" + filters.genres + '/';
|
||||
} else {
|
||||
url += "novel/";
|
||||
}
|
||||
|
||||
url += '/page/' + pageNo + '/' +
|
||||
'?m_orderby=' + (showLatestNovels ? 'latest' : (filters?.sort || 'rating'));
|
||||
|
||||
const body = await fetchApi(url).then(res => res.text());
|
||||
|
||||
const loadedCheerio = parseHTML(body);
|
||||
|
||||
|
||||
loadedCheerio('.manga-title-badges').remove();
|
||||
|
||||
loadedCheerio('.page-item-detail').each(function () {
|
||||
@@ -202,4 +208,6 @@ export const searchNovels: Plugin.searchNovels = async (searchTerm) => {
|
||||
|
||||
export const fetchImage: Plugin.fetchImage = async (url) => {
|
||||
return await fetchFile(url);
|
||||
};
|
||||
};
|
||||
|
||||
export const filters = [{"key":"sort","label":"Order by","values":[{"label":"Rating","value":"rating"},{"label":"A-Z","value":"alphabet"},{"label":"Latest","value":"latest"},{"label":"Most Views","value":"views"},{"label":"New","value":"new-manga"},{"label":"Trending","value":"trending"}],"inputType":FilterInputs.Picker},{"key":"genres","label":"GENRES","values":[{"label":"Action","value":"action"},{"label":"Adventure","value":"adventure"},{"label":"Comedy","value":"comedy"},{"label":"Cooking","value":"cooking"},{"label":"Drama","value":"drama"},{"label":"Ecchi","value":"ecchi"},{"label":"Fanfiction","value":"fanfiction"},{"label":"Fantasy","value":"fantasy"},{"label":"Gender Bender","value":"gender-bender"},{"label":"Harem","value":"harem"},{"label":"Historical","value":"historical"},{"label":"Horror","value":"horror"},{"label":"Isekai","value":"isekai"},{"label":"Josei","value":"josei"},{"label":"Magic","value":"magic"},{"label":"Martial Arts","value":"martial-arts"},{"label":"Mature","value":"mature"},{"label":"Mecha","value":"mecha"},{"label":"Mystery","value":"mystery"},{"label":"One shot","value":"one-shot"},{"label":"Psychological","value":"psychological"},{"label":"Reverse Harem","value":"reverse-harem"},{"label":"Romance","value":"romance"},{"label":"School Life","value":"school-life"},{"label":"Sci-fi","value":"sci-fi"},{"label":"Seinen","value":"seinen"},{"label":"Shoujo","value":"shoujo"},{"label":"Shoujo Ai","value":"shoujo-ai"},{"label":"Shounen","value":"shounen"},{"label":"Shounen Ai","value":"shounen-ai"},{"label":"Slice of Life","value":"slice-of-life"},{"label":"Smut","value":"smut"},{"label":"Sports","value":"sports"},{"label":"Supernatural","value":"supernatural"},{"label":"Tragedy","value":"tragedy"},{"label":"Virtual Reality","value":"virtual-reality"},{"label":"Wuxia","value":"wuxia"},{"label":"Xianxia","value":"xianxia"},{"label":"Xuanhuan","value":"xuanhuan"},{"label":"Yuri","value":"yuri"}],"inputType":FilterInputs.Picker}];
|
||||
@@ -2,6 +2,7 @@
|
||||
import { load as parseHTML } from "cheerio";
|
||||
import { fetchFile, fetchApi } from "@libs/fetch";
|
||||
import { Novel, Plugin, Chapter } from "@typings/plugin";
|
||||
import { FilterInputs } from "@libs/filterInputs";
|
||||
import { defaultCover } from "@libs/defaultCover";
|
||||
import { NovelStatus } from "@libs/novelStatus"
|
||||
import { parseMadaraDate } from "@libs/parseMadaraDate";
|
||||
@@ -14,19 +15,24 @@ export const version = "1.0.0";
|
||||
export const site = "https://morenovel.net/";
|
||||
const baseUrl = site;
|
||||
|
||||
export const popularNovels: Plugin.popularNovels = async (pageNo, {showLatestNovels}) => {
|
||||
export const popularNovels: Plugin.popularNovels = async (pageNo, {filters, showLatestNovels}) => {
|
||||
const novels: Novel.Item[] = [];
|
||||
const sortOrder = showLatestNovels
|
||||
? '?m_orderby=latest'
|
||||
: '/?m_orderby=rating';
|
||||
|
||||
let url = site + "novel" + '/page/' + pageNo + sortOrder;
|
||||
let url = site;
|
||||
|
||||
if (filters?.genres) {
|
||||
url += "novel-genre/" + filters.genres + '/';
|
||||
} else {
|
||||
url += "novel/";
|
||||
}
|
||||
|
||||
url += '/page/' + pageNo + '/' +
|
||||
'?m_orderby=' + (showLatestNovels ? 'latest' : (filters?.sort || 'rating'));
|
||||
|
||||
const body = await fetchApi(url).then(res => res.text());
|
||||
|
||||
const loadedCheerio = parseHTML(body);
|
||||
|
||||
|
||||
loadedCheerio('.manga-title-badges').remove();
|
||||
|
||||
loadedCheerio('.page-item-detail').each(function () {
|
||||
@@ -202,4 +208,6 @@ export const searchNovels: Plugin.searchNovels = async (searchTerm) => {
|
||||
|
||||
export const fetchImage: Plugin.fetchImage = async (url) => {
|
||||
return await fetchFile(url);
|
||||
};
|
||||
};
|
||||
|
||||
export const filters = [{"key":"sort","label":"Order by","values":[{"label":"Rating","value":"rating"},{"label":"A-Z","value":"alphabet"},{"label":"Latest","value":"latest"},{"label":"Most Views","value":"views"},{"label":"New","value":"new-manga"},{"label":"Trending","value":"trending"}],"inputType":FilterInputs.Picker},{"key":"genres","label":"GENRES","values":[{"label":"Action","value":"action"},{"label":"Adventure","value":"adventure"},{"label":"Comedy","value":"comedy"},{"label":"Drama","value":"drama"},{"label":"Ecchi","value":"ecchi"},{"label":"Fantasy","value":"fantasy"},{"label":"Gender Bender","value":"gender-bender"},{"label":"Harem","value":"harem"},{"label":"Historical","value":"historical"},{"label":"Horror","value":"horror"},{"label":"Josei","value":"josei"},{"label":"Martial Arts","value":"martial-arts"},{"label":"Mature","value":"mature"},{"label":"Mecha","value":"mecha"},{"label":"Mystery","value":"mystery"},{"label":"Psychological","value":"psychological"},{"label":"Romance","value":"romance"},{"label":"School Life","value":"school-life"},{"label":"Sci-fi","value":"sci-fi"},{"label":"Seinen","value":"seinen"},{"label":"Shoujo","value":"shoujo"},{"label":"Shoujo Ai","value":"shoujo-ai"},{"label":"Shounen","value":"shounen"},{"label":"Shounen Ai","value":"shounen-ai"},{"label":"Slice of Life","value":"slice-of-life"},{"label":"Sports","value":"sports"},{"label":"Supernatural","value":"supernatural"},{"label":"Tragedy","value":"tragedy"},{"label":"Wuxia","value":"wuxia"},{"label":"Xianxia","value":"xianxia"},{"label":"Xuanhuan","value":"xuanhuan"},{"label":"Yaoi","value":"yaoi"},{"label":"Yuri","value":"yuri"}],"inputType":FilterInputs.Picker}];
|
||||
@@ -2,6 +2,7 @@
|
||||
import { load as parseHTML } from "cheerio";
|
||||
import { fetchFile, fetchApi } from "@libs/fetch";
|
||||
import { Novel, Plugin, Chapter } from "@typings/plugin";
|
||||
import { FilterInputs } from "@libs/filterInputs";
|
||||
import { defaultCover } from "@libs/defaultCover";
|
||||
import { NovelStatus } from "@libs/novelStatus"
|
||||
import { parseMadaraDate } from "@libs/parseMadaraDate";
|
||||
@@ -14,19 +15,24 @@ export const version = "1.0.0";
|
||||
export const site = "https://wbnovel.com/";
|
||||
const baseUrl = site;
|
||||
|
||||
export const popularNovels: Plugin.popularNovels = async (pageNo, {showLatestNovels}) => {
|
||||
export const popularNovels: Plugin.popularNovels = async (pageNo, {filters, showLatestNovels}) => {
|
||||
const novels: Novel.Item[] = [];
|
||||
const sortOrder = showLatestNovels
|
||||
? '?m_orderby=latest'
|
||||
: '/?m_orderby=rating';
|
||||
|
||||
let url = site + "novel" + '/page/' + pageNo + sortOrder;
|
||||
let url = site;
|
||||
|
||||
if (filters?.genres) {
|
||||
url += "novel-genre/" + filters.genres + '/';
|
||||
} else {
|
||||
url += "novel/";
|
||||
}
|
||||
|
||||
url += '/page/' + pageNo + '/' +
|
||||
'?m_orderby=' + (showLatestNovels ? 'latest' : (filters?.sort || 'rating'));
|
||||
|
||||
const body = await fetchApi(url).then(res => res.text());
|
||||
|
||||
const loadedCheerio = parseHTML(body);
|
||||
|
||||
|
||||
loadedCheerio('.manga-title-badges').remove();
|
||||
|
||||
loadedCheerio('.page-item-detail').each(function () {
|
||||
@@ -202,4 +208,6 @@ export const searchNovels: Plugin.searchNovels = async (searchTerm) => {
|
||||
|
||||
export const fetchImage: Plugin.fetchImage = async (url) => {
|
||||
return await fetchFile(url);
|
||||
};
|
||||
};
|
||||
|
||||
export const filters = [{"key":"sort","label":"Order by","values":[{"label":"Rating","value":"rating"},{"label":"A-Z","value":"alphabet"},{"label":"Latest","value":"latest"},{"label":"Most Views","value":"views"},{"label":"New","value":"new-manga"},{"label":"Trending","value":"trending"}],"inputType":FilterInputs.Picker},{"key":"genres","label":"GENRES","values":[{"label":"Action","value":"action"},{"label":"Adventure","value":"adventure"},{"label":"Alchemy","value":"alchemy"},{"label":"Comedy","value":"comedy"},{"label":"Crafting","value":"crafting"},{"label":"Cultivation","value":"cultivation"},{"label":"Drama","value":"drama"},{"label":"Dungeon Crawling","value":"dungeon-crawling"},{"label":"Eci","value":"eci"},{"label":"Fantasy","value":"fantasy"},{"label":"Game","value":"game"},{"label":"Harem","value":"harem"},{"label":"Horror","value":"horror"},{"label":"Josei","value":"josei"},{"label":"Kingdom Building","value":"kingdom-building"},{"label":"Martial Arts","value":"martial-arts"},{"label":"Mature","value":"mature"},{"label":"Mecha","value":"mecha"},{"label":"Modern Setting","value":"modern-setting"},{"label":"Mystery","value":"mystery"},{"label":"Pets","value":"pets"},{"label":"Psychological","value":"psychological"},{"label":"Reincarnator","value":"reincarnator"},{"label":"Romance","value":"romance"},{"label":"School Life","value":"school-life"},{"label":"Sci-fi","value":"sci-fi"},{"label":"Seinen","value":"seinen"},{"label":"Shounen","value":"shounen"},{"label":"Slice of Life","value":"slice-of-life"},{"label":"Sports","value":"sports"},{"label":"Supernatural","value":"supernatural"},{"label":"Tragedy","value":"tragedy"},{"label":"Transmigration","value":"transmigration"},{"label":"Virtual Reality","value":"virtual-reality"},{"label":"Wuxia","value":"wuxia"},{"label":"Xianxia","value":"xianxia"},{"label":"Xuanhuan","value":"xuanhuan"}],"inputType":FilterInputs.Picker}];
|
||||
Reference in New Issue
Block a user