v2.6.3 - Added genres to categories

pull/1/head v2.6.3
Jéluchu 5 years ago
parent fa6bd4bcb9
commit bd7b22ddc8

@ -1,4 +1,4 @@
# **Aruppi API** (v2.6.2) # **Aruppi API** (v2.6.3)
> This API has everything about Japan, from anime, music, radio, images, videos ... to japanese culture > This API has everything about Japan, from anime, music, radio, images, videos ... to japanese culture
> >

@ -1,6 +1,6 @@
{ {
"name": "aruppi", "name": "aruppi",
"version": "2.6.2", "version": "2.6.3",
"description": "Aruppi is a custom API to obtain data from the Japanese culture for the mobile app", "description": "Aruppi is a custom API to obtain data from the Japanese culture for the mobile app",
"main": "./src/api/api.js", "main": "./src/api/api.js",
"scripts": { "scripts": {

@ -6,6 +6,7 @@ const {
const { const {
jkanimeInfo, jkanimeInfo,
animeflvGenres,
animeflvInfo, animeflvInfo,
imageUrlToBase64, imageUrlToBase64,
getAnimeCharacters, getAnimeCharacters,
@ -527,14 +528,15 @@ const getAnimeGenres = async(genre, order, page) => {
const synopsis = $element.find('div.Description p').eq(1).text().trim(); const synopsis = $element.find('div.Description p').eq(1).text().trim();
const rating = $element.find('div.Description p span.Vts').text(); const rating = $element.find('div.Description p span.Vts').text();
promises.push(helper().then(async () => ({ promises.push(animeflvGenres(id).then(async genres => ({
id: id || null, id: id || null,
title: title || null, title: title || null,
poster: await imageUrlToBase64(poster) || null, poster: await imageUrlToBase64(poster) || null,
banner: banner || null, banner: banner || null,
synopsis: synopsis || null, synopsis: synopsis || null,
type: type || null, type: type || null,
rating: rating || null rating: rating || null,
genres: genres || null
}))) })))
}) })

@ -7,7 +7,7 @@ router.get('/', (req, res) => {
res.json({ res.json({
message: 'Aruppi API - 🎏', message: 'Aruppi API - 🎏',
author: 'Jéluchu', author: 'Jéluchu',
version: '2.6.2', version: '2.6.3',
credits: 'The bitch loves APIs that offers data to Aruppi App', credits: 'The bitch loves APIs that offers data to Aruppi App',
entries: [ entries: [
{ {

@ -95,7 +95,6 @@ async function getVideoURL(url) {
} }
} }
const jkanimeInfo = async (id) => { const jkanimeInfo = async (id) => {
let poster = "" let poster = ""
@ -184,6 +183,23 @@ const jkanimeInfo = async (id) => {
}; };
const animeflvGenres = async (id) => {
const promises = [];
let options = { scrapy: true }
let $ = await homgot(`${BASE_ANIMEFLV}${id}`, options);
$('main.Main section.WdgtCn nav.Nvgnrs a').each((index, element) => {
const $element = $(element);
const genre = $element.attr('href').split('=')[1] || null;
promises.push(genre);
});
return promises;
}
const animeflvInfo = async (id, index) => { const animeflvInfo = async (id, index) => {
let poster = "" let poster = ""
@ -649,6 +665,7 @@ const getDirectory = async () => {
module.exports = { module.exports = {
jkanimeInfo, jkanimeInfo,
animeflvGenres,
animeflvInfo, animeflvInfo,
getAnimeCharacters, getAnimeCharacters,
getAnimeVideoPromo, getAnimeVideoPromo,

Loading…
Cancel
Save