Skip to content

Commit

Permalink
fix: Cleanup Sources (#545)
Browse files Browse the repository at this point in the history
* removed Asada Translation (dead)

* update boxnovel.online to cratenovel

* fixed Daonovel

* updated fastnovel.net to fastnovel.org

* removed JPMTL (dead)

* removed Kisslightnovels (dead)

* removed Asada Translation (dead)

* update boxnovel.online to cratenovel

* fixed Daonovel

* updated fastnovel.net to fastnovel.org

* removed JPMTL (dead)

* removed Kisslightnovels (dead)

* update latestnovel to lightnovelfull (Doesn't work since there are multiple pages and can't find source API)

* fixed LightNovelReader search and metadata

* added ts-ignore to sourceManager

* removed LightNovelsHub (dead)

* fixed lnmtl metadata

* update mtnovel to novelfull.net

* fixed MTL-Novel

* removed MTL-Corner (dead)

* fixed mylovenovel

* removed NovelCake (dead)

* removed NovelOwl (is lightnovelfull.com)

* removed NovelPassion (dead)

* removed NovelsCafe (dead)

* removed NovelsRock (dead)

* removed noveltrench (dead)

* fixed novelupdatescc partly (can't open Novel)

* fixed OnlyMTL

* tried fix still broken but lists some novels

* removed SkyNovel (dead)

* changed scraping page of wuxiacity

* removed wuxiaworldcloud (dead)

* fixed wuxiaworld.site

* removed wuxiaworldsite (broken website)

* removed Asada Translation (dead)

* update boxnovel.online to cratenovel

* fixed Daonovel

* updated fastnovel.net to fastnovel.org

* removed JPMTL (dead)

* removed Kisslightnovels (dead)

* update latestnovel to lightnovelfull (Doesn't work since there are multiple pages and can't find source API)

* fixed LightNovelReader search and metadata

* added ts-ignore to sourceManager

* removed LightNovelsHub (dead)

* fixed lnmtl metadata

* update mtnovel to novelfull.net

* fixed MTL-Novel

* removed MTL-Corner (dead)

* fixed mylovenovel

* removed NovelCake (dead)

* removed NovelOwl (is lightnovelfull.com)

* removed NovelPassion (dead)

* removed NovelsCafe (dead)

* removed NovelsRock (dead)

* removed noveltrench (dead)

* fixed novelupdatescc partly (can't open Novel)

* fixed OnlyMTL

* tried fix still broken but lists some novels

* removed SkyNovel (dead)

* changed scraping page of wuxiacity

* removed wuxiaworldcloud (dead)

* fixed wuxiaworld.site

* removed wuxiaworldsite (broken website)

* fixed errors

* removed readfreenovel (without js list only kidsbooks and crashes the app)

* small change
  • Loading branch information
CD-Z authored Feb 17, 2023
1 parent cc9022c commit f238b20
Show file tree
Hide file tree
Showing 23 changed files with 675 additions and 2,299 deletions.
26 changes: 16 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 27 additions & 33 deletions src/sources/en/LightNovelReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ const parseNovelAndChapters = async (novelUrl: string) => {
: undefined;

novel.summary = loadedCheerio(
'body > section:nth-child(4) > div > div > div.col-12.col-xl-9 > div > div:nth-child(5)',
'div.container > div > div.col-12.col-xl-9 > div > div:nth-child(5) > div',
)
.text()
.trim();

novel.author = loadedCheerio(
'body > section:nth-child(4) > div > div > div.col-12.col-xl-9 > div > div:nth-child(2) > div > div.novels-detail-right > ul > li:nth-child(6) > div.novels-detail-right-in-right',
'div.novels-detail-right > ul > li:nth-child(6) > .novels-detail-right-in-right > a',
)
.text()
.trim();
Expand All @@ -104,7 +104,7 @@ const parseNovelAndChapters = async (novelUrl: string) => {
.replace(/[\t\n ]+/g, ',');

novel.status = loadedCheerio(
'body > section:nth-child(4) > div > div > div.col-12.col-xl-9 > div > div:nth-child(2) > div > div.novels-detail-right > ul > li:nth-child(2) > div.novels-detail-right-in-right',
'div.novels-detail-right > ul > li:nth-child(2) > .novels-detail-right-in-right',
)
.text()
.trim();
Expand Down Expand Up @@ -155,41 +155,35 @@ const parseChapter = async (novelUrl: string, chapterUrl: string) => {
return chapter;
};

const searchNovels = async (searchTerm: string) => {
const url = `${baseUrl}/detailed-search-lnr`;

const formData = new FormData();
formData.append('keyword', searchTerm);
interface searchData {
overview: string;
original_title: string;
link: string;
image: string;
}

const result = await fetch(url, { method: 'POST', body: formData });
const body = await result.text();
const searchNovels = async (searchTerm: string) => {
const url = `${baseUrl}/search/autocomplete?dataType=json&query=${searchTerm}`;

const loadedCheerio = cheerio.load(body);
const result = await fetch(url, { method: 'POST' });
const body = await result.json();
const data: searchData[] = body.results;

const novels: SourceNovelItem[] = [];

loadedCheerio('.category-items.cm-list li').each(function () {
let novelUrl = loadedCheerio(this).find('.category-name > a').attr('href');

if (novelUrl && !isUrlAbsolute(novelUrl)) {
novelUrl = baseUrl + novelUrl;
}

if (novelUrl) {
const novelName = loadedCheerio(this).find('.category-name').text();
let novelCover = loadedCheerio(this).find('img').attr('src');

if (novelCover && !isUrlAbsolute(novelCover)) {
novelCover = baseUrl + novelCover;
}

novels.push({
sourceId,
novelUrl,
novelName,
novelCover,
});
}
data.forEach(item => {
let novelUrl = item.link;
let novelName = item.original_title
.replace(/“|”/g, '"')
.replace(/&#[0-9]*;/g, ' ');
let novelCover = item.image;

novels.push({
sourceId,
novelUrl,
novelName,
novelCover,
});
});

return novels;
Expand Down
195 changes: 0 additions & 195 deletions src/sources/en/NovelsCafe.ts

This file was deleted.

Loading

0 comments on commit f238b20

Please sign in to comment.