feat: add Consumet as provider for stream URL
Summary: Test Plan:
This commit is contained in:
@@ -50,4 +50,44 @@ describe('requests the "/episodes/:id/url" route', () => {
|
||||
expect(response.json()).resolves.toEqual({ success: false });
|
||||
expect(response.status).toBe(404);
|
||||
});
|
||||
|
||||
it("with sources from Consumet", async () => {
|
||||
const response = await app.request(
|
||||
"/episodes/1/url",
|
||||
{
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
provider: "consumet",
|
||||
id: "/ore-dake-level-up-na-ken-episode-2",
|
||||
}),
|
||||
headers: { "Content-Type": "application/json" },
|
||||
},
|
||||
{
|
||||
ENABLE_ANIFY: "true",
|
||||
},
|
||||
);
|
||||
|
||||
expect(response.json()).resolves.toEqual({
|
||||
success: true,
|
||||
result: {
|
||||
source: "https://consumet.com",
|
||||
subtitles: [],
|
||||
audio: [],
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it("with no URL from Consumet source", async () => {
|
||||
const response = await app.request("/episodes/-1/url", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
provider: "consumet",
|
||||
id: "unknown",
|
||||
}),
|
||||
headers: { "Content-Type": "application/json" },
|
||||
});
|
||||
|
||||
expect(response.json()).resolves.toEqual({ success: false });
|
||||
expect(response.status).toBe(404);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user