From a2f1a08d0d75c841d5d995e5e0225d8b3a8218de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9luchu?= Date: Wed, 7 Apr 2021 18:30:47 +0200 Subject: [PATCH 1/4] Update cover image --- assets/img/{logo.png => cover.png} | Bin 1 file changed, 0 insertions(+), 0 deletions(-) rename assets/img/{logo.png => cover.png} (100%) diff --git a/assets/img/logo.png b/assets/img/cover.png similarity index 100% rename from assets/img/logo.png rename to assets/img/cover.png From 133e800b75b4f197a5eaaffa63bb9c29276cfe16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Mar=C3=ADa?= Date: Wed, 7 Apr 2021 18:31:21 +0200 Subject: [PATCH 2/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b33de99..37a746a 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ # - +     From d8cc3626f28b83c12ea105315960481f1ae90b0c Mon Sep 17 00:00:00 2001 From: capitanwesler Date: Sun, 11 Apr 2021 16:31:41 +0100 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=A4=96=20Deleting=20palomitron=20from?= =?UTF-8?q?=20urls=20from=20the=20news?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/UtilsController.ts | 5 ----- src/utils/urls.ts | 1 - 2 files changed, 6 deletions(-) diff --git a/src/controllers/UtilsController.ts b/src/controllers/UtilsController.ts index fcea77d..c7d3808 100644 --- a/src/controllers/UtilsController.ts +++ b/src/controllers/UtilsController.ts @@ -140,11 +140,6 @@ export default class UtilsController { const news: News[] = []; const pagesRss: rssPage[] = [ { url: urls.BASE_KUDASAI, author: 'Kudasai', content: 'content_encoded' }, - { - url: urls.BASE_PALOMITRON, - author: 'Palomitron', - content: 'description', - }, { url: urls.BASE_RAMENPARADOS, author: 'Ramen para dos', diff --git a/src/utils/urls.ts b/src/utils/urls.ts index 2322d22..99c6bcc 100644 --- a/src/utils/urls.ts +++ b/src/utils/urls.ts @@ -9,7 +9,6 @@ export default { BASE_IVOOX: 'https://www.ivoox.com/podcast-anitakume_fg_f1660716_filtro_1.xml', BASE_KUDASAI: 'https://somoskudasai.com/feed/', - BASE_PALOMITRON: 'https://elpalomitron.com/category/animemanga/feed/', BASE_RAMENPARADOS: 'https://ramenparados.com/category/noticias/anime/feed/', BASE_CRUNCHYROLL: 'https://www.crunchyroll.com/newsrss?lang=esES', JKANIME_SEARCH: 'https://jkanime.net/buscar/', From cda086a5835c34ec71d65925eedae98042e265a1 Mon Sep 17 00:00:00 2001 From: capitanwesler Date: Sun, 11 Apr 2021 17:57:02 +0100 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=92=80=20Adding=20monoschinos=20laste?= =?UTF-8?q?st=20episodes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/AnimeController.ts | 84 ++++++++++++++++++++++++------ src/utils/requestCall.ts | 2 +- src/utils/util.ts | 6 ++- 3 files changed, 73 insertions(+), 19 deletions(-) diff --git a/src/controllers/AnimeController.ts b/src/controllers/AnimeController.ts index 20657b5..243ac15 100644 --- a/src/controllers/AnimeController.ts +++ b/src/controllers/AnimeController.ts @@ -2,6 +2,7 @@ import { NextFunction, Request, Response } from 'express'; import { requestGot } from '../utils/requestCall'; import { animeFlvInfo, + imageUrlToBase64, jkanimeInfo, monoschinosInfo, videoServersJK, @@ -241,8 +242,10 @@ export default class AnimeController { } async getLastEpisodes(req: Request, res: Response, next: NextFunction) { - let data: any; + // let data: any; + let $: cheerio.Root; let episodes: Episode[] = []; + let animeList: any[] = []; try { const resultQueryRedis: any = await redisClient.get( @@ -254,28 +257,75 @@ export default class AnimeController { return res.status(200).json(resultRedis); } else { - data = await requestGot( - `${urls.BASE_ANIMEFLV_JELU}LatestEpisodesAdded`, - { - parse: true, - scrapy: false, - }, - ); + // @ANIMEFLV + // data = await requestGot( + // `${urls.BASE_ANIMEFLV_JELU}LatestEpisodesAdded`, + // { + // parse: true, + // scrapy: false, + // }, + // ); + + $ = await requestGot(`${urls.BASE_MONOSCHINOS}`, { + scrapy: true, + parse: false, + }); } } catch (err) { return next(err); } + // @ANIMEFLV + // for (const episode of data.episodes) { + // const formattedEpisode: Episode = { + // id: '12345/' + episode.id, + // title: episode.title, + // image: episode.poster, + // episode: episode.episode, + // servers: await transformUrlServer(episode.servers), + // }; + + // episodes.push(formattedEpisode); + // } + + let getLastest: any = $('.container .caps .container')[0]; + + $(getLastest) + .find('.row article') + .each((index: number, element: cheerio.Element) => { + let el: cheerio.Cheerio = $(element); + let title: string | undefined = el + .find('.Title') + .html() + ?.split('\t')[0]; + let img: any = el.find('.Image img').attr('src'); + let type: any = el.find('.Image figure span').text(); + type = type.substring(1, type.length); + let nEpisode: any = el.find('.dataEpi .episode').text(); + nEpisode = parseInt(nEpisode.split('\n')[1]); + let id: any = el.find('a').attr('href'); + id = id.split('/')[4]; + id = id.split('-'); + id.splice(id.length - 2, 2); + id = `${id.join('-')}-episodio-${nEpisode}`; + + let anime = { + id: `ver/${id}`, + title, + image: img, + episode: nEpisode, + }; - for (const episode of data.episodes) { - const formattedEpisode: Episode = { - id: '12345/' + episode.id, - title: episode.title, - image: episode.poster, - episode: episode.episode, - servers: await transformUrlServer(episode.servers), - }; + animeList.push(anime); + }); - episodes.push(formattedEpisode); + for (const anime of animeList) { + episodes.push({ + id: anime.id, + title: anime.title, + image: await imageUrlToBase64(anime.image), + episode: anime.episode, + servers: await videoServersMonosChinos(anime.id), + }); } if (episodes.length > 0) { diff --git a/src/utils/requestCall.ts b/src/utils/requestCall.ts index 9f99336..1f005c4 100644 --- a/src/utils/requestCall.ts +++ b/src/utils/requestCall.ts @@ -11,7 +11,7 @@ interface Options { export const requestGot = async ( url: string, - options: Options, + options?: Options, ): Promise => { if (options !== undefined) { if (options.scrapy) { diff --git a/src/utils/util.ts b/src/utils/util.ts index b04f991..0c4e74a 100644 --- a/src/utils/util.ts +++ b/src/utils/util.ts @@ -597,7 +597,6 @@ export const monoschinosInfo = async (id: string | undefined) => { export const videoServersMonosChinos = async (id: string) => { let $: cheerio.Root; let videoServers: any[] = []; - let nameServers: any[] = []; try { const resultQueryRedis: any = await redisClient.get( @@ -872,6 +871,11 @@ export function getThemes(themes: any[]) { })); } +export const imageUrlToBase64 = async (url: string) => { + let img: any = await requestGot(url); + return img.rawBody.toString('base64'); +}; + export function hashStringMd5(string: string) { return crypto.createHash('md5').update(string).digest('hex'); }