Skip to content

Commit

Permalink
fix(source): SakuraNovel (#560)
Browse files Browse the repository at this point in the history
  • Loading branch information
K1ngfish3r authored Feb 22, 2023
1 parent 84a2561 commit b40e933
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
19 changes: 15 additions & 4 deletions src/sources/id/sakuranovel.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const popularNovels = async page => {
.find('.flexbox2-title span')
.first()
.text();
const novelCover = loadedCheerio(this).find('img').attr('data-src');
const novelCover = loadedCheerio(this).find('img').attr('src');
const novelUrl = loadedCheerio(this)
.find('.flexbox2-content > a')
.attr('href');
Expand All @@ -48,7 +48,18 @@ const parseNovelAndChapters = async novelUrl => {

novel.novelName = loadedCheerio('.series-title h2').text().trim();

novel.novelCover = loadedCheerio('.series-thumb img').attr('data-src');
novel.novelCover = loadedCheerio('.series-thumb img').attr('src');

novel.author = loadedCheerio(
'.series-infolist > li:nth-child(3) > span:nth-child(2)',
).text();

novel.status = loadedCheerio('.status').text().trim();

novel.genre = loadedCheerio('.series-genres')
.prop('innerHTML')
.replace(/<.*?>(.*?)<.*?>/g, '$1,')
.slice(0, -1);

novel.summary = loadedCheerio('.series-synops').text().trim();

Expand Down Expand Up @@ -85,7 +96,7 @@ const parseChapter = async (novelUrl, chapterUrl) => {
let loadedCheerio = cheerio.load(body);

const chapterName = loadedCheerio('.title-chapter').text();
const chapterText = loadedCheerio('.reader-area').html();
const chapterText = loadedCheerio('.reader').html();

const chapter = {
sourceId,
Expand All @@ -112,7 +123,7 @@ const searchNovels = async searchTerm => {
.find('.flexbox2-title span')
.first()
.text();
const novelCover = loadedCheerio(this).find('img').attr('data-src');
const novelCover = loadedCheerio(this).find('img').attr('src');
const novelUrl = loadedCheerio(this)
.find('.flexbox2-content > a')
.attr('href');
Expand Down
6 changes: 3 additions & 3 deletions src/sources/multisrc/wpmangastream/WPMangaStreamScraper.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ class WPMangaStreamScraper {
novel.genre = loadedCheerio('.genxed').text().trim().replace(/\s/g, ',');

novel.summary = loadedCheerio('.entry-content')
.find('h3')
.find('h3 , p.a')
.remove()
.end()
.prop('innerHTML')
.replace(/(<.*?>)/g, '\n')
.replace(/(&.*;)/g, '');
.replace(/(<.*?>)/g, ' ')
.replace(/(&.*;)/g, '\n');

let novelChapters = [];

Expand Down

0 comments on commit b40e933

Please sign in to comment.