mirror of
https://github.com/JustAnimeCore/HiAnime-Api.git
synced 2026-04-17 22:01:44 +00:00
subtitles
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user