Fixes images of news

v2
Jéluchu 5 years ago
parent 0c71bfda9a
commit f01535e187

@ -1,4 +1,4 @@
# **Aruppi API** (v2.6.5) # **Aruppi API** (v2.6.6)
> 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.5", "version": "2.6.6",
"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": {

@ -535,7 +535,9 @@ const obtainPreviewNews = (encoded) => {
let image; let image;
if (encoded.includes('<img title=')) { if (encoded.includes('src="https://img1.ak.crunchyroll.com/')) {
image = `https://img1.ak.crunchyroll.com/${encoded.split('https://img1.ak.crunchyroll.com/')[1].split('.jpg')[0]}.jpg`
} else if (encoded.includes('<img title=')) {
image = encoded.substring(encoded.indexOf("<img title=\""), encoded.indexOf("\" alt")).split('src=\"')[1] image = encoded.substring(encoded.indexOf("<img title=\""), encoded.indexOf("\" alt")).split('src=\"')[1]
} else if (encoded.includes('<img src=')) { } else if (encoded.includes('<img src=')) {
image = encoded image = encoded

Loading…
Cancel
Save