fix(source): Madara

This commit is contained in:
Rajarshee Chatterjee
2021-10-09 17:38:52 +05:30
parent d2e2314a3e
commit 9447d10c79
5 changed files with 22 additions and 22 deletions
+5 -6
View File
@@ -87,15 +87,14 @@ const parseNovelAndChapters = async novelUrl => {
let novelChapters = [];
const novelId = $('#manga-chapters-holder').attr('data-id');
// const novelId = $('#manga-chapters-holder').attr('data-id');
let formData = new FormData();
formData.append('action', 'manga_get_chapters');
formData.append('manga', novelId);
// let formData = new FormData();
// formData.append('action', 'manga_get_chapters');
// formData.append('manga', novelId);
const data = await fetch('https://www.arnovel.me/wp-admin/admin-ajax.php', {
const data = await fetch(`${url}ajax/chapters/`, {
method: 'POST',
body: formData,
});
const text = await data.text();
+7 -2
View File
@@ -42,7 +42,7 @@ const parseNovelAndChapters = async novelUrl => {
const result = await fetch(url);
const body = await result.text();
const $ = cheerio.load(body);
let $ = cheerio.load(body);
let novel = {};
@@ -96,7 +96,12 @@ const parseNovelAndChapters = async novelUrl => {
let novelChapters = [];
$('.wp-manga-chapter').each(function (result) {
const data = await fetch(`${url}ajax/chapters/`, {method: 'POST'});
const text = await data.text();
$ = cheerio.load(text);
$('.wp-manga-chapter').each(function () {
const chapterName = $(this)
.find('a')
.text()
+7 -11
View File
@@ -91,19 +91,15 @@ const parseNovelAndChapters = async novelUrl => {
let novelChapters = [];
const novelId = $('#manga-chapters-holder').attr('data-id');
// const novelId = $('#manga-chapters-holder').attr('data-id');
let formData = new FormData();
formData.append('action', 'manga_get_chapters');
formData.append('manga', novelId);
// let formData = new FormData();
// formData.append('action', 'manga_get_chapters');
// formData.append('manga', novelId);
const data = await fetch(
'https://www.foxaholic.com/wp-admin/admin-ajax.php',
{
method: 'POST',
body: formData,
},
);
const data = await fetch(`${url}ajax/chapters/`, {
method: 'POST',
});
const text = await data.text();
$ = cheerio.load(text);
+2 -2
View File
@@ -14,10 +14,10 @@ const popularNovels = async page => {
let novels = [];
$('.page-item-detail').each(function (result) {
const novelName = $(this).find('h5 > a').text();
const novelName = $(this).find('.h5 > a').text();
const novelCover = $(this).find('img').attr('src');
let novelUrl = $(this).find('h5 > a').attr('href');
let novelUrl = $(this).find('.h5 > a').attr('href');
novelUrl = novelUrl.replace(`${baseUrl}vipnovel/`, '');
const novel = {
+1 -1
View File
@@ -82,7 +82,7 @@ const parseNovelAndChapters = async novelUrl => {
let novelChapters = [];
console.log(`${url}ajax/chapters/`);
// console.log(`${url}ajax/chapters/`);
const data = await fetch(`${url}ajax/chapters/`, {method: 'POST'});
const text = await data.text();