From b9402e74e15dc36d33b9e52e78b387c2550d0728 Mon Sep 17 00:00:00 2001 From: Gustav P Svensson Date: Mon, 24 Jul 2023 22:59:53 +0200 Subject: [PATCH] fix token is undefiend --- pages/api/video/[id]/hls/[quality]/index.js | 3 ++- pages/api/video/[id]/hls/master.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pages/api/video/[id]/hls/[quality]/index.js b/pages/api/video/[id]/hls/[quality]/index.js index b84b2ac..2123be6 100644 --- a/pages/api/video/[id]/hls/[quality]/index.js +++ b/pages/api/video/[id]/hls/[quality]/index.js @@ -10,7 +10,8 @@ const logger = new Logger(); const segmentDur = Transcoding.SEGMENT_DURATION; // Controls the duration (in seconds) that the file will be chopped into. export default async (req, res) => { - const { id, quality, duration, group, audioStream, type } = req.query; + // TODO: Remove token from here, make the m3u8 links work without token in the GET parameters + const { id, quality, duration, group, audioStream, type, token } = req.query; if (!validateUser(req, process.env.SECRET, 10800)) { res.status(403).end(); diff --git a/pages/api/video/[id]/hls/master.js b/pages/api/video/[id]/hls/master.js index d5d1853..46b3837 100644 --- a/pages/api/video/[id]/hls/master.js +++ b/pages/api/video/[id]/hls/master.js @@ -128,7 +128,8 @@ const getSubtitleStreams = (id, subtitles, type, token) => { } export default async (req, res) => { - const { id, audioStream, type } = req.query; + // TODO: Remove token from here, make the m3u8 links work without token in the GET parameters + const { id, audioStream, type, token } = req.query; if (!validateUser(req)) { res.status(403).end();