diff options
| author | Factiven <[email protected]> | 2023-10-24 20:27:32 +0700 |
|---|---|---|
| committer | Factiven <[email protected]> | 2023-10-24 20:27:32 +0700 |
| commit | 451e4dffd000169e7113aa3275e4acaf7f1fbbbc (patch) | |
| tree | 035edf0d05e2f6878be745c326935aba3d821636 /pages/api/v2/source | |
| parent | Update v4.2.1 (diff) | |
| download | moopa-4.2.2.tar.xz moopa-4.2.2.zip | |
Update v4.2.2v4.2.2
Diffstat (limited to 'pages/api/v2/source')
| -rw-r--r-- | pages/api/v2/source/index.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pages/api/v2/source/index.js b/pages/api/v2/source/index.js index 9ec6082..103bc29 100644 --- a/pages/api/v2/source/index.js +++ b/pages/api/v2/source/index.js @@ -2,8 +2,8 @@ import { rateLimiterRedis, redis } from "@/lib/redis"; import axios from "axios"; let CONSUMET_URI; -CONSUMET_URI = process.env.API_URI; -if (CONSUMET_URI.endsWith("/")) { +CONSUMET_URI = process.env.API_URI || null; +if (CONSUMET_URI && CONSUMET_URI.endsWith("/")) { CONSUMET_URI = CONSUMET_URI.slice(0, -1); } const API_KEY = process.env.API_KEY; @@ -25,7 +25,7 @@ async function anifySource(providerId, watchId, episode, id, sub) { const { data } = await axios.get( `https://api.anify.tv/sources?providerId=${providerId}&watchId=${encodeURIComponent( watchId - )}&episodeNumber=${episode}&id=${id}&subType=${sub}&apikey=${API_KEY}` + )}&episodeNumber=${episode}&id=${id}&subType=${sub}` ); return data; } catch (error) { |