File size: 397 Bytes
6ad6b66
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
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']}")