refactor: Remove Anify and Consumet integrations, their dependencies, and the ipCheck script.

This commit is contained in:
2025-12-16 08:01:56 -05:00
parent e8c7c7801f
commit 45bf96e764
7 changed files with 1 additions and 655 deletions

View File

@@ -1,64 +0,0 @@
import { sortByProperty } from "~/libs/sortByProperty";
import type { FetchUrlResponse } from "~/types/episode/fetch-url-response";
import { type SkipTime, convertSkipTime } from "./convertSkipTime";
import {
audioPriority,
qualityPriority,
subtitlesPriority,
} from "./priorities";
export async function getSourcesFromAnify(
provider: string,
watchId: string,
aniListId: number,
): Promise<FetchUrlResponse | null> {
const response = await fetch("https://anify.eltik.cc/sources", {
body: JSON.stringify({
watchId,
providerId: provider,
episodeNumber: "1",
id: aniListId.toString(),
subType: "sub",
}),
method: "POST",
}).then((res) => res.json() as Promise<AnifySourcesResponse>);
const { sources, subtitles, audio, intro, outro, headers } = response;
if (!sources || sources.length === 0) {
return null;
}
const source = sources.sort(sortByProperty(qualityPriority, "quality"))[0]
?.url;
subtitles?.sort(sortByProperty(subtitlesPriority, "lang"));
audio?.sort(sortByProperty(audioPriority, "lang"));
return {
source,
audio,
subtitles,
intro: convertSkipTime(intro),
outro: convertSkipTime(outro),
headers: Object.keys(headers ?? {}).length > 0 ? headers : undefined,
};
}
interface AnifySourcesResponse {
sources: VideoSource[];
subtitles: LanguageSource[];
audio: LanguageSource[];
intro: SkipTime;
outro: SkipTime;
headers?: Record<string, string>;
}
interface VideoSource {
url: string;
quality: string;
}
interface LanguageSource {
url: string;
lang: string;
}