feat: torrent player

This commit is contained in:
ner committed 2024-10-03 22:28:02 +03:00
1 parent b379bc229d
commit f6cb8df39b
17 files changed
+1705 -3689

No files matched your search

+16
View File
@@ -174,6 +174,22 @@ export const trailers = async ({
.then((data) => data.results);
};
export const torrentFiles = (magnet: string): Promise<Video[]> => {
return http
.get<{ name: string; subtitles: Subtitles[] }[]>('/files', { params: { magnet } }, process.env.TRACKER_PROXY_BASE)
.then((files) =>
files.map((file) => {
const base = `${process.env.TRACKER_PROXY_BASE}/stream?magnet=${encodeURIComponent(magnet)}}`;
return {
name: file.name,
src: `${base}&filename=${encodeURIComponent(file.name)}`,
subtitles: file.subtitles
};
})
);
};
export const YTSTorrents = async ({
query,
sort,