feat: add Amvstrm as provider for stream URL

Summary:

Test Plan:
This commit is contained in:
2024-05-30 22:48:02 -04:00
parent 7e3c818828
commit c0ef6838fc
6 changed files with 220 additions and 5 deletions

View File

@@ -112,6 +112,26 @@ app.openapi(route, async (c) => {
}
}
if (provider === "amvstrm") {
try {
const result = await import("./amvstrm").then(
({ getSourcesFromAmvstrm }) => getSourcesFromAmvstrm(id),
);
if (!result) {
return c.json({ success: false }, { status: 404 });
}
return c.json({
success: true,
result,
});
} catch (e) {
console.error("Failed to fetch download URL from Amvstrm", e);
return c.json(ErrorResponse, { status: 500 });
}
}
return c.json(ErrorResponse, { status: 400 });
});