refactor: replace amvstrm source with aniwatch

This commit is contained in:
2024-08-18 21:37:13 -04:00
parent 0bcc547ede
commit 1a06eb51eb
14 changed files with 179 additions and 262 deletions

View File

@@ -1,5 +1,6 @@
import { sortByProperty } from "~/libs/sortByProperty";
import { type SkipTime, convertSkipTime } from "./convertSkipTime";
import {
audioPriority,
qualityPriority,
@@ -37,14 +38,8 @@ export async function getSourcesFromAnify(
source,
audio,
subtitles,
intro:
typeof intro?.start === "number" && typeof intro?.end === "number"
? [intro.start, intro.end].map((seconds) => Math.floor(seconds))
: undefined,
outro:
typeof outro?.start === "number" && typeof outro?.end === "number"
? [outro.start, outro.end].map((seconds) => Math.floor(seconds))
: undefined,
intro: convertSkipTime(intro),
outro: convertSkipTime(outro),
headers: Object.keys(headers ?? {}).length > 0 ? headers : undefined,
};
}
@@ -58,11 +53,6 @@ interface AnifySourcesResponse {
headers?: Record<string, string>;
}
interface SkipTime {
start: number;
end: number;
}
interface VideoSource {
url: string;
quality: string;