Skip to content

Commit

Permalink
feat(gogoanime,zoro): Add optional custom domain functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
hase0278 committed May 4, 2024
1 parent 31ad982 commit 44baeb5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 4 additions & 1 deletion src/routes/anime/gogoanime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import { redis } from '../../main';
import { Redis } from 'ioredis';

const routes = async (fastify: FastifyInstance, options: RegisterOptions) => {
const gogoanime = new ANIME.Gogoanime();
let gogoanime = new ANIME.Gogoanime();
if(process.env.GOGOANIME_URL){
gogoanime = new ANIME.Gogoanime(process.env.GOGOANIME_URL);
}
const redisCacheTime = 60 * 60;
const redisPrefix = 'gogoanime:';

Expand Down
5 changes: 4 additions & 1 deletion src/routes/anime/zoro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { ANIME } from '@consumet/extensions';
import { StreamingServers } from '@consumet/extensions/dist/models';

const routes = async (fastify: FastifyInstance, options: RegisterOptions) => {
const zoro = new ANIME.Zoro();
let zoro = new ANIME.Zoro();
if(process.env.ZORO_URL){
zoro = new ANIME.Zoro(process.env.ZORO_URL);
}

fastify.get('/', (_, rp) => {
rp.status(200).send({
Expand Down

0 comments on commit 44baeb5

Please sign in to comment.