plugin refactoring (#639)
* fix * fix * madara plugins cleaned Error: net::ERR_NAME_NOT_RESOLVED at https://cratenovel.com/novel/page/1?m_orderby=latest Error: net::ERR_SSL_PROTOCOL_ERROR at https://clicknovel.net/novel/page/1?m_orderby=latest Error: net::ERR_NAME_NOT_RESOLVED at https://www.onlymtl.com/novel/page/1?m_orderby=latest Error: net::ERR_TOO_MANY_REDIRECTS at https://mtlnovel.club/novel/page/1?m_orderby=latest Error: net::ERR_NAME_NOT_RESOLVED at https://noobchan.xyz/novel/page/1?m_orderby=latest * readwn * .
This commit is contained in:
@@ -44,7 +44,7 @@ class MadaraPlugin implements Plugin.PluginBase {
|
||||
userAgent: string;
|
||||
cookieString: string;
|
||||
options?: MadaraOptions;
|
||||
filter?: Filter[] | undefined;
|
||||
filters?: Filter[] | undefined;
|
||||
|
||||
constructor(metadata: MadaraMetadata){
|
||||
this.id = metadata.id;
|
||||
@@ -56,14 +56,14 @@ class MadaraPlugin implements Plugin.PluginBase {
|
||||
this.userAgent = "";
|
||||
this.cookieString = "";
|
||||
this.options = metadata.options;
|
||||
this.filter = metadata.filters;
|
||||
this.filters = metadata.filters;
|
||||
}
|
||||
async popularNovels(pageNo: number, {filters, showLatestNovels}: Plugin.PopularNovelsOptions): Promise<Plugin.NovelItem[]> {
|
||||
const novels: Plugin.NovelItem[] = [];
|
||||
|
||||
let url = this.site;
|
||||
if (filters?.genres && this.options?.path?.genres) {
|
||||
url += this.options?.path?.genres + filters.genres + '/';
|
||||
url += this.options?.path?.genres + filters.genres;
|
||||
} else {
|
||||
url += this.options?.path?.novels ? this.options.path.novels : MadaraDefaultPath.novels;
|
||||
}
|
||||
@@ -247,6 +247,6 @@ class MadaraPlugin implements Plugin.PluginBase {
|
||||
return await fetchFile(url, {});
|
||||
}
|
||||
}
|
||||
const plugin = new MadaraPlugin({"id":"turkcelightnovels","sourceSite":"https://turkcelightnovels.com/","sourceName":"TurkceLightNovels","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":"Picker"}],"options":{"path":{"novels":"light-novel","novel":"light-novel","chapter":"light-novel"},"lang":"Turkish"}});
|
||||
const plugin = new MadaraPlugin({"id":"turkcelightnovels","sourceSite":"https://turkcelightnovels.com/","sourceName":"TurkceLightNovels","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":1}],"options":{"path":{"novels":"light-novel","novel":"light-novel","chapter":"light-novel"},"lang":"Turkish"}});
|
||||
export default plugin;
|
||||
|
||||
@@ -44,7 +44,7 @@ class MadaraPlugin implements Plugin.PluginBase {
|
||||
userAgent: string;
|
||||
cookieString: string;
|
||||
options?: MadaraOptions;
|
||||
filter?: Filter[] | undefined;
|
||||
filters?: Filter[] | undefined;
|
||||
|
||||
constructor(metadata: MadaraMetadata){
|
||||
this.id = metadata.id;
|
||||
@@ -56,14 +56,14 @@ class MadaraPlugin implements Plugin.PluginBase {
|
||||
this.userAgent = "";
|
||||
this.cookieString = "";
|
||||
this.options = metadata.options;
|
||||
this.filter = metadata.filters;
|
||||
this.filters = metadata.filters;
|
||||
}
|
||||
async popularNovels(pageNo: number, {filters, showLatestNovels}: Plugin.PopularNovelsOptions): Promise<Plugin.NovelItem[]> {
|
||||
const novels: Plugin.NovelItem[] = [];
|
||||
|
||||
let url = this.site;
|
||||
if (filters?.genres && this.options?.path?.genres) {
|
||||
url += this.options?.path?.genres + filters.genres + '/';
|
||||
url += this.options?.path?.genres + filters.genres;
|
||||
} else {
|
||||
url += this.options?.path?.novels ? this.options.path.novels : MadaraDefaultPath.novels;
|
||||
}
|
||||
@@ -247,6 +247,6 @@ class MadaraPlugin implements Plugin.PluginBase {
|
||||
return await fetchFile(url, {});
|
||||
}
|
||||
}
|
||||
const plugin = new MadaraPlugin({"id":"webnoveloku","sourceSite":"https://www.webnoveloku.com/","sourceName":"WebNovelOku ","filters":[{"key":"sort","label":"Sırala","values":[{"label":"A-Z","value":"alphabet"},{"label":"En Son","value":"latest"},{"label":"Görüntülenme","value":"views"},{"label":"Popülarite","value":"trending"},{"label":"Reyting","value":"rating"},{"label":"Yeni","value":"new-manga"}],"inputType":"Picker"}],"options":{"lang":"Turkish"}});
|
||||
const plugin = new MadaraPlugin({"id":"webnoveloku","sourceSite":"https://www.webnoveloku.com/","sourceName":"WebNovelOku ","filters":[{"key":"sort","label":"Sırala","values":[{"label":"A-Z","value":"alphabet"},{"label":"En Son","value":"latest"},{"label":"Görüntülenme","value":"views"},{"label":"Popülarite","value":"trending"},{"label":"Reyting","value":"rating"},{"label":"Yeni","value":"new-manga"}],"inputType":1}],"options":{"lang":"Turkish"}});
|
||||
export default plugin;
|
||||
|
||||
Reference in New Issue
Block a user