feat: torrent player
This commit is contained in:
1 parent
b379bc229d
commit
f6cb8df39b
17 files changed
+1705
-3689
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user