From cb370141774c7a233749ace2701bbaacadaeaa4b Mon Sep 17 00:00:00 2001 From: Gabriel De Castro Date: Fri, 17 May 2024 05:47:29 +0800 Subject: [PATCH] feat: Add optional custom domain functionality (#609) * feat(gogoanime,zoro): Add optional custom domain functionality * refactor(gogoanime,zoro): make code for optional custom domain functionality much cleaner --- .env.example | 3 +++ src/routes/anime/gogoanime.ts | 2 +- src/routes/anime/zoro.ts | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index fa4c1039..f1353c2b 100644 --- a/.env.example +++ b/.env.example @@ -6,4 +6,7 @@ REDIS_PORT=Redis port (optional) REDIS_PASSWORD=Redis password (optional) NINE_ANIME_HELPER_URL=9anime (optional) TMDB_KEY=TMDB access token auth (optional) +RECAPTCHATOKEN=Gogoanime recaptcha token (optional) +GOGOANIME_URL=Gogoanime custom url (optional) +ZORO_URL=Zoro custom url (optional) NODE_ENV=Environment (optional) (DEMO or PROD) diff --git a/src/routes/anime/gogoanime.ts b/src/routes/anime/gogoanime.ts index 4a83be3a..b61186e9 100644 --- a/src/routes/anime/gogoanime.ts +++ b/src/routes/anime/gogoanime.ts @@ -6,7 +6,7 @@ import { redis } from '../../main'; import { Redis } from 'ioredis'; const routes = async (fastify: FastifyInstance, options: RegisterOptions) => { - const gogoanime = new ANIME.Gogoanime(); + const gogoanime = new ANIME.Gogoanime(process.env.GOGOANIME_URL); const redisCacheTime = 60 * 60; const redisPrefix = 'gogoanime:'; diff --git a/src/routes/anime/zoro.ts b/src/routes/anime/zoro.ts index 78f098be..ad65457b 100644 --- a/src/routes/anime/zoro.ts +++ b/src/routes/anime/zoro.ts @@ -3,7 +3,7 @@ import { ANIME } from '@consumet/extensions'; import { StreamingServers } from '@consumet/extensions/dist/models'; const routes = async (fastify: FastifyInstance, options: RegisterOptions) => { - const zoro = new ANIME.Zoro(); + const zoro = new ANIME.Zoro(process.env.ZORO_URL); fastify.get('/', (_, rp) => { rp.status(200).send({