feat: change amvstrm to point to self hosted instance
This commit is contained in:
@@ -5,7 +5,7 @@ export async function getEpisodesFromAmvstrm(
|
||||
): Promise<EpisodesResponse | null> {
|
||||
try {
|
||||
const episodes: Episode[] | null = await fetch(
|
||||
`https://api.amvstr.me/api/v2/episode/${aniListId}`,
|
||||
`https://amvstrm.up.railway.app/api/v2/episode/${aniListId}`,
|
||||
)
|
||||
.then((res) => res.json<AmvstrmEpisodesResponse>())
|
||||
.then(({ code, message, episodes }) => {
|
||||
|
||||
@@ -3,7 +3,9 @@ import type { FetchUrlResponse } from "./responseType";
|
||||
export async function getSourcesFromAmvstrm(
|
||||
watchId: string,
|
||||
): Promise<FetchUrlResponse | null> {
|
||||
const source = await fetch(`https://api.amvstr.me/api/v2/stream/${watchId}`)
|
||||
const source = await fetch(
|
||||
`https://amvstrm.up.railway.app/api/v2/stream/${watchId}`,
|
||||
)
|
||||
.then((res) => res.json<AmvstrmStreamResponse>())
|
||||
.then(({ stream }) => {
|
||||
const streamObj = stream?.multi;
|
||||
|
||||
@@ -4,7 +4,7 @@ export async function fetchSearchResultsFromAmvstrm(
|
||||
limit: number,
|
||||
) {
|
||||
return fetch(
|
||||
`https://api.amvstr.me/api/v2/search?q=${query}&p=${page}&limit=${limit}`,
|
||||
`https://amvstrm.up.railway.app/api/v2/search?q=${query}&p=${page}&limit=${limit}`,
|
||||
)
|
||||
.then((res) => res.json<any>())
|
||||
.then(({ pageInfo: { hasNextPage }, results }) => ({
|
||||
|
||||
@@ -4,8 +4,8 @@ export async function fetchTitleFromAmvstrm(
|
||||
aniListId: number,
|
||||
): Promise<Title | undefined> {
|
||||
return Promise.all([
|
||||
fetch(`https://api.amvstr.me/api/v2/info/${aniListId}`).then((res) =>
|
||||
res.json<any>(),
|
||||
fetch(`https://amvstrm.up.railway.app/api/v2/info/${aniListId}`).then(
|
||||
(res) => res.json<any>(),
|
||||
),
|
||||
fetchMissingInformationFromAnify(aniListId).catch((err) => {
|
||||
console.error("Failed to get missing information from Anify", err);
|
||||
|
||||
@@ -2,7 +2,7 @@ import { HttpResponse, http } from "msw";
|
||||
|
||||
export function getAmvstrmEpisodes() {
|
||||
return http.get(
|
||||
"https://api.amvstr.me/api/v2/episode/:aniListId",
|
||||
"https://amvstrm.up.railway.app/api/v2/episode/:aniListId",
|
||||
({ params }) => {
|
||||
const aniListId = Number(params["aniListId"]);
|
||||
if (aniListId === 4) {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { HttpResponse, http } from "msw";
|
||||
|
||||
export function getAmvstrmSearchResults() {
|
||||
return http.get(
|
||||
"https://api.amvstr.me/api/v2/search",
|
||||
"https://amvstrm.up.railway.app/api/v2/search",
|
||||
({ request: { url: urlString } }) => {
|
||||
const url = new URL(urlString);
|
||||
const query = url.searchParams.get("q");
|
||||
|
||||
@@ -1,74 +1,77 @@
|
||||
import { HttpResponse, http } from "msw";
|
||||
|
||||
export function getAmvstrmSources() {
|
||||
return http.get("https://api.amvstr.me/api/v2/stream/:id", ({ params }) => {
|
||||
const { id } = params;
|
||||
return http.get(
|
||||
"https://amvstrm.up.railway.app/api/v2/stream/:id",
|
||||
({ params }) => {
|
||||
const { id } = params;
|
||||
|
||||
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 },
|
||||
);
|
||||
}
|
||||
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({
|
||||
code: 200,
|
||||
message: "success",
|
||||
info: {
|
||||
title: "Mushoku Tensei II: Isekai Ittara Honki Dasu Part 2",
|
||||
id: "mushoku-tensei-ii-isekai-ittara-honki-dasu-part-2",
|
||||
episode: "1",
|
||||
},
|
||||
stream: {
|
||||
multi: {
|
||||
main: {
|
||||
url: "https://www032.vipanicdn.net/streamhls/aa804a2400535d84dd59454b28d329fb/ep.1.1712504065.m3u8",
|
||||
label: "hls P",
|
||||
isM3U8: true,
|
||||
quality: "default",
|
||||
return HttpResponse.json({
|
||||
code: 200,
|
||||
message: "success",
|
||||
info: {
|
||||
title: "Mushoku Tensei II: Isekai Ittara Honki Dasu Part 2",
|
||||
id: "mushoku-tensei-ii-isekai-ittara-honki-dasu-part-2",
|
||||
episode: "1",
|
||||
},
|
||||
stream: {
|
||||
multi: {
|
||||
main: {
|
||||
url: "https://www032.vipanicdn.net/streamhls/aa804a2400535d84dd59454b28d329fb/ep.1.1712504065.m3u8",
|
||||
label: "hls P",
|
||||
isM3U8: true,
|
||||
quality: "default",
|
||||
},
|
||||
backup: {
|
||||
url: "https://www032.anicdnstream.info/videos/hls/6Ogzt4UOJPbzciJM8EJvgg/1717137410/223419/aa804a2400535d84dd59454b28d329fb/ep.1.1712504065.m3u8",
|
||||
label: "hls P",
|
||||
isM3U8: true,
|
||||
quality: "backup",
|
||||
},
|
||||
},
|
||||
backup: {
|
||||
url: "https://www032.anicdnstream.info/videos/hls/6Ogzt4UOJPbzciJM8EJvgg/1717137410/223419/aa804a2400535d84dd59454b28d329fb/ep.1.1712504065.m3u8",
|
||||
label: "hls P",
|
||||
isM3U8: true,
|
||||
quality: "backup",
|
||||
tracks: "",
|
||||
},
|
||||
iframe: [
|
||||
{
|
||||
name: "Multiquality Server",
|
||||
iframe:
|
||||
"https://embtaku.com/embedplus?id=MjIzNDE5&token=dvjcF3MKtKBIeAe7rQhIpw&expires=1717137409",
|
||||
},
|
||||
{
|
||||
name: "Streamwish",
|
||||
iframe: "https://awish.pro/e/nr6ogony8osz",
|
||||
},
|
||||
{
|
||||
name: "Doodstream",
|
||||
iframe: "https://dood.wf/e/4g6gt8yygdnz",
|
||||
},
|
||||
{
|
||||
name: "Mp4upload",
|
||||
iframe: "https://www.mp4upload.com/embed-3dshuf4wf6md.html",
|
||||
},
|
||||
],
|
||||
plyr: {
|
||||
main: "https://plyr.link/p/player.html#aHR0cHM6Ly93d3cwMzIudmlwYW5pY2RuLm5ldC9zdHJlYW1obHMvYWE4MDRhMjQwMDUzNWQ4NGRkNTk0NTRiMjhkMzI5ZmIvZXAuMS4xNzEyNTA0MDY1Lm0zdTg=",
|
||||
backup:
|
||||
"https://plyr.link/p/player.html#aHR0cHM6Ly93d3cwMzIuYW5pY2Ruc3RyZWFtLmluZm8vdmlkZW9zL2hscy82T2d6dDRVT0pQYnpjaUpNOEVKdmdnLzE3MTcxMzc0MTAvMjIzNDE5L2FhODA0YTI0MDA1MzVkODRkZDU5NDU0YjI4ZDMyOWZiL2VwLjEuMTcxMjUwNDA2NS5tM3U4",
|
||||
},
|
||||
tracks: "",
|
||||
},
|
||||
iframe: [
|
||||
{
|
||||
name: "Multiquality Server",
|
||||
iframe:
|
||||
"https://embtaku.com/embedplus?id=MjIzNDE5&token=dvjcF3MKtKBIeAe7rQhIpw&expires=1717137409",
|
||||
nspl: {
|
||||
main: "https://nspl.nyt92.eu.org/player?p=JnRpdGxlPW11c2hva3UtdGVuc2VpLWlpLWlzZWthaS1pdHRhcmEtaG9ua2ktZGFzdS1wYXJ0LTItZXBpc29kZS0xJmZpbGU9aHR0cHM6Ly93d3cwMzIudmlwYW5pY2RuLm5ldC9zdHJlYW1obHMvYWE4MDRhMjQwMDUzNWQ4NGRkNTk0NTRiMjhkMzI5ZmIvZXAuMS4xNzEyNTA0MDY1Lm0zdTgmdGh1bWJuYWlscz11bmRlZmluZWQ=",
|
||||
backup:
|
||||
"https://nspl.nyt92.eu.org/player?p=JnRpdGxlPW11c2hva3UtdGVuc2VpLWlpLWlzZWthaS1pdHRhcmEtaG9ua2ktZGFzdS1wYXJ0LTItZXBpc29kZS0xJmZpbGU9aHR0cHM6Ly93d3cwMzIuYW5pY2Ruc3RyZWFtLmluZm8vdmlkZW9zL2hscy82T2d6dDRVT0pQYnpjaUpNOEVKdmdnLzE3MTcxMzc0MTAvMjIzNDE5L2FhODA0YTI0MDA1MzVkODRkZDU5NDU0YjI4ZDMyOWZiL2VwLjEuMTcxMjUwNDA2NS5tM3U4JnRodW1ibmFpbHM9dW5kZWZpbmVk",
|
||||
},
|
||||
{
|
||||
name: "Streamwish",
|
||||
iframe: "https://awish.pro/e/nr6ogony8osz",
|
||||
},
|
||||
{
|
||||
name: "Doodstream",
|
||||
iframe: "https://dood.wf/e/4g6gt8yygdnz",
|
||||
},
|
||||
{
|
||||
name: "Mp4upload",
|
||||
iframe: "https://www.mp4upload.com/embed-3dshuf4wf6md.html",
|
||||
},
|
||||
],
|
||||
plyr: {
|
||||
main: "https://plyr.link/p/player.html#aHR0cHM6Ly93d3cwMzIudmlwYW5pY2RuLm5ldC9zdHJlYW1obHMvYWE4MDRhMjQwMDUzNWQ4NGRkNTk0NTRiMjhkMzI5ZmIvZXAuMS4xNzEyNTA0MDY1Lm0zdTg=",
|
||||
backup:
|
||||
"https://plyr.link/p/player.html#aHR0cHM6Ly93d3cwMzIuYW5pY2Ruc3RyZWFtLmluZm8vdmlkZW9zL2hscy82T2d6dDRVT0pQYnpjaUpNOEVKdmdnLzE3MTcxMzc0MTAvMjIzNDE5L2FhODA0YTI0MDA1MzVkODRkZDU5NDU0YjI4ZDMyOWZiL2VwLjEuMTcxMjUwNDA2NS5tM3U4",
|
||||
},
|
||||
nspl: {
|
||||
main: "https://nspl.nyt92.eu.org/player?p=JnRpdGxlPW11c2hva3UtdGVuc2VpLWlpLWlzZWthaS1pdHRhcmEtaG9ua2ktZGFzdS1wYXJ0LTItZXBpc29kZS0xJmZpbGU9aHR0cHM6Ly93d3cwMzIudmlwYW5pY2RuLm5ldC9zdHJlYW1obHMvYWE4MDRhMjQwMDUzNWQ4NGRkNTk0NTRiMjhkMzI5ZmIvZXAuMS4xNzEyNTA0MDY1Lm0zdTgmdGh1bWJuYWlscz11bmRlZmluZWQ=",
|
||||
backup:
|
||||
"https://nspl.nyt92.eu.org/player?p=JnRpdGxlPW11c2hva3UtdGVuc2VpLWlpLWlzZWthaS1pdHRhcmEtaG9ua2ktZGFzdS1wYXJ0LTItZXBpc29kZS0xJmZpbGU9aHR0cHM6Ly93d3cwMzIuYW5pY2Ruc3RyZWFtLmluZm8vdmlkZW9zL2hscy82T2d6dDRVT0pQYnpjaUpNOEVKdmdnLzE3MTcxMzc0MTAvMjIzNDE5L2FhODA0YTI0MDA1MzVkODRkZDU5NDU0YjI4ZDMyOWZiL2VwLjEuMTcxMjUwNDA2NS5tM3U4JnRodW1ibmFpbHM9dW5kZWZpbmVk",
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { HttpResponse, http } from "msw";
|
||||
|
||||
export function getAmvstrmTitle() {
|
||||
return http.get(
|
||||
"https://api.amvstr.me/api/v2/info/:aniListId",
|
||||
"https://amvstrm.up.railway.app/api/v2/info/:aniListId",
|
||||
({ params }) => {
|
||||
const aniListId = Number(params["aniListId"] as string);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user