Python version
Written and tested using Python 3.12.7
This project requires yt_dlp and FFmpeg to be installed on your system.
Install required packages: pip install yt-dlp certifi
- Download FFmpeg: https://www.gyan.dev/ffmpeg/builds/
Download: ffmpeg-release-essentials.zip
- Extract files to: C:\ffmpeg\bin\
Required files:
C:\ffmpeg\bin\ffmpeg.exe
C:\ffmpeg\bin\ffprobe.exe
C:\ffmpeg\bin\ffplay.exe
-
Add to Windows PATH: C:\ffmpeg\bin
-
Verify: ffmpeg -version
Due to a Windows-specific certificate validation problem, SSL certificate checking is disabled in the code with "nocheckcertificate": True
On macOS, the application works without disabling SSL certificate verification and does not require any certificate-related workaround.
Install ffmpeg on macOS
Install FFmpeg using Homebrew:
brew install ffmpeg
ffmpeg -version
On Apple Silicon Macs, FFmpeg is usually installed at:
/opt/homebrew/bin/ffmpeg
import yt_dlp
url = input("Enter video URL: ").strip()
ydl_opts = {
"format": "bestvideo*+bestaudio/best",
"merge_output_format": "mp4",
"ffmpeg_location": r"C:\ffmpeg\bin",
"nocheckcertificate": True
}
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
ydl.download([url])
print("Download completed.")