diff options
| author | bobzel <zzzman@gmail.com> | 2021-05-18 14:58:18 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2021-05-18 14:58:18 -0400 |
| commit | 53532257a5696e43cd13e380a728a20637625719 (patch) | |
| tree | 5ca18364b617fad5fe4f8c41d360ce654f9e5727 /src/client/Network.ts | |
| parent | 7c18243dd38656b63334f48d9270d912ce6384fa (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 |
