54 lines
1.6 KiB
TypeScript
54 lines
1.6 KiB
TypeScript
import { HttpResponse, http } from "msw";
|
|
|
|
export function getAniwatchSources() {
|
|
return http.get(
|
|
"https://aniwatch.up.railway.app/api/v2/hianime/episode/sources",
|
|
({ request }) => {
|
|
const url = new URL(request.url);
|
|
const id = url.searchParams.get("id");
|
|
|
|
if (id === "unknown") {
|
|
return HttpResponse.json(
|
|
{
|
|
code: 404,
|
|
message:
|
|
"The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible.",
|
|
},
|
|
{ status: 404 },
|
|
);
|
|
}
|
|
|
|
return HttpResponse.json({
|
|
tracks: [
|
|
{
|
|
file: "https://s.megastatics.com/subtitle/4ea42fb35b93b7a2d8e69ca8fe55c0e5/eng-2.vtt",
|
|
label: "English",
|
|
kind: "captions",
|
|
default: true,
|
|
},
|
|
{
|
|
file: "https://s.megastatics.com/thumbnails/be7d997958cdf9b9444d910c2c28645e/thumbnails.vtt",
|
|
kind: "thumbnails",
|
|
},
|
|
],
|
|
intro: {
|
|
start: 258,
|
|
end: 347,
|
|
},
|
|
outro: {
|
|
start: 1335,
|
|
end: 1424,
|
|
},
|
|
sources: [
|
|
{
|
|
url: "https://vd2.biananset.net/_v7/26c0c3f5b635f5b9153fca5d43037bb06875d79b3f1528ca69ac83f8e14c90a48cce237316cbf6fa12de243f1dca5118b8dbb767aff155b79ad687a75905004314bee838cdbd8bea083910d6f660f3e29ebb5bb3e48dd9b30816c31737fc8fdf9dd123a7ea937c5594fb9daf540e6a4e6aecef840e23f0fe9cfe20638e3467a2/master.m3u8",
|
|
type: "hls",
|
|
},
|
|
],
|
|
anilistID: 153406,
|
|
malID: 52635,
|
|
});
|
|
},
|
|
);
|
|
}
|