v2.6.7 - Improve RandomThemes

v2 v2.6.7
Jéluchu 5 years ago
parent f01535e187
commit d7e2609b56

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

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

@ -19,14 +19,15 @@ const {
getAnimes,
getDirectory,
helper,
videoServersJK
videoServersJK,
getThemes
} = require('../utils/index');
const ThemeParser = require('../utils/animetheme');
const parserThemes = new ThemeParser()
const {
BASE_ANIMEFLV_JELU, BASE_JIKAN, BASE_IVOOX, BASE_QWANT, BASE_YOUTUBE, GENRES_URL
BASE_ANIMEFLV_JELU, BASE_JIKAN, BASE_IVOOX, BASE_QWANT, BASE_YOUTUBE, GENRES_URL, BASE_THEMEMOE
} = require('./urls');
const schedule = async (day) =>{
@ -507,13 +508,14 @@ const getThemesYear = async (year) => {
const getRandomTheme = async () => {
let promise = []
let data = await parserThemes.random()
let random = Math.round(Math.random()*(data.themes.length - 1));
let options = { parse: true }
const data = await homgot(`${BASE_THEMEMOE}roulette`, options);
let themes = await getThemes(data.themes)
promise.push({
name: data.title,
title: data.themes[random].name.split('"')[1] || null,
link: data.themes[random].link
name: data.name,
title: themes[0].name,
link: themes[0].video
})
return promise;

@ -16,5 +16,6 @@ module.exports = {
SEARCH_DIRECTORY: 'https://animeflv.net/browse?order=title&page=',
BASE_EPISODE_IMG_URL: 'https://cdn.animeflv.net/screenshots/',
BASE_QWANT: 'https://api.qwant.com/search/images?',
REDDIT_ANIMETHEMES: 'https://reddit.com/r/AnimeThemes/wiki/'
REDDIT_ANIMETHEMES: 'https://reddit.com/r/AnimeThemes/wiki/',
BASE_THEMEMOE: 'https://themes.moe/api/'
};

Loading…
Cancel
Save