diff options
author | bobzel <zzzman@gmail.com> | 2021-05-18 14:58:18 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-05-18 15:50:30 -0400 |
commit | 6919954467f3f2e4ca2f02e34eda827df9f5f83d (patch) | |
tree | 3d80cefa5558d93a896a1ef6c7b98b9da83c2bde /src/client/Network.ts | |
parent | 4760f9be498d19de9d285e8d99e5fbb277df1904 (diff) |
added downloading of youtube videos if https://youtube-dl.org/ is installed on the server's path
Diffstat (limited to 'src/client/Network.ts')
-rw-r--r-- | src/client/Network.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/client/Network.ts b/src/client/Network.ts index 6982ecf19..bf2918734 100644 --- a/src/client/Network.ts +++ b/src/client/Network.ts @@ -36,4 +36,14 @@ export namespace Networking { return response.json(); } + export async function UploadYoutubeToServer<T extends Upload.FileInformation = Upload.FileInformation>(videoId: string): Promise<Upload.FileResponse<T>[]> { + const parameters = { + method: 'POST', + body: JSON.stringify({ videoId }), + json: true + }; + const response = await fetch("/uploadYoutubeVideo", parameters); + return response.json(); + } + }
\ No newline at end of file |