subtitles

This commit is contained in:
Tejas Panchal
2026-03-01 15:37:50 +05:30
parent 0e1955eb42
commit 19e3899e6d
3 changed files with 63 additions and 33 deletions

View File

@@ -5,9 +5,12 @@ export const getStreamInfo = async (req, res, fallback = false) => {
const input = req.query.id;
const server = req.query.server;
const type = req.query.type;
const match = input.match(/ep=(\d+)/);
if (!match) throw new Error("Invalid URL format");
const finalId = match[1];
const ep = req.query.ep;
let finalId = ep || input?.match(/ep=(\d+)/)?.[1] || input;
if (!finalId) throw new Error("Invalid URL format: episode ID missing");
const streamingInfo = await extractStreamingInfo(finalId, server, type, fallback);
return streamingInfo;
} catch (e) {