Add Spanish plugins + Light Novel Brasil (#908)
* added hasutl * added novelasligera * added ReinoWuxia * added Oasis Translations * added SkyNovels * added Yuuki Tls * added Light Novel Brasil
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 507 B |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 750 B |
@@ -6,7 +6,7 @@ import { Plugin } from '@typings/plugin';
|
|||||||
class LightNovelBrasil implements Plugin.PluginBase {
|
class LightNovelBrasil implements Plugin.PluginBase {
|
||||||
id = 'lightnovelbrasil';
|
id = 'lightnovelbrasil';
|
||||||
name = 'Light Novel Brasil';
|
name = 'Light Novel Brasil';
|
||||||
icon = 'multisrc/wpmangastream/icons/lightnovelbrasil.png';
|
icon = 'src/pt/lightnovelbrasil/icon.png';
|
||||||
site = 'https://lightnovelbrasil.com/';
|
site = 'https://lightnovelbrasil.com/';
|
||||||
version = '1.0.0';
|
version = '1.0.0';
|
||||||
|
|
||||||
@@ -35,19 +35,19 @@ class LightNovelBrasil implements Plugin.PluginBase {
|
|||||||
|
|
||||||
const novels: Plugin.NovelItem[] = [];
|
const novels: Plugin.NovelItem[] = [];
|
||||||
|
|
||||||
loadedCheerio('article.bs').each(function () {
|
loadedCheerio('article.bs').each((idx, ele) => {
|
||||||
const novelName = loadedCheerio(this).find('.ntitle').text().trim();
|
const novelName = loadedCheerio(ele).find('.ntitle').text().trim();
|
||||||
let image = loadedCheerio(this).find('img');
|
let image = loadedCheerio(ele).find('img');
|
||||||
const novelCover = image.attr('data-src') || image.attr('src');
|
const novelCover = image.attr('data-src') || image.attr('src');
|
||||||
|
|
||||||
const novelUrl = loadedCheerio(this).find('a').attr('href');
|
const novelUrl = loadedCheerio(ele).find('a').attr('href');
|
||||||
|
|
||||||
if (!novelUrl) return;
|
if (!novelUrl) return;
|
||||||
|
|
||||||
const novel = {
|
const novel = {
|
||||||
name: novelName,
|
name: novelName,
|
||||||
cover: novelCover,
|
cover: novelCover,
|
||||||
url: novelUrl,
|
path: novelUrl.replace(this.site, ''),
|
||||||
};
|
};
|
||||||
|
|
||||||
novels.push(novel);
|
novels.push(novel);
|
||||||
@@ -56,8 +56,8 @@ class LightNovelBrasil implements Plugin.PluginBase {
|
|||||||
return novels;
|
return novels;
|
||||||
}
|
}
|
||||||
|
|
||||||
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
async parseNovel(novelPath: string): Promise<Plugin.SourceNovel> {
|
||||||
const url = novelUrl;
|
const url = this.site + novelPath;
|
||||||
const headers = new Headers();
|
const headers = new Headers();
|
||||||
const result = await fetchApi(url, { headers });
|
const result = await fetchApi(url, { headers });
|
||||||
const body = await result.text();
|
const body = await result.text();
|
||||||
@@ -65,12 +65,11 @@ class LightNovelBrasil implements Plugin.PluginBase {
|
|||||||
let loadedCheerio = parseHTML(body);
|
let loadedCheerio = parseHTML(body);
|
||||||
|
|
||||||
const novel: Plugin.SourceNovel = {
|
const novel: Plugin.SourceNovel = {
|
||||||
url,
|
path: novelPath,
|
||||||
|
name: loadedCheerio('.entry-title').text(),
|
||||||
chapters: [],
|
chapters: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
novel.name = loadedCheerio('.entry-title').text();
|
|
||||||
|
|
||||||
novel.cover =
|
novel.cover =
|
||||||
loadedCheerio('img.wp-post-image').attr('data-src') ||
|
loadedCheerio('img.wp-post-image').attr('data-src') ||
|
||||||
loadedCheerio('img.wp-post-image').attr('src');
|
loadedCheerio('img.wp-post-image').attr('src');
|
||||||
@@ -103,22 +102,22 @@ class LightNovelBrasil implements Plugin.PluginBase {
|
|||||||
|
|
||||||
loadedCheerio('.eplister')
|
loadedCheerio('.eplister')
|
||||||
.find('li')
|
.find('li')
|
||||||
.each(function () {
|
.each((idx, ele) => {
|
||||||
const chapterName =
|
const chapterName =
|
||||||
loadedCheerio(this).find('.epl-num').text() +
|
loadedCheerio(ele).find('.epl-num').text() +
|
||||||
' - ' +
|
' - ' +
|
||||||
loadedCheerio(this).find('.epl-title').text();
|
loadedCheerio(ele).find('.epl-title').text();
|
||||||
|
|
||||||
const releaseDate = loadedCheerio(this).find('.epl-date').text().trim();
|
const releaseDate = loadedCheerio(ele).find('.epl-date').text().trim();
|
||||||
|
|
||||||
const chapterUrl = loadedCheerio(this).find('a').attr('href');
|
const chapterUrl = loadedCheerio(ele).find('a').attr('href');
|
||||||
|
|
||||||
if (!chapterUrl) return;
|
if (!chapterUrl) return;
|
||||||
|
|
||||||
chapter.push({
|
chapter.push({
|
||||||
name: chapterName,
|
name: chapterName,
|
||||||
releaseTime: releaseDate,
|
releaseTime: releaseDate,
|
||||||
url: chapterUrl,
|
path: chapterUrl.replace(this.site, ''),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -126,9 +125,9 @@ class LightNovelBrasil implements Plugin.PluginBase {
|
|||||||
|
|
||||||
return novel;
|
return novel;
|
||||||
}
|
}
|
||||||
async parseChapter(chapterUrl: string): Promise<string> {
|
async parseChapter(chapterPath: string): Promise<string> {
|
||||||
const headers = new Headers();
|
const headers = new Headers();
|
||||||
const result = await fetchApi(chapterUrl, { headers });
|
const result = await fetchApi(this.site + chapterPath, { headers });
|
||||||
const body = await result.text();
|
const body = await result.text();
|
||||||
|
|
||||||
const loadedCheerio = parseHTML(body);
|
const loadedCheerio = parseHTML(body);
|
||||||
@@ -151,15 +150,15 @@ class LightNovelBrasil implements Plugin.PluginBase {
|
|||||||
|
|
||||||
const novels: Plugin.NovelItem[] = [];
|
const novels: Plugin.NovelItem[] = [];
|
||||||
|
|
||||||
loadedCheerio('article.bs').each(function () {
|
loadedCheerio('article.bs').each((idx, ele) => {
|
||||||
const novelName = loadedCheerio(this).find('.ntitle').text().trim();
|
const novelName = loadedCheerio(ele).find('.ntitle').text().trim();
|
||||||
const novelCover = loadedCheerio(this).find('img').attr('src');
|
const novelCover = loadedCheerio(ele).find('img').attr('src');
|
||||||
const novelUrl = loadedCheerio(this).find('a').attr('href');
|
const novelUrl = loadedCheerio(ele).find('a').attr('href');
|
||||||
if (!novelUrl) return;
|
if (!novelUrl) return;
|
||||||
|
|
||||||
novels.push({
|
novels.push({
|
||||||
name: novelName,
|
name: novelName,
|
||||||
url: novelUrl,
|
path: novelUrl.replace(this.site, ''),
|
||||||
cover: novelCover,
|
cover: novelCover,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -6,16 +6,15 @@ import { Filters } from '@libs/filterInputs';
|
|||||||
class HasulTL implements Plugin.PluginBase {
|
class HasulTL implements Plugin.PluginBase {
|
||||||
id = 'HasuTL';
|
id = 'HasuTL';
|
||||||
name = 'Hasu Translations';
|
name = 'Hasu Translations';
|
||||||
icon = 'src/es/hasutl/icon.png';
|
icon = 'src/es/hasutl/icon.jpg';
|
||||||
site = 'https://hasutl.wordpress.com/';
|
site = 'https://hasutl.wordpress.com/';
|
||||||
filters?: Filters | undefined;
|
|
||||||
version = '1.0.0';
|
version = '1.0.0';
|
||||||
baseUrl = this.site;
|
|
||||||
async popularNovels(
|
async popularNovels(
|
||||||
pageNo: number,
|
pageNo: number,
|
||||||
options: Plugin.PopularNovelsOptions<Filters>,
|
options: Plugin.PopularNovelsOptions<Filters>,
|
||||||
): Promise<Plugin.NovelItem[]> {
|
): Promise<Plugin.NovelItem[]> {
|
||||||
let url = this.baseUrl + 'light-novels-activas/';
|
let url = this.site + 'light-novels-activas/';
|
||||||
|
|
||||||
const result = await fetch(url);
|
const result = await fetch(url);
|
||||||
const body = await result.text();
|
const body = await result.text();
|
||||||
@@ -24,11 +23,11 @@ class HasulTL implements Plugin.PluginBase {
|
|||||||
|
|
||||||
let novels: Plugin.NovelItem[] = [];
|
let novels: Plugin.NovelItem[] = [];
|
||||||
|
|
||||||
loadedCheerio('div.wp-block-columns').each(function () {
|
loadedCheerio('div.wp-block-columns').each((idx, ele) => {
|
||||||
const novelName = loadedCheerio(this).find('.wp-block-button').text();
|
const novelName = loadedCheerio(ele).find('.wp-block-button').text();
|
||||||
const novelCover = loadedCheerio(this).find('img').attr('src');
|
const novelCover = loadedCheerio(ele).find('img').attr('src');
|
||||||
|
|
||||||
let novelUrl = loadedCheerio(this)
|
let novelUrl = loadedCheerio(ele)
|
||||||
.find('.wp-block-button > a')
|
.find('.wp-block-button > a')
|
||||||
.attr('href');
|
.attr('href');
|
||||||
|
|
||||||
@@ -37,16 +36,15 @@ class HasulTL implements Plugin.PluginBase {
|
|||||||
const novel = {
|
const novel = {
|
||||||
name: novelName,
|
name: novelName,
|
||||||
cover: novelCover,
|
cover: novelCover,
|
||||||
url: novelUrl,
|
path: novelUrl.replace(this.site, ''),
|
||||||
};
|
};
|
||||||
|
|
||||||
novels.push(novel);
|
novels.push(novel);
|
||||||
});
|
});
|
||||||
|
|
||||||
return novels;
|
return novels;
|
||||||
}
|
}
|
||||||
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
async parseNovel(novelPath: string): Promise<Plugin.SourceNovel> {
|
||||||
const url = novelUrl;
|
const url = this.site + novelPath;
|
||||||
|
|
||||||
const result = await fetch(url);
|
const result = await fetch(url);
|
||||||
const body = await result.text();
|
const body = await result.text();
|
||||||
@@ -54,13 +52,9 @@ class HasulTL implements Plugin.PluginBase {
|
|||||||
let loadedCheerio = parseHTML(body);
|
let loadedCheerio = parseHTML(body);
|
||||||
|
|
||||||
let novel: Plugin.SourceNovel = {
|
let novel: Plugin.SourceNovel = {
|
||||||
url,
|
path: novelPath,
|
||||||
|
name: loadedCheerio('.post-header').text(),
|
||||||
};
|
};
|
||||||
|
|
||||||
novel.url = novelUrl;
|
|
||||||
|
|
||||||
novel.name = loadedCheerio('.post-header').text();
|
|
||||||
|
|
||||||
novel.cover = loadedCheerio('.featured-media > img').attr('src');
|
novel.cover = loadedCheerio('.featured-media > img').attr('src');
|
||||||
|
|
||||||
let novelSummary = loadedCheerio('.post-content').find('p').html()!;
|
let novelSummary = loadedCheerio('.post-content').find('p').html()!;
|
||||||
@@ -70,19 +64,19 @@ class HasulTL implements Plugin.PluginBase {
|
|||||||
|
|
||||||
loadedCheerio('.wp-block-media-text__content')
|
loadedCheerio('.wp-block-media-text__content')
|
||||||
.find('a')
|
.find('a')
|
||||||
.each(function () {
|
.each((idx, ele) => {
|
||||||
const chapterName = loadedCheerio(this).text().trim();
|
const chapterName = loadedCheerio(ele).text().trim();
|
||||||
|
|
||||||
const releaseDate = null;
|
const releaseDate = null;
|
||||||
|
|
||||||
let chapterUrl = loadedCheerio(this).attr('href');
|
let chapterUrl = loadedCheerio(ele).attr('href');
|
||||||
|
|
||||||
if (!chapterUrl) return;
|
if (!chapterUrl) return;
|
||||||
|
|
||||||
const chapter = {
|
const chapter = {
|
||||||
name: chapterName,
|
name: chapterName,
|
||||||
releaseTime: releaseDate,
|
releaseTime: releaseDate,
|
||||||
url: chapterUrl,
|
path: chapterUrl.replace(this.site, ''),
|
||||||
};
|
};
|
||||||
|
|
||||||
novelChapters.push(chapter);
|
novelChapters.push(chapter);
|
||||||
@@ -92,8 +86,8 @@ class HasulTL implements Plugin.PluginBase {
|
|||||||
|
|
||||||
return novel;
|
return novel;
|
||||||
}
|
}
|
||||||
async parseChapter(chapterUrl: string): Promise<string> {
|
async parseChapter(chapterPath: string): Promise<string> {
|
||||||
const url = chapterUrl;
|
const url = this.site + chapterPath;
|
||||||
|
|
||||||
const result = await fetch(url);
|
const result = await fetch(url);
|
||||||
const body = await result.text();
|
const body = await result.text();
|
||||||
@@ -108,7 +102,7 @@ class HasulTL implements Plugin.PluginBase {
|
|||||||
searchTerm: string,
|
searchTerm: string,
|
||||||
pageNo: number,
|
pageNo: number,
|
||||||
): Promise<Plugin.NovelItem[]> {
|
): Promise<Plugin.NovelItem[]> {
|
||||||
const url = `${this.baseUrl}?s=${searchTerm}&post_type=wp-manga`;
|
const url = `${this.site}?s=${searchTerm}&post_type=wp-manga`;
|
||||||
|
|
||||||
const result = await fetch(url);
|
const result = await fetch(url);
|
||||||
const body = await result.text();
|
const body = await result.text();
|
||||||
@@ -117,23 +111,23 @@ class HasulTL implements Plugin.PluginBase {
|
|||||||
|
|
||||||
let novels: Plugin.NovelItem[] = [];
|
let novels: Plugin.NovelItem[] = [];
|
||||||
|
|
||||||
loadedCheerio('.post-container').each(function () {
|
loadedCheerio('.post-container').each((idx, ele) => {
|
||||||
const novelName = loadedCheerio(this).find('.post-header').text();
|
const novelName = loadedCheerio(ele).find('.post-header').text();
|
||||||
if (
|
if (
|
||||||
!novelName.includes('Cap') &&
|
!novelName.includes('Cap') &&
|
||||||
!novelName.includes('Vol') &&
|
!novelName.includes('Vol') &&
|
||||||
!novelName.includes('Light Novels')
|
!novelName.includes('Light Novels')
|
||||||
) {
|
) {
|
||||||
const novelCover = loadedCheerio(this).find('img').attr('src');
|
const novelCover = loadedCheerio(ele).find('img').attr('src');
|
||||||
|
|
||||||
let novelUrl = loadedCheerio(this).find('a').attr('href');
|
let novelUrl = loadedCheerio(ele).find('a').attr('href');
|
||||||
|
|
||||||
if (!novelUrl) return;
|
if (!novelUrl) return;
|
||||||
|
|
||||||
const novel = {
|
const novel = {
|
||||||
name: novelName,
|
name: novelName,
|
||||||
cover: novelCover,
|
cover: novelCover,
|
||||||
url: novelUrl,
|
path: novelUrl.replace(this.site, ''),
|
||||||
};
|
};
|
||||||
|
|
||||||
novels.push(novel);
|
novels.push(novel);
|
||||||
@@ -4,18 +4,18 @@ import { Plugin } from '@typings/plugin';
|
|||||||
import { Filters } from '@libs/filterInputs';
|
import { Filters } from '@libs/filterInputs';
|
||||||
|
|
||||||
class Ligera implements Plugin.PluginBase {
|
class Ligera implements Plugin.PluginBase {
|
||||||
id = 'ligera.com';
|
id = 'novelasligera';
|
||||||
name = 'Novelas Ligera';
|
name = 'Novelas Ligera';
|
||||||
icon = 'src/es/novelasligera/icon.png';
|
icon = 'src/es/novelasligera/icon.png';
|
||||||
site = 'https://novelasligera.com/';
|
site = 'https://novelasligera.com/';
|
||||||
filters?: Filters | undefined;
|
filters?: Filters | undefined;
|
||||||
version = '1.0.0';
|
version = '1.0.0';
|
||||||
baseUrl = this.site;
|
|
||||||
async popularNovels(
|
async popularNovels(
|
||||||
pageNo: number,
|
pageNo: number,
|
||||||
options: Plugin.PopularNovelsOptions<Filters>,
|
options: Plugin.PopularNovelsOptions<Filters>,
|
||||||
): Promise<Plugin.NovelItem[]> {
|
): Promise<Plugin.NovelItem[]> {
|
||||||
let url = this.baseUrl;
|
let url = this.site;
|
||||||
|
|
||||||
const result = await fetch(url);
|
const result = await fetch(url);
|
||||||
const body = await result.text();
|
const body = await result.text();
|
||||||
@@ -24,21 +24,21 @@ class Ligera implements Plugin.PluginBase {
|
|||||||
|
|
||||||
let novels: Plugin.NovelItem[] = [];
|
let novels: Plugin.NovelItem[] = [];
|
||||||
|
|
||||||
loadedCheerio('.elementor-column').each(function () {
|
loadedCheerio('.elementor-column').each((idx, ele) => {
|
||||||
const novelName = loadedCheerio(this)
|
const novelName = loadedCheerio(ele)
|
||||||
.find('.widget-image-caption.wp-caption-text')
|
.find('.widget-image-caption.wp-caption-text')
|
||||||
.text();
|
.text();
|
||||||
if (novelName) {
|
if (novelName) {
|
||||||
const novelCover = loadedCheerio(this)
|
const novelCover = loadedCheerio(ele)
|
||||||
.find('a > img')
|
.find('a > img')
|
||||||
.attr('data-lazy-src');
|
.attr('data-lazy-src');
|
||||||
|
|
||||||
let novelUrl = loadedCheerio(this).find('a').attr('href');
|
let novelUrl = loadedCheerio(ele).find('a').attr('href');
|
||||||
if (!novelUrl) return;
|
if (!novelUrl) return;
|
||||||
const novel = {
|
const novel = {
|
||||||
name: novelName,
|
name: novelName,
|
||||||
cover: novelCover,
|
cover: novelCover,
|
||||||
url: novelUrl,
|
path: novelUrl.replace(this.site, ''),
|
||||||
};
|
};
|
||||||
|
|
||||||
novels.push(novel);
|
novels.push(novel);
|
||||||
@@ -47,8 +47,8 @@ class Ligera implements Plugin.PluginBase {
|
|||||||
|
|
||||||
return novels;
|
return novels;
|
||||||
}
|
}
|
||||||
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
async parseNovel(novelPath: string): Promise<Plugin.SourceNovel> {
|
||||||
const url = this.baseUrl + 'novela/' + novelUrl;
|
const url = this.site + novelPath;
|
||||||
|
|
||||||
// console.log(url);
|
// console.log(url);
|
||||||
|
|
||||||
@@ -57,13 +57,14 @@ class Ligera implements Plugin.PluginBase {
|
|||||||
|
|
||||||
let loadedCheerio = parseHTML(body);
|
let loadedCheerio = parseHTML(body);
|
||||||
|
|
||||||
let novel: Plugin.SourceNovel = { url };
|
let novel: Plugin.SourceNovel = {
|
||||||
|
path: novelPath,
|
||||||
novel.name = loadedCheerio('h1').text();
|
name: loadedCheerio('h1').text(),
|
||||||
|
};
|
||||||
|
|
||||||
novel.cover = loadedCheerio('.elementor-widget-container')
|
novel.cover = loadedCheerio('.elementor-widget-container')
|
||||||
.find('img')
|
.find('img')
|
||||||
.attr('src');
|
.attr('data-lazy-src');
|
||||||
|
|
||||||
loadedCheerio('.elementor-row')
|
loadedCheerio('.elementor-row')
|
||||||
.find('p')
|
.find('p')
|
||||||
@@ -97,15 +98,15 @@ class Ligera implements Plugin.PluginBase {
|
|||||||
|
|
||||||
loadedCheerio('.elementor-tab-content')
|
loadedCheerio('.elementor-tab-content')
|
||||||
.find('li')
|
.find('li')
|
||||||
.each(function () {
|
.each((idx, ele) => {
|
||||||
const chapterName = loadedCheerio(this).text();
|
const chapterName = loadedCheerio(ele).text();
|
||||||
const releaseDate = null;
|
const releaseDate = null;
|
||||||
const chapterUrl = loadedCheerio(this).find('a').attr('href');
|
const chapterUrl = loadedCheerio(ele).find('a').attr('href');
|
||||||
if (!chapterUrl) return;
|
if (!chapterUrl) return;
|
||||||
const chapter = {
|
const chapter = {
|
||||||
name: chapterName,
|
name: chapterName,
|
||||||
releaseTime: releaseDate,
|
releaseTime: releaseDate,
|
||||||
url: chapterUrl,
|
path: chapterUrl.replace(this.site, ''),
|
||||||
};
|
};
|
||||||
|
|
||||||
novelChapters.push(chapter);
|
novelChapters.push(chapter);
|
||||||
@@ -115,8 +116,8 @@ class Ligera implements Plugin.PluginBase {
|
|||||||
|
|
||||||
return novel;
|
return novel;
|
||||||
}
|
}
|
||||||
async parseChapter(chapterUrl: string): Promise<string> {
|
async parseChapter(chapterPath: string): Promise<string> {
|
||||||
const url = chapterUrl;
|
const url = this.site + chapterPath;
|
||||||
// console.log(url);
|
// console.log(url);
|
||||||
|
|
||||||
const result = await fetch(url);
|
const result = await fetch(url);
|
||||||
@@ -136,7 +137,7 @@ class Ligera implements Plugin.PluginBase {
|
|||||||
searchTerm: string,
|
searchTerm: string,
|
||||||
pageNo: number,
|
pageNo: number,
|
||||||
): Promise<Plugin.NovelItem[]> {
|
): Promise<Plugin.NovelItem[]> {
|
||||||
const url = this.baseUrl + '?s=' + searchTerm + '&post_type=wp-manga';
|
const url = this.site + '?s=' + searchTerm + '&post_type=wp-manga';
|
||||||
// console.log(url);
|
// console.log(url);
|
||||||
|
|
||||||
const result = await fetch(url);
|
const result = await fetch(url);
|
||||||
@@ -146,9 +147,9 @@ class Ligera implements Plugin.PluginBase {
|
|||||||
|
|
||||||
let novels: Plugin.NovelItem[] = [];
|
let novels: Plugin.NovelItem[] = [];
|
||||||
|
|
||||||
loadedCheerio('.inside-article').each(function () {
|
loadedCheerio('.inside-article').each((idx, ele) => {
|
||||||
const novelCover = loadedCheerio(this).find('img').attr('src');
|
const novelCover = loadedCheerio(ele).find('img').attr('src');
|
||||||
let novelUrl = loadedCheerio(this).find('a').attr('href');
|
let novelUrl = loadedCheerio(ele).find('a').attr('href');
|
||||||
|
|
||||||
let novelName;
|
let novelName;
|
||||||
|
|
||||||
@@ -165,7 +166,7 @@ class Ligera implements Plugin.PluginBase {
|
|||||||
const novel = {
|
const novel = {
|
||||||
name: novelName,
|
name: novelName,
|
||||||
cover: novelCover,
|
cover: novelCover,
|
||||||
url: novelUrl,
|
path: novelUrl.replace(this.site, ''),
|
||||||
};
|
};
|
||||||
|
|
||||||
novels.push(novel);
|
novels.push(novel);
|
||||||
@@ -5,13 +5,12 @@ import { defaultCover } from '@libs/defaultCover';
|
|||||||
import { Filters } from '@libs/filterInputs';
|
import { Filters } from '@libs/filterInputs';
|
||||||
|
|
||||||
class ReinoWuxia implements Plugin.PluginBase {
|
class ReinoWuxia implements Plugin.PluginBase {
|
||||||
id = 'awuxia.com';
|
id = 'reinowuxia';
|
||||||
name = 'ReinoWuxia';
|
name = 'ReinoWuxia';
|
||||||
icon = 'src/es/novelawuxia/icon.png';
|
icon = 'src/es/reinowuxia/icon.png';
|
||||||
filters?: Filters | undefined;
|
filters?: Filters | undefined;
|
||||||
version = '1.0.0';
|
version = '1.0.0';
|
||||||
site = 'http://www.reinowuxia.com/';
|
site = 'http://www.reinowuxia.com/';
|
||||||
baseUrl = this.site;
|
|
||||||
getNovelName(y: string | undefined) {
|
getNovelName(y: string | undefined) {
|
||||||
return y?.replace(/-/g, ' ').replace(/(?:^|\s)\S/g, a => a.toUpperCase());
|
return y?.replace(/-/g, ' ').replace(/(?:^|\s)\S/g, a => a.toUpperCase());
|
||||||
}
|
}
|
||||||
@@ -19,7 +18,7 @@ class ReinoWuxia implements Plugin.PluginBase {
|
|||||||
pageNo: number,
|
pageNo: number,
|
||||||
options: Plugin.PopularNovelsOptions<Filters>,
|
options: Plugin.PopularNovelsOptions<Filters>,
|
||||||
): Promise<Plugin.NovelItem[]> {
|
): Promise<Plugin.NovelItem[]> {
|
||||||
let url = this.baseUrl + 'p/todas-las-novelas.html';
|
let url = this.site + 'p/todas-las-novelas.html';
|
||||||
|
|
||||||
const result = await fetchApi(url, {
|
const result = await fetchApi(url, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
@@ -48,7 +47,7 @@ class ReinoWuxia implements Plugin.PluginBase {
|
|||||||
const novel = {
|
const novel = {
|
||||||
name: novelName,
|
name: novelName,
|
||||||
cover: novelCover,
|
cover: novelCover,
|
||||||
url: novelUrl,
|
path: novelUrl.replace(this.site, ''),
|
||||||
};
|
};
|
||||||
|
|
||||||
novels.push(novel);
|
novels.push(novel);
|
||||||
@@ -56,17 +55,18 @@ class ReinoWuxia implements Plugin.PluginBase {
|
|||||||
|
|
||||||
return novels;
|
return novels;
|
||||||
}
|
}
|
||||||
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
async parseNovel(novelPath: string): Promise<Plugin.SourceNovel> {
|
||||||
const url = novelUrl;
|
const url = this.site + novelPath;
|
||||||
|
|
||||||
const result = await fetchApi(url);
|
const result = await fetchApi(url);
|
||||||
const body = await result.text();
|
const body = await result.text();
|
||||||
|
|
||||||
let loadedCheerio = parseHTML(body);
|
let loadedCheerio = parseHTML(body);
|
||||||
|
|
||||||
let novel: Plugin.SourceNovel = { url };
|
let novel: Plugin.SourceNovel = {
|
||||||
|
path: novelPath,
|
||||||
novel.name = loadedCheerio('h1.post-title').text().trim();
|
name: loadedCheerio('h1.post-title').text().trim(),
|
||||||
|
};
|
||||||
|
|
||||||
novel.cover = loadedCheerio('div.separator').find('a').attr('href');
|
novel.cover = loadedCheerio('div.separator').find('a').attr('href');
|
||||||
|
|
||||||
@@ -94,13 +94,17 @@ class ReinoWuxia implements Plugin.PluginBase {
|
|||||||
|
|
||||||
let novelChapters: Plugin.ChapterItem[] = [];
|
let novelChapters: Plugin.ChapterItem[] = [];
|
||||||
|
|
||||||
loadedCheerio('div').each(function () {
|
loadedCheerio('div').each((idx, rootEle) => {
|
||||||
const detailName = loadedCheerio(this).text();
|
const detailName = loadedCheerio(rootEle).text();
|
||||||
if (detailName.includes('Sinopsis')) {
|
if (detailName.includes('Sinopsis')) {
|
||||||
novel.summary =
|
novel.summary =
|
||||||
loadedCheerio(this).next().text() !== ''
|
loadedCheerio(rootEle).next().text() !== ''
|
||||||
? loadedCheerio(this).next().text().replace('Sinopsis', '').trim()
|
? loadedCheerio(rootEle)
|
||||||
: loadedCheerio(this)
|
.next()
|
||||||
|
.text()
|
||||||
|
.replace('Sinopsis', '')
|
||||||
|
.trim()
|
||||||
|
: loadedCheerio(rootEle)
|
||||||
.next()
|
.next()
|
||||||
.next()
|
.next()
|
||||||
.text()
|
.text()
|
||||||
@@ -109,22 +113,25 @@ class ReinoWuxia implements Plugin.PluginBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (detailName.includes('Lista de Capítulos')) {
|
if (detailName.includes('Lista de Capítulos')) {
|
||||||
loadedCheerio(this)
|
loadedCheerio(rootEle)
|
||||||
.find('a')
|
.find('a')
|
||||||
.each(function (res) {
|
.each((idx, ele) => {
|
||||||
const chapterName = loadedCheerio(this).text();
|
const chapterName = loadedCheerio(ele).text();
|
||||||
let chapterUrl = loadedCheerio(this).attr('href');
|
const chapterPath = loadedCheerio(ele)
|
||||||
|
.attr('href')
|
||||||
|
?.replace(this.site, '');
|
||||||
const releaseDate = null;
|
const releaseDate = null;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
chapterName &&
|
chapterName &&
|
||||||
chapterUrl &&
|
chapterPath &&
|
||||||
|
chapterPath !== '/' &&
|
||||||
!novelChapters.some(chap => chap.name === chapterName)
|
!novelChapters.some(chap => chap.name === chapterName)
|
||||||
) {
|
) {
|
||||||
const chapter = {
|
const chapter = {
|
||||||
name: chapterName,
|
name: chapterName,
|
||||||
releaseTime: releaseDate,
|
releaseTime: releaseDate,
|
||||||
url: chapterUrl,
|
path: chapterPath,
|
||||||
};
|
};
|
||||||
|
|
||||||
novelChapters.push(chapter);
|
novelChapters.push(chapter);
|
||||||
@@ -137,8 +144,8 @@ class ReinoWuxia implements Plugin.PluginBase {
|
|||||||
|
|
||||||
return novel;
|
return novel;
|
||||||
}
|
}
|
||||||
async parseChapter(chapterUrl: string): Promise<string> {
|
async parseChapter(chapterPath: string): Promise<string> {
|
||||||
const url = chapterUrl;
|
const url = this.site + chapterPath;
|
||||||
|
|
||||||
const result = await fetchApi(url);
|
const result = await fetchApi(url);
|
||||||
const body = await result.text();
|
const body = await result.text();
|
||||||
@@ -153,7 +160,7 @@ class ReinoWuxia implements Plugin.PluginBase {
|
|||||||
searchTerm: string,
|
searchTerm: string,
|
||||||
pageNo: number,
|
pageNo: number,
|
||||||
): Promise<Plugin.NovelItem[]> {
|
): Promise<Plugin.NovelItem[]> {
|
||||||
const url = `${this.baseUrl}search?q=${searchTerm}`;
|
const url = `${this.site}search?q=${searchTerm}`;
|
||||||
|
|
||||||
const result = await fetchApi(url);
|
const result = await fetchApi(url);
|
||||||
const body = await result.text();
|
const body = await result.text();
|
||||||
@@ -183,7 +190,7 @@ class ReinoWuxia implements Plugin.PluginBase {
|
|||||||
const novel = {
|
const novel = {
|
||||||
name: novelName,
|
name: novelName,
|
||||||
cover: novelCover,
|
cover: novelCover,
|
||||||
url: novelUrl,
|
path: novelUrl.replace(this.site, ''),
|
||||||
};
|
};
|
||||||
|
|
||||||
novels.push(novel);
|
novels.push(novel);
|
||||||
@@ -2,17 +2,8 @@ import { fetchFile, fetchApi } from '@libs/fetch';
|
|||||||
import { Filters } from '@libs/filterInputs';
|
import { Filters } from '@libs/filterInputs';
|
||||||
import { Plugin } from '@typings/plugin';
|
import { Plugin } from '@typings/plugin';
|
||||||
import { load as parseHTML } from 'cheerio';
|
import { load as parseHTML } from 'cheerio';
|
||||||
|
|
||||||
export const id = 'oasisTL.wp';
|
|
||||||
export const name = 'Oasis Translations';
|
|
||||||
export const site = 'https://oasistranslations.wordpress.com/';
|
|
||||||
export const version = '1.0.0';
|
|
||||||
export const icon = 'src/es/oasistranslations/icon.png';
|
|
||||||
|
|
||||||
const baseUrl = site;
|
|
||||||
|
|
||||||
class Oasis implements Plugin.PluginBase {
|
class Oasis implements Plugin.PluginBase {
|
||||||
id = 'oasisTL.wp';
|
id = 'oasistranslations';
|
||||||
name = 'Oasis Translations';
|
name = 'Oasis Translations';
|
||||||
site = 'https://oasistranslations.wordpress.com/';
|
site = 'https://oasistranslations.wordpress.com/';
|
||||||
version = '1.0.0';
|
version = '1.0.0';
|
||||||
@@ -22,7 +13,7 @@ class Oasis implements Plugin.PluginBase {
|
|||||||
pageNo: number,
|
pageNo: number,
|
||||||
options: Plugin.PopularNovelsOptions<Filters>,
|
options: Plugin.PopularNovelsOptions<Filters>,
|
||||||
): Promise<Plugin.NovelItem[]> {
|
): Promise<Plugin.NovelItem[]> {
|
||||||
let url = baseUrl;
|
let url = this.site;
|
||||||
|
|
||||||
const result = await fetchApi(url);
|
const result = await fetchApi(url);
|
||||||
const body = await result.text();
|
const body = await result.text();
|
||||||
@@ -33,19 +24,19 @@ class Oasis implements Plugin.PluginBase {
|
|||||||
|
|
||||||
loadedCheerio('.menu-item-1819')
|
loadedCheerio('.menu-item-1819')
|
||||||
.find('.sub-menu > li')
|
.find('.sub-menu > li')
|
||||||
.each(function () {
|
.each((idx, ele) => {
|
||||||
const novelName = loadedCheerio(this).text();
|
const novelName = loadedCheerio(ele).text();
|
||||||
if (!novelName.match(/Activas|Finalizadas|Dropeadas/)) {
|
if (!novelName.match(/Activas|Finalizadas|Dropeadas/)) {
|
||||||
const novelCover = loadedCheerio(this).find('img').attr('src');
|
const novelCover = loadedCheerio(ele).find('img').attr('src');
|
||||||
|
|
||||||
let novelUrl = loadedCheerio(this).find('a').attr('href');
|
let novelUrl = loadedCheerio(ele).find('a').attr('href');
|
||||||
|
|
||||||
if (!novelUrl) return;
|
if (!novelUrl) return;
|
||||||
|
|
||||||
const novel = {
|
const novel = {
|
||||||
name: novelName,
|
name: novelName,
|
||||||
cover: novelCover,
|
cover: novelCover,
|
||||||
url: novelUrl,
|
path: novelUrl.replace(this.site, ''),
|
||||||
};
|
};
|
||||||
|
|
||||||
novels.push(novel);
|
novels.push(novel);
|
||||||
@@ -54,21 +45,21 @@ class Oasis implements Plugin.PluginBase {
|
|||||||
|
|
||||||
return novels;
|
return novels;
|
||||||
}
|
}
|
||||||
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
async parseNovel(novelPath: string): Promise<Plugin.SourceNovel> {
|
||||||
const url = novelUrl;
|
const url = this.site + novelPath;
|
||||||
|
|
||||||
const result = await fetchApi(url);
|
const result = await fetchApi(url);
|
||||||
const body = await result.text();
|
const body = await result.text();
|
||||||
|
|
||||||
let loadedCheerio = parseHTML(body);
|
let loadedCheerio = parseHTML(body);
|
||||||
|
|
||||||
let novel: Plugin.SourceNovel = { url };
|
let novel: Plugin.SourceNovel = {
|
||||||
|
path: novelPath,
|
||||||
novel.name = loadedCheerio('h1.entry-title')
|
name: loadedCheerio('h1.entry-title')
|
||||||
.text()
|
.text()
|
||||||
.replace(/[\t\n]/g, '')
|
.replace(/[\t\n]/g, '')
|
||||||
.trim();
|
.trim(),
|
||||||
|
};
|
||||||
novel.cover = loadedCheerio('img[loading="lazy"]').attr('src');
|
novel.cover = loadedCheerio('img[loading="lazy"]').attr('src');
|
||||||
|
|
||||||
loadedCheerio('.entry-content > p').each(function (res) {
|
loadedCheerio('.entry-content > p').each(function (res) {
|
||||||
@@ -94,17 +85,17 @@ class Oasis implements Plugin.PluginBase {
|
|||||||
// if ($(".entry-content").find("li").length) {
|
// if ($(".entry-content").find("li").length) {
|
||||||
loadedCheerio('.entry-content')
|
loadedCheerio('.entry-content')
|
||||||
.find('a')
|
.find('a')
|
||||||
.each(function () {
|
.each((idx, ele) => {
|
||||||
let chapterUrl = loadedCheerio(this).attr('href');
|
let chapterUrl = loadedCheerio(ele).attr('href');
|
||||||
|
|
||||||
if (chapterUrl && chapterUrl.includes(baseUrl)) {
|
if (chapterUrl && chapterUrl.includes(this.site)) {
|
||||||
const chapterName = loadedCheerio(this).text();
|
const chapterName = loadedCheerio(ele).text();
|
||||||
const releaseDate = null;
|
const releaseDate = null;
|
||||||
|
|
||||||
const chapter = {
|
const chapter = {
|
||||||
name: chapterName,
|
name: chapterName,
|
||||||
releaseTime: releaseDate,
|
releaseTime: releaseDate,
|
||||||
url: chapterUrl,
|
path: chapterUrl.replace(this.site, ''),
|
||||||
};
|
};
|
||||||
|
|
||||||
novelChapters.push(chapter);
|
novelChapters.push(chapter);
|
||||||
@@ -115,8 +106,8 @@ class Oasis implements Plugin.PluginBase {
|
|||||||
|
|
||||||
return novel;
|
return novel;
|
||||||
}
|
}
|
||||||
async parseChapter(chapterUrl: string): Promise<string> {
|
async parseChapter(chapterPath: string): Promise<string> {
|
||||||
const url = chapterUrl;
|
const url = this.site + chapterPath;
|
||||||
|
|
||||||
const result = await fetchApi(url);
|
const result = await fetchApi(url);
|
||||||
const body = await result.text();
|
const body = await result.text();
|
||||||
@@ -135,7 +126,7 @@ class Oasis implements Plugin.PluginBase {
|
|||||||
): Promise<Plugin.NovelItem[]> {
|
): Promise<Plugin.NovelItem[]> {
|
||||||
searchTerm = searchTerm.toLowerCase();
|
searchTerm = searchTerm.toLowerCase();
|
||||||
|
|
||||||
let url = baseUrl;
|
let url = this.site;
|
||||||
|
|
||||||
const result = await fetchApi(url);
|
const result = await fetchApi(url);
|
||||||
const body = await result.text();
|
const body = await result.text();
|
||||||
@@ -145,19 +136,19 @@ class Oasis implements Plugin.PluginBase {
|
|||||||
let novels: Plugin.NovelItem[] = [];
|
let novels: Plugin.NovelItem[] = [];
|
||||||
loadedCheerio('.menu-item-1819')
|
loadedCheerio('.menu-item-1819')
|
||||||
.find('.sub-menu > li')
|
.find('.sub-menu > li')
|
||||||
.each(function () {
|
.each((idx, ele) => {
|
||||||
const novelName = loadedCheerio(this).text();
|
const novelName = loadedCheerio(ele).text();
|
||||||
if (!novelName.match(/Activas|Finalizadas|Dropeadas/)) {
|
if (!novelName.match(/Activas|Finalizadas|Dropeadas/)) {
|
||||||
const novelCover = loadedCheerio(this).find('img').attr('src');
|
const novelCover = loadedCheerio(ele).find('img').attr('src');
|
||||||
|
|
||||||
let novelUrl = loadedCheerio(this).find('a').attr('href');
|
let novelUrl = loadedCheerio(ele).find('a').attr('href');
|
||||||
|
|
||||||
if (!novelUrl) return;
|
if (!novelUrl) return;
|
||||||
|
|
||||||
const novel = {
|
const novel = {
|
||||||
name: novelName,
|
name: novelName,
|
||||||
cover: novelCover,
|
cover: novelCover,
|
||||||
url: novelUrl,
|
path: novelUrl.replace(this.site, ''),
|
||||||
};
|
};
|
||||||
|
|
||||||
novels.push(novel);
|
novels.push(novel);
|
||||||
@@ -3,12 +3,11 @@ import { Filters } from '@libs/filterInputs';
|
|||||||
import { Plugin } from '@typings/plugin';
|
import { Plugin } from '@typings/plugin';
|
||||||
|
|
||||||
class SkyNovels implements Plugin.PluginBase {
|
class SkyNovels implements Plugin.PluginBase {
|
||||||
id = 'skynovels.net';
|
id = 'skynovels';
|
||||||
name = 'SkyNovels';
|
name = 'SkyNovels';
|
||||||
site = 'https://www.skynovels.net/';
|
site = 'https://www.skynovels.net/';
|
||||||
version = '1.0.0';
|
version = '1.0.0';
|
||||||
icon = 'src/es/skynovels/icon.png';
|
icon = 'src/es/skynovels/icon.png';
|
||||||
baseUrl = this.site;
|
|
||||||
|
|
||||||
async popularNovels(
|
async popularNovels(
|
||||||
pageNo: number,
|
pageNo: number,
|
||||||
@@ -27,18 +26,17 @@ class SkyNovels implements Plugin.PluginBase {
|
|||||||
'https://api.skynovels.net/api/get-image/' +
|
'https://api.skynovels.net/api/get-image/' +
|
||||||
res.image +
|
res.image +
|
||||||
'/novels/false';
|
'/novels/false';
|
||||||
const novelUrl =
|
const path = 'novelas/' + res.id + '/' + res.nvl_name + '/';
|
||||||
this.baseUrl + 'novelas/' + res.id + '/' + res.nvl_name + '/';
|
|
||||||
|
|
||||||
const novel = { name: novelName, url: novelUrl, cover: novelCover };
|
const novel = { name: novelName, path, cover: novelCover };
|
||||||
|
|
||||||
novels.push(novel);
|
novels.push(novel);
|
||||||
});
|
});
|
||||||
|
|
||||||
return novels;
|
return novels;
|
||||||
}
|
}
|
||||||
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
async parseNovel(novelPath: string): Promise<Plugin.SourceNovel> {
|
||||||
const novelId = novelUrl.split('/')[4];
|
const novelId = novelPath.split('/')[1];
|
||||||
const url =
|
const url =
|
||||||
'https://api.skynovels.net/api/novel/' + novelId + '/reading?&q';
|
'https://api.skynovels.net/api/novel/' + novelId + '/reading?&q';
|
||||||
|
|
||||||
@@ -47,9 +45,10 @@ class SkyNovels implements Plugin.PluginBase {
|
|||||||
|
|
||||||
const item = body?.novel?.[0];
|
const item = body?.novel?.[0];
|
||||||
|
|
||||||
let novel: Plugin.SourceNovel = { url: novelUrl };
|
let novel: Plugin.SourceNovel = {
|
||||||
|
path: novelPath,
|
||||||
novel.name = item?.nvl_title;
|
name: item?.nvl_title || 'Untitled',
|
||||||
|
};
|
||||||
|
|
||||||
novel.cover =
|
novel.cover =
|
||||||
'https://api.skynovels.net/api/get-image/' +
|
'https://api.skynovels.net/api/get-image/' +
|
||||||
@@ -69,12 +68,12 @@ class SkyNovels implements Plugin.PluginBase {
|
|||||||
volume?.chapters?.forEach(chapter => {
|
volume?.chapters?.forEach(chapter => {
|
||||||
const chapterName = chapter.chp_index_title;
|
const chapterName = chapter.chp_index_title;
|
||||||
const releaseDate = new Date(chapter.createdAt).toDateString();
|
const releaseDate = new Date(chapter.createdAt).toDateString();
|
||||||
const chapterUrl = novelUrl + chapter.id + '/' + chapter.chp_name;
|
const chapterPath = novelPath + chapter.id + '/' + chapter.chp_name;
|
||||||
|
|
||||||
const chap = {
|
const chap = {
|
||||||
name: chapterName,
|
name: chapterName,
|
||||||
releaseTime: releaseDate,
|
releaseTime: releaseDate,
|
||||||
url: chapterUrl,
|
path: chapterPath,
|
||||||
};
|
};
|
||||||
|
|
||||||
novelChapters.push(chap);
|
novelChapters.push(chap);
|
||||||
@@ -85,8 +84,8 @@ class SkyNovels implements Plugin.PluginBase {
|
|||||||
|
|
||||||
return novel;
|
return novel;
|
||||||
}
|
}
|
||||||
async parseChapter(chapterUrl: string): Promise<string> {
|
async parseChapter(chapterPath: string): Promise<string> {
|
||||||
let chapterId: string = chapterUrl.split('/')[6];
|
let chapterId: string = chapterPath.split('/')[3];
|
||||||
const url = `https://api.skynovels.net/api/novel-chapter/${chapterId}`;
|
const url = `https://api.skynovels.net/api/novel-chapter/${chapterId}`;
|
||||||
|
|
||||||
const result = await fetchApi(url);
|
const result = await fetchApi(url);
|
||||||
@@ -120,10 +119,9 @@ class SkyNovels implements Plugin.PluginBase {
|
|||||||
'https://api.skynovels.net/api/get-image/' +
|
'https://api.skynovels.net/api/get-image/' +
|
||||||
res.image +
|
res.image +
|
||||||
'/novels/false';
|
'/novels/false';
|
||||||
const novelUrl =
|
const path = 'novelas/' + res.id + '/' + res.nvl_name + '/';
|
||||||
this.baseUrl + 'novelas/' + res.id + '/' + res.nvl_name + '/';
|
|
||||||
|
|
||||||
const novel = { name: novelName, url: novelUrl, cover: novelCover };
|
const novel = { name: novelName, path, cover: novelCover };
|
||||||
|
|
||||||
novels.push(novel);
|
novels.push(novel);
|
||||||
});
|
});
|
||||||
@@ -3,28 +3,19 @@ import { Filters } from '@libs/filterInputs';
|
|||||||
import { Plugin } from '@typings/plugin';
|
import { Plugin } from '@typings/plugin';
|
||||||
import { load as parseHTML } from 'cheerio';
|
import { load as parseHTML } from 'cheerio';
|
||||||
|
|
||||||
export const id = 'yuukitls.com';
|
|
||||||
export const name = 'Yuuki Tls';
|
|
||||||
export const site = 'https://yuukitls.com/';
|
|
||||||
export const version = '1.0.0';
|
|
||||||
export const icon = 'src/es/yuukitls/icon.png';
|
|
||||||
|
|
||||||
const baseUrl = site;
|
|
||||||
|
|
||||||
class Yuuki implements Plugin.PluginBase {
|
class Yuuki implements Plugin.PluginBase {
|
||||||
id = 'yuukitls.com';
|
id = 'yuukitls';
|
||||||
name = 'Yuuki Tls';
|
name = 'Yuuki Tls';
|
||||||
icon = 'src/es/yuukitls/icon.png';
|
icon = 'src/es/yuukitls/icon.png';
|
||||||
site = 'https://yuukitls.com/';
|
site = 'https://yuukitls.com/';
|
||||||
filters?: Filters | undefined;
|
filters?: Filters | undefined;
|
||||||
version = '1.0.0';
|
version = '1.0.0';
|
||||||
baseUrl = this.site;
|
|
||||||
|
|
||||||
async popularNovels(
|
async popularNovels(
|
||||||
pageNo: number,
|
pageNo: number,
|
||||||
options: Plugin.PopularNovelsOptions<Filters>,
|
options: Plugin.PopularNovelsOptions<Filters>,
|
||||||
): Promise<Plugin.NovelItem[]> {
|
): Promise<Plugin.NovelItem[]> {
|
||||||
let url = baseUrl;
|
let url = this.site;
|
||||||
|
|
||||||
const result = await fetchApi(url);
|
const result = await fetchApi(url);
|
||||||
const body = await result.text();
|
const body = await result.text();
|
||||||
@@ -35,18 +26,18 @@ class Yuuki implements Plugin.PluginBase {
|
|||||||
|
|
||||||
loadedCheerio('.quadmenu-navbar-collapse ul li:nth-child(2)')
|
loadedCheerio('.quadmenu-navbar-collapse ul li:nth-child(2)')
|
||||||
.find('li')
|
.find('li')
|
||||||
.each(function () {
|
.each((idx, ele) => {
|
||||||
const novelName = loadedCheerio(this)
|
const novelName = loadedCheerio(ele)
|
||||||
.text()
|
.text()
|
||||||
.replace(/[\s\n]+/g, ' ');
|
.replace(/[\s\n]+/g, ' ');
|
||||||
const novelCover = loadedCheerio(this).find('img').attr('src');
|
const novelCover = loadedCheerio(ele).find('img').attr('src');
|
||||||
|
|
||||||
let novelUrl = loadedCheerio(this).find('a').attr('href');
|
let novelUrl = loadedCheerio(ele).find('a').attr('href');
|
||||||
if (!novelUrl) return;
|
if (!novelUrl) return;
|
||||||
const novel = {
|
const novel = {
|
||||||
name: novelName,
|
name: novelName,
|
||||||
cover: novelCover,
|
cover: novelCover,
|
||||||
url: novelUrl,
|
path: novelUrl.replace(this.site, ''),
|
||||||
};
|
};
|
||||||
|
|
||||||
novels.push(novel);
|
novels.push(novel);
|
||||||
@@ -54,8 +45,8 @@ class Yuuki implements Plugin.PluginBase {
|
|||||||
|
|
||||||
return novels;
|
return novels;
|
||||||
}
|
}
|
||||||
async parseNovelAndChapters(novelUrl: string): Promise<Plugin.SourceNovel> {
|
async parseNovel(novelPath: string): Promise<Plugin.SourceNovel> {
|
||||||
const url = novelUrl;
|
const url = this.site + novelPath;
|
||||||
|
|
||||||
const result = await fetchApi(url);
|
const result = await fetchApi(url);
|
||||||
const body = await result.text();
|
const body = await result.text();
|
||||||
@@ -63,13 +54,12 @@ class Yuuki implements Plugin.PluginBase {
|
|||||||
let loadedCheerio = parseHTML(body);
|
let loadedCheerio = parseHTML(body);
|
||||||
|
|
||||||
let novel: Plugin.SourceNovel = {
|
let novel: Plugin.SourceNovel = {
|
||||||
url,
|
path: novelPath,
|
||||||
};
|
name: loadedCheerio('h1.entry-title')
|
||||||
|
|
||||||
novel.name = loadedCheerio('h1.entry-title')
|
|
||||||
.text()
|
.text()
|
||||||
.replace(/[\t\n]/g, '')
|
.replace(/[\t\n]/g, '')
|
||||||
.trim();
|
.trim(),
|
||||||
|
};
|
||||||
|
|
||||||
novel.cover = loadedCheerio('img[loading="lazy"]').attr('src');
|
novel.cover = loadedCheerio('img[loading="lazy"]').attr('src');
|
||||||
|
|
||||||
@@ -98,17 +88,17 @@ class Yuuki implements Plugin.PluginBase {
|
|||||||
if (loadedCheerio('.entry-content').find('li').length) {
|
if (loadedCheerio('.entry-content').find('li').length) {
|
||||||
loadedCheerio('.entry-content')
|
loadedCheerio('.entry-content')
|
||||||
.find('li')
|
.find('li')
|
||||||
.each(function () {
|
.each((idx, ele) => {
|
||||||
let chapterUrl = loadedCheerio(this).find('a').attr('href');
|
let chapterUrl = loadedCheerio(ele).find('a').attr('href');
|
||||||
|
|
||||||
if (chapterUrl && chapterUrl.includes(baseUrl)) {
|
if (chapterUrl && chapterUrl.includes(this.site)) {
|
||||||
const chapterName = loadedCheerio(this).text();
|
const chapterName = loadedCheerio(ele).text();
|
||||||
const releaseDate = null;
|
const releaseDate = null;
|
||||||
|
|
||||||
const chapter = {
|
const chapter = {
|
||||||
name: chapterName,
|
name: chapterName,
|
||||||
releaseTime: releaseDate,
|
releaseTime: releaseDate,
|
||||||
url: chapterUrl,
|
path: chapterUrl.replace(this.site, ''),
|
||||||
};
|
};
|
||||||
|
|
||||||
novelChapters.push(chapter);
|
novelChapters.push(chapter);
|
||||||
@@ -117,17 +107,17 @@ class Yuuki implements Plugin.PluginBase {
|
|||||||
} else {
|
} else {
|
||||||
loadedCheerio('.entry-content')
|
loadedCheerio('.entry-content')
|
||||||
.find('p')
|
.find('p')
|
||||||
.each(function () {
|
.each((idx, ele) => {
|
||||||
let chapterUrl = loadedCheerio(this).find('a').attr('href');
|
let chapterUrl = loadedCheerio(ele).find('a').attr('href');
|
||||||
|
|
||||||
if (chapterUrl && chapterUrl.includes(baseUrl)) {
|
if (chapterUrl && chapterUrl.includes(this.site)) {
|
||||||
const chapterName = loadedCheerio(this).text();
|
const chapterName = loadedCheerio(ele).text();
|
||||||
const releaseDate = null;
|
const releaseDate = null;
|
||||||
|
|
||||||
const chapter = {
|
const chapter = {
|
||||||
name: chapterName,
|
name: chapterName,
|
||||||
releaseTime: releaseDate,
|
releaseTime: releaseDate,
|
||||||
url: chapterUrl,
|
path: chapterUrl.replace(this.site, ''),
|
||||||
};
|
};
|
||||||
|
|
||||||
novelChapters.push(chapter);
|
novelChapters.push(chapter);
|
||||||
@@ -139,8 +129,8 @@ class Yuuki implements Plugin.PluginBase {
|
|||||||
|
|
||||||
return novel;
|
return novel;
|
||||||
}
|
}
|
||||||
async parseChapter(chapterUrl: string): Promise<string> {
|
async parseChapter(chapterPath: string): Promise<string> {
|
||||||
const url = chapterUrl;
|
const url = this.site + chapterPath;
|
||||||
|
|
||||||
const result = await fetchApi(url);
|
const result = await fetchApi(url);
|
||||||
const body = await result.text();
|
const body = await result.text();
|
||||||
@@ -156,7 +146,7 @@ class Yuuki implements Plugin.PluginBase {
|
|||||||
): Promise<Plugin.NovelItem[]> {
|
): Promise<Plugin.NovelItem[]> {
|
||||||
searchTerm = searchTerm.toLowerCase();
|
searchTerm = searchTerm.toLowerCase();
|
||||||
|
|
||||||
let url = baseUrl;
|
let url = this.site;
|
||||||
|
|
||||||
const result = await fetchApi(url);
|
const result = await fetchApi(url);
|
||||||
const body = await result.text();
|
const body = await result.text();
|
||||||
@@ -167,17 +157,17 @@ class Yuuki implements Plugin.PluginBase {
|
|||||||
|
|
||||||
loadedCheerio('.menu-item-2869')
|
loadedCheerio('.menu-item-2869')
|
||||||
.find('.menu-item.menu-item-type-post_type.menu-item-object-post')
|
.find('.menu-item.menu-item-type-post_type.menu-item-object-post')
|
||||||
.each(function () {
|
.each((idx, ele) => {
|
||||||
const novelName = loadedCheerio(this).text();
|
const novelName = loadedCheerio(ele).text();
|
||||||
const novelCover = loadedCheerio(this).find('img').attr('src');
|
const novelCover = loadedCheerio(ele).find('img').attr('src');
|
||||||
|
|
||||||
let novelUrl = loadedCheerio(this).find('a').attr('href');
|
let novelUrl = loadedCheerio(ele).find('a').attr('href');
|
||||||
if (!novelUrl) return;
|
if (!novelUrl) return;
|
||||||
|
|
||||||
const novel = {
|
const novel = {
|
||||||
name: novelName,
|
name: novelName,
|
||||||
cover: novelCover,
|
cover: novelCover,
|
||||||
url: novelUrl,
|
path: novelUrl.replace(this.site, ''),
|
||||||
};
|
};
|
||||||
|
|
||||||
novels.push(novel);
|
novels.push(novel);
|
||||||
@@ -57,7 +57,7 @@ used.add(path.join(root, '..', 'icons', 'coverNotAvailable.webp'));
|
|||||||
|
|
||||||
if (!skip[id] && icon && site) {
|
if (!skip[id] && icon && site) {
|
||||||
const image = await fetch(
|
const image = await fetch(
|
||||||
`https://www.google.com/s2/favicons?domain=${site}&sz=${size}`,
|
`https://www.google.com/s2/favicons?domain=${site}&sz=${size}&type=png`,
|
||||||
)
|
)
|
||||||
.then(res => res.arrayBuffer())
|
.then(res => res.arrayBuffer())
|
||||||
.then(res => Buffer.from(res));
|
.then(res => Buffer.from(res));
|
||||||
|
|||||||