transcribe / ytdlp_functions.py
zxyse's picture
Upload 6 files
6ad6b66 verified
raw
history blame contribute delete
397 Bytes
from yt_dlp import YoutubeDL
import os
def download_quick_mp4(url, folder):
ytdl_format_options = {
'outtmpl': os.path.join(folder, '%(title)s-%(id)s.%(ext)s')
}
with YoutubeDL(ytdl_format_options) as ydl:
info = ydl.extract_info(url, download=False)
file = ydl.download(url)
return os.path.join(folder, f"{info['title']}-{info['id']}.{info['ext']}")