|
|
@ -7,6 +7,16 @@ const {
|
|
|
|
} = require('../api/urls');
|
|
|
|
} = require('../api/urls');
|
|
|
|
|
|
|
|
|
|
|
|
const animeflvInfo = async (id, index) => {
|
|
|
|
const animeflvInfo = async (id, index) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let poster = ""
|
|
|
|
|
|
|
|
let banner = ""
|
|
|
|
|
|
|
|
let synopsis = ""
|
|
|
|
|
|
|
|
let rating = ""
|
|
|
|
|
|
|
|
let debut = ""
|
|
|
|
|
|
|
|
let type = ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
do {
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
|
|
const res = await cloudscraper(`${BASE_ANIMEFLV}anime/${id}`);
|
|
|
|
const res = await cloudscraper(`${BASE_ANIMEFLV}anime/${id}`);
|
|
|
@ -19,13 +29,12 @@ const animeflvInfo = async (id, index) =>{
|
|
|
|
const genres = [];
|
|
|
|
const genres = [];
|
|
|
|
let listByEps;
|
|
|
|
let listByEps;
|
|
|
|
|
|
|
|
|
|
|
|
let poster = `${BASE_ANIMEFLV}` + $('body div div div div div aside div.AnimeCover div.Image figure img').attr('src')
|
|
|
|
poster = `${BASE_ANIMEFLV}` + $('body div div div div div aside div.AnimeCover div.Image figure img').attr('src')
|
|
|
|
const banner = poster.replace('covers' , 'banners').trim();
|
|
|
|
banner = poster.replace('covers', 'banners').trim();
|
|
|
|
let synopsis = $('body div div div div div main section div.Description p').text().trim();
|
|
|
|
synopsis = $('body div div div div div main section div.Description p').text().trim();
|
|
|
|
let rating = $('body div div div.Ficha.fchlt div.Container div.vtshr div.Votes span#votes_prmd').text();
|
|
|
|
rating = $('body div div div.Ficha.fchlt div.Container div.vtshr div.Votes span#votes_prmd').text();
|
|
|
|
const debut = $('body div.Wrapper div.Body div div.Container div.BX.Row.BFluid.Sp20 aside.SidebarA.BFixed p.AnmStts').text();
|
|
|
|
debut = $('body div.Wrapper div.Body div div.Container div.BX.Row.BFluid.Sp20 aside.SidebarA.BFixed p.AnmStts').text();
|
|
|
|
const type = $('body div.Wrapper div.Body div div.Ficha.fchlt div.Container span.Type').text()
|
|
|
|
type = $('body div.Wrapper div.Body div div.Ficha.fchlt div.Container span.Type').text()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
animeExtraInfo.push({
|
|
|
|
animeExtraInfo.push({
|
|
|
|
poster: poster,
|
|
|
|
poster: poster,
|
|
|
@ -59,7 +68,15 @@ const animeflvInfo = async (id, index) =>{
|
|
|
|
});
|
|
|
|
});
|
|
|
|
const AnimeThumbnailsId = index;
|
|
|
|
const AnimeThumbnailsId = index;
|
|
|
|
const animeId = id;
|
|
|
|
const animeId = id;
|
|
|
|
let nextEpisodeDate = anime_info_ids[0][3] || null;
|
|
|
|
let nextEpisodeDate
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (anime_info_ids.length > 0) {
|
|
|
|
|
|
|
|
if (anime_info_ids[0].length === 4) {
|
|
|
|
|
|
|
|
nextEpisodeDate = anime_info_ids[0][3]
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
nextEpisodeDate = null
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const amimeTempList = [];
|
|
|
|
const amimeTempList = [];
|
|
|
|
for (const [key, value] of Object.entries(anime_eps_data)) {
|
|
|
|
for (const [key, value] of Object.entries(anime_eps_data)) {
|
|
|
@ -85,10 +102,14 @@ const animeflvInfo = async (id, index) =>{
|
|
|
|
listByEps = animeListEps;
|
|
|
|
listByEps = animeListEps;
|
|
|
|
|
|
|
|
|
|
|
|
return {listByEps, genres, animeExtraInfo};
|
|
|
|
return {listByEps, genres, animeExtraInfo};
|
|
|
|
|
|
|
|
|
|
|
|
} catch (err) {
|
|
|
|
} catch (err) {
|
|
|
|
console.error(err)
|
|
|
|
console.error(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} while (poster === "" && banner === "" && synopsis === "" && rating === "" && debut === "" && type === "")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const getAnimeCharacters = async (title) => {
|
|
|
|
const getAnimeCharacters = async (title) => {
|
|
|
@ -240,7 +261,8 @@ const imageUrlToBase64 = async(url) => {
|
|
|
|
return await base64.encode(url, {string: true});
|
|
|
|
return await base64.encode(url, {string: true});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const search = async() =>{ }
|
|
|
|
const search = async () => {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const searchAnime = async (query) => {
|
|
|
|
const searchAnime = async (query) => {
|
|
|
|
|
|
|
|
|
|
|
@ -317,7 +339,6 @@ const obtainPreviewNews = (encoded) => {
|
|
|
|
.substring(encoded.indexOf("<img src=\""), encoded.indexOf("\" alt"))
|
|
|
|
.substring(encoded.indexOf("<img src=\""), encoded.indexOf("\" alt"))
|
|
|
|
.substring(10).replace("http", "https")
|
|
|
|
.substring(10).replace("http", "https")
|
|
|
|
.replace("httpss", "https")
|
|
|
|
.replace("httpss", "https")
|
|
|
|
|
|
|
|
|
|
|
|
} else if (encoded.includes('<img')) {
|
|
|
|
} else if (encoded.includes('<img')) {
|
|
|
|
image = encoded.split("src=")[1].split(" class=")[0].replace("\"", '').replace('\"','')
|
|
|
|
image = encoded.split("src=")[1].split(" class=")[0].replace("\"", '').replace('\"','')
|
|
|
|
} else if (encoded.includes('https://www.youtube.com/embed/')) {
|
|
|
|
} else if (encoded.includes('https://www.youtube.com/embed/')) {
|
|
|
|