diff --git a/packages/client/src/components/UploadForm.tsx b/packages/client/src/components/UploadForm.tsx index 2ede275c..269b4771 100644 --- a/packages/client/src/components/UploadForm.tsx +++ b/packages/client/src/components/UploadForm.tsx @@ -1,4 +1,4 @@ -import { authFetch } from '@/helpers'; +import { addHttpsProtocol, authFetch } from '@/helpers'; import React, { useContext, useState } from 'react'; import { SignedUrlResponseBody, @@ -134,7 +134,8 @@ const checkUrlValid = (url_input: string): MediaUrlInput => { if (url_input === '') { return { value: url_input, status: 'empty' }; } - const url = new URL(url_input); + const cleanedUrlInput = addHttpsProtocol(url_input); + const url = new URL(cleanedUrlInput); // we don't want people providing search results pages as yt-dlp will try and fetch every video if ( url.pathname.includes('results') && @@ -223,8 +224,9 @@ export const UploadForm = () => { ); setMediaUrls(urlsWithStatus); for (const url of urls) { + const urlWithProtocol = addHttpsProtocol(url); const success = await submitMediaUrl( - url, + urlWithProtocol, token, mediaFileLanguageCode, translationRequested, @@ -300,8 +302,8 @@ export const UploadForm = () => { return ( <>
- This tool can transcribe both audio and video. You will receive an - email when the transcription is ready. + This tool can transcribe both audio and video. You will receive an email + when the transcription is ready.