Skip to content

apchavan/go-youtube-downloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub go.mod Go version of a Go module GoReportCard Go Reference

Go YouTube Downloader

Command line/terminal based app written in Go to download Shorts & Videos using YouTube URLs/IDs.

Main Features

  • YouTube Shorts & Videos downloading.

  • Ability to select from different content qualities.

Project Dependencies

At present, the project has 2 dependencies,

  1. tview - Terminal UI library with rich, interactive widgets - written in Golang.

  2. 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

  1. When pasted either YouTube Shorts/Video ID or URL, the app fetches the metadata from YouTube's internal APIs.

  2. 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.

  3. In the end, if the FFmpeg exist, then both separate video & audio stream files are merged into single output file.

working_demo_clip.mp4

Build Binary

After installing Go, enter below command from project's root,

  • On Linux/UNIX,

    go build -o go_youtube_downloader ./cmd/go_youtube_downloader.go

  • On Windows,

    go build -o go_youtube_downloader.exe ./cmd/go_youtube_downloader.go

build_clip.mp4

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

direct_run_clip.mp4

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

Releases

No releases published

Packages

No packages published

Languages