Youtube Downloader
- Go 82%
- Makefile 18%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| CLAUDE.md | ||
| go.mod | ||
| main.go | ||
| Makefile | ||
| README.md | ||
ydown - YouTube Video Downloader
A CLI tool to download YouTube videos from a CSV file containing video URLs and titles.
Usage
./ydown <input-file> [cookie-file]
input-file: CSV file with formatlink,title(one video per line)cookie-file: (optional) path to cookies.txt file for authentication
Requirements
- Go (for building)
- Node.js (required for YouTube's bot challenge solving)
- Python3 with secretstorage (for browser cookie extraction)
Install Node.js:
sudo apt install nodejs # Ubuntu/Debian
Install Python dependencies:
python3 -m pip install secretstorage
Authentication
YouTube may require authentication to download videos. There are two methods:
Method 1: Browser Cookies (Default)
The tool automatically attempts to use cookies from Chrome. Requires:
- Chrome installed and logged into YouTube
- Python dependencies installed:
python3 -m pip install secretstorage
Method 2: Manual Cookie File (More Reliable)
If browser cookies fail, export cookies manually:
- Install the browser extension: "Get cookies.txt LOCALLY" (Chrome/Firefox)
- Go to YouTube while logged in
- Click the extension and export cookies to a file (e.g.,
cookies.txt) - Run with the cookie file:
./ydown "your-file.csv" cookies.txt
Example
# Without cookie file (uses browser cookies)
./ydown "videos.csv"
# With cookie file
./ydown "videos.csv" cookies.txt
CSV Format
Create a CSV file with the following format:
https://www.youtube.com/watch?v=VIDEO_ID,Video Title
https://www.youtube.com/watch?v=VIDEO_ID2,Another Video Title
Videos will be downloaded to a directory named after the CSV file (without extension).
Building
go build -o ydown main.go