
Go YouTube Downloader
Command line/terminal based app written in Go to download Shorts & Videos using YouTube URLs/IDs.
Note: If you're looking for a ready-to-use tool, please check pinned issues for this repo.
Main Features
Project Dependencies
At present, the project has 2 dependencies,
-
tview - Terminal UI library with rich, interactive widgets - written in Golang.
-
FFmpeg - The leading cross-platform multimedia framework. It should be installed in system or at-least have latest static binary in project's root directory. It's more of an external runtime dependency.
Working Demo
-
When pasted either YouTube Shorts/Video ID or URL, the app fetches the metadata from YouTube's internal APIs.
-
Then depending on quality selections for video & audio, the application downloads the Shorts/Video content by making of small sized data requests to the fetched content URLs.
-
In the end, if the FFmpeg exist, then both separate video & audio stream files are merged into single output file.
https://github.com/apchavan/go-youtube-downloader/assets/49102443/e177f755-b607-40be-8d22-05f4850e97a7
Build Binary
After installing Go, enter below command from project's root,
https://github.com/apchavan/go-youtube-downloader/assets/49102443/6ded3ee7-c5ed-49d3-bdf4-57147fef3c18
Run Directly with Source Code
After installing Go, clone/download this project & enter below command from project's root,
go run ./cmd/go_youtube_downloader.go
https://github.com/apchavan/go-youtube-downloader/assets/49102443/1b1c4fd9-f0fe-4590-86e1-4a456a012d5f
Important Notes
-
Systems must have FFmpeg installed or have latest static binary in project's root directory to merge downloaded separate video & audio streams into a single file.
-
Age-restricted videos can not be downloaded due to YouTube's Signature Ciphering.
-
YouTube have bandwidth limitations for each incoming request, around 10 MB per request. If any request gets more data than this size limit, then further requests will throttle download or connection may get terminated. So, to get better performance when downloading data & writing it to output file, it's divided into smaller chunks for consistency. Based on selected quality & size, the download time would be more or less.
Special Thanks to Resources