fix: Update Plugins (#677)

* typo

* update

* fix

* fix

* update

* ifreedom

* fix

* fix ranobelib

* ...
This commit is contained in:
Rider21
2024-01-07 14:25:02 +03:00
committed by GitHub
parent 8a267561cb
commit f36e93d0a6
154 changed files with 68923 additions and 58660 deletions
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
File diff suppressed because one or more lines are too long
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
+8 -7
View File
@@ -15,7 +15,8 @@ interface MadaraOptionPath {
chapter?: string;
}
const MadaraDefaultPath: MadaraOptionPath = {
const MadaraDefaultPath = {
genres: "novel-genre",
novels: "novel",
novel: "novel",
chapter: "novel",
@@ -70,12 +71,12 @@ class MadaraPlugin implements Plugin.PluginBase {
const novels: Plugin.NovelItem[] = [];
let url = this.site;
if (filters?.genres && this.options?.path?.genres) {
url += this.options?.path?.genres + filters.genres;
if (filters?.genres?.value) {
url += (this.options?.path?.genres || MadaraDefaultPath.genres) +
"/" +
filters.genres.value;
} else {
url += this.options?.path?.novels
? this.options.path.novels
: MadaraDefaultPath.novels;
url += this.options?.path?.novels || MadaraDefaultPath.novels;
}
url +=
@@ -83,7 +84,7 @@ class MadaraPlugin implements Plugin.PluginBase {
pageNo +
"/" +
"?m_orderby=" +
(showLatestNovels ? "latest" : filters?.sort || "rating");
(showLatestNovels ? "latest" : filters?.sort?.value || "rating");
const body = await fetchApi(url).then((res) => res.text());
-166
View File
@@ -1,166 +0,0 @@
import { load as parseHTML } from "cheerio";
import { fetchApi, fetchFile } from "@libs/fetch";
import { Novel, Plugin } from "@typings/plugin";
export const id = "FWN.com";
export const name = "Web NOVEL";
export const site = "https://freewebnovel.com/";
export const version = "1.0.0";
export const icon = "src/en/freewebnovel/icon.png";
const baseUrl = site;
export const popularNovels: Plugin.popularNovels = async function (page) {
let url = baseUrl + "completed-novel/" + page;
const result = await fetchApi(url);
const body = await result.text();
const loadedCheerio = parseHTML(body);
let novels: Novel.Item[] = [];
loadedCheerio(".li-row").each(function () {
const novelName = loadedCheerio(this).find(".tit").text();
const novelCover = loadedCheerio(this).find("img").attr("src");
let novelUrl =
"https://freewebnovel.com" +
loadedCheerio(this).find("h3 > a").attr("href");
const novel = {
name: novelName,
cover: novelCover,
url: novelUrl,
};
novels.push(novel);
});
return novels;
};
export const parseNovelAndChapters: Plugin.parseNovelAndChapters =
async function (novelUrl) {
const url = novelUrl;
const result = await fetchApi(url);
const body = await result.text();
const loadedCheerio = parseHTML(body);
let novel: Novel.instance = {
url,
};
novel.name = loadedCheerio("h1.tit").text();
novel.cover = loadedCheerio(".pic > img").attr("src");
novel.genres = loadedCheerio("[title=Genre]")
.next()
.text()
.replace(/[\t\n]/g, "");
novel.author = loadedCheerio("[title=Author]")
.next()
.text()
.replace(/[\t\n]/g, "");
novel.status = loadedCheerio("[title=Status]")
.next()
.text()
.replace(/[\t\n]/g, "");
let novelSummary = loadedCheerio(".inner").text().trim();
novel.summary = novelSummary;
let novelChapters = [];
let latestChapter: string | undefined;
loadedCheerio("h3.tit").each(function (res) {
if (loadedCheerio(this).find("a").text() === novel.name) {
latestChapter = loadedCheerio(this)
.next()
.find("span.s3")
.text()
.match(/(\d+)/)?.[0];
}
});
let prefixUrl = novelUrl.replace(".html", "/");
for (let i = 1; i <= parseInt(latestChapter || "0", 10); i++) {
const chapterName = "Chapter " + i;
const releaseDate = null;
let chapterUrl = "chapter-" + i;
chapterUrl = `${prefixUrl}${chapterUrl}.html`;
const chapter = {
name: chapterName,
releaseTime: releaseDate,
url: chapterUrl,
};
novelChapters.push(chapter);
}
novel.chapters = novelChapters;
return novel;
};
export const parseChapter: Plugin.parseChapter = async function (chapterUrl) {
const url = chapterUrl;
const result = await fetchApi(url);
const body = await result.text();
const loadedCheerio = parseHTML(body);
let chapterText = loadedCheerio("div.txt").html();
return chapterText;
};
export const searchNovels: Plugin.searchNovels = async function (searchTerm) {
const url = baseUrl + "search/";
const formData = {
searchkey: searchTerm,
};
const result = await fetchApi(url, {
method: "POST",
body: JSON.stringify(formData),
});
const body = await result.text();
const loadedCheerio = parseHTML(body);
let novels: Novel.Item[] = [];
loadedCheerio(".li-row > .li > .con").each(function () {
const novelName = loadedCheerio(this).find(".tit").text();
const novelCover = loadedCheerio(this)
.find(".pic > a > img")
.attr("data-cfsrc");
let novelUrl =
"https://freewebnovel.com" +
loadedCheerio(this).find("h3 > a").attr("href");
const novel = {
name: novelName,
cover: novelCover,
url: novelUrl,
};
novels.push(novel);
});
return novels;
};
export const fetchImage: Plugin.fetchImage = fetchFile;
+104
View File
@@ -0,0 +1,104 @@
import { Plugin } from "@typings/plugin";
import { fetchApi, fetchFile } from "@libs/fetch";
import { NovelStatus } from "@libs/novelStatus";
import { load as parseHTML } from "cheerio";
class FreeWebNovel implements Plugin.PluginBase {
id = "FWN.com";
name = "Web NOVEL";
site = "https://freewebnovel.com";
version = "1.0.0";
icon = "src/en/freewebnovel/icon.png";
userAgent = "";
cookieString = "";
async popularNovels(
page: number,
{ showLatestNovels }: Plugin.PopularNovelsOptions,
): Promise<Plugin.NovelItem[]> {
const sort = showLatestNovels
? "/latest-release-novels/"
: "/completed-novels/";
const body = await fetchApi(this.site + sort + page).then((res) => res.text());
const loadedCheerio = parseHTML(body);
const novels: Plugin.NovelItem[] = loadedCheerio(".li-row")
.map((index, element) => ({
name: loadedCheerio(element).find(".tit").text(),
cover: loadedCheerio(element).find("img").attr("src"),
url: this.site + loadedCheerio(element).find("h3 > a").attr("href"),
}))
.get();
return novels;
}
async parseNovelAndChapters(url: string): Promise<Plugin.SourceNovel> {
const body = await fetchApi(url).then((res) => res.text());
const loadedCheerio = parseHTML(body);
const novel: Plugin.SourceNovel = { url };
novel.name = loadedCheerio("h1.tit").text();
novel.cover = loadedCheerio(".pic > img").attr("src");
novel.genres = loadedCheerio("[title=Genre]")
.next()
.text()
.replace(/[\t\n]/g, "");
novel.author = loadedCheerio("[title=Author]")
.next()
.text()
.replace(/[\t\n]/g, "");
novel.status = loadedCheerio("[title=Status]")
.next()
.text()
.replace(/[\t\n]/g, "");
novel.summary = loadedCheerio(".inner").text().trim();
const chapters: Plugin.ChapterItem[] = loadedCheerio("#idData > li > a")
.map((index, element) => ({
name: loadedCheerio(element).attr("title") || "Chapter " + index,
releaseTime: null,
url: this.site + loadedCheerio(element).attr("href"),
}))
.get();
novel.chapters = chapters;
return novel;
}
async parseChapter(chapterUrl: string): Promise<string> {
const body = await fetchApi(chapterUrl).then((res) => res.text());
const loadedCheerio = parseHTML(body);
const chapterText = loadedCheerio("div.txt").html() || "";
return chapterText;
}
async searchNovels(
searchkey: string,
): Promise<Plugin.NovelItem[]> {
const body = await fetchApi(this.site + "/search/", {
method: "POST",
body: JSON.stringify({ searchkey }),
}).then((res) => res.text());
const loadedCheerio = parseHTML(body);
const novels: Plugin.NovelItem[] = loadedCheerio(".li-row > .li > .con")
.map((index, element) => ({
name: loadedCheerio(element).find(".tit").text(),
cover: loadedCheerio(element).find(".pic > a > img").attr("data-cfsrc"),
url: this.site + loadedCheerio(element).find("h3 > a").attr("href"),
}))
.get();
return novels;
}
fetchImage = fetchFile;
}
export default new FreeWebNovel();