Skip to content

JonathanBeck1/YoutubeDownloader

Repository files navigation

YouTubeDownloader for macOS

macOS Shell License

Download a single YouTube URL as either:

  • an .mp4 video with audio
  • an .mp3 audio file

This project uses yt-dlp and ffmpeg, wrapped in simple .command launchers so it can be used from Finder or Terminal.

Why This Exists

This repo is meant to be:

  • small
  • easy to install
  • easy to run
  • easy to understand

No GUI app, no account setup, and no complicated config. Just install it, paste a YouTube link, and download the file.

Features

  • video_audio.command downloads one video to downloads/videos/
  • audio.command downloads one video as MP3 to downloads/audio/
  • --no-playlist is enforced so one pasted URL stays one download
  • after each download, the prompt stays open so you can paste another URL
  • works from Finder or Terminal
  • includes a one-command installer for macOS

Install

Recommended: one-command install

Open Terminal and run:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/JonathanBeck1/YoutubeDownloader/main/install.sh)"

The installer will:

  1. Install Homebrew if it is missing
  2. Install yt-dlp, ffmpeg, and git
  3. Clone or update this repo into ~/Documents/YoutubeDownloader
  4. Create the downloads/audio and downloads/videos folders
  5. Mark the scripts as executable
  6. Open the project folder in Finder

After install, the project will live here:

~/Documents/YoutubeDownloader

Manual install

If you want to install it manually:

git clone https://github.com/JonathanBeck1/YoutubeDownloader.git ~/Documents/YoutubeDownloader
cd ~/Documents/YoutubeDownloader
./install.sh

Run It

Finder

  1. Open ~/Documents/YoutubeDownloader
  2. Double-click audio.command for MP3
  3. Double-click video_audio.command for MP4
  4. Paste a full YouTube URL
  5. Press Return
  6. Paste another URL when the download finishes, or type EXIT to quit

Saved files go here:

  • MP3 downloads: ~/Documents/YoutubeDownloader/downloads/audio
  • MP4 downloads: ~/Documents/YoutubeDownloader/downloads/videos

Terminal

Move into the project folder:

cd ~/Documents/YoutubeDownloader

Prompted mode:

./audio.command
./video_audio.command

When one download finishes, the script prompts again so you can keep pasting URLs. Type EXIT to stop.

Direct URL mode:

./audio.command "https://www.youtube.com/watch?v=VIDEO_ID"
./video_audio.command "https://www.youtube.com/watch?v=VIDEO_ID"

You can also run the underlying scripts directly:

./ytaudio.sh "https://www.youtube.com/watch?v=VIDEO_ID"
./ytvideo.sh "https://www.youtube.com/watch?v=VIDEO_ID"

First Run on macOS

The first time you open a .command file, macOS may block it.

If that happens:

  1. Right-click the file
  2. Click Open
  3. Click Open again in the confirmation dialog

macOS may also ask Terminal for access to your Documents folder. Allow that access so the downloaded files can be saved.

Update

To update later:

cd ~/Documents/YoutubeDownloader
git pull --ff-only
brew upgrade yt-dlp ffmpeg

Troubleshooting

command not found: yt-dlp

Run:

cd ~/Documents/YoutubeDownloader
./install.sh

Permission denied

Run:

cd ~/Documents/YoutubeDownloader
chmod +x *.command *.sh

The script window closes too fast

Run the same launcher from Terminal so you can see the full output:

cd ~/Documents/YoutubeDownloader
./audio.command

or:

cd ~/Documents/YoutubeDownloader
./video_audio.command

Nothing appears in downloads/

  • make sure you pasted a full https:// URL
  • make sure the URL is for one video, not a playlist
  • make sure Terminal was allowed to access Documents

Project Layout

YoutubeDownloader/
├── audio.command
├── video_audio.command
├── ytaudio.sh
├── ytvideo.sh
├── ytcommon.sh
├── install.sh
├── downloads/
│   ├── audio/
│   └── videos/
├── LICENSE
└── README.md

Development

Basic syntax check:

bash -n install.sh ytaudio.sh ytvideo.sh ytcommon.sh audio.command video_audio.command

Optional ShellCheck:

shellcheck install.sh ytaudio.sh ytvideo.sh ytcommon.sh audio.command video_audio.command

Disclaimer

This project is provided as-is for personal backup and educational use only. Downloading content from YouTube may violate YouTube's Terms of Service and local copyright law. You are responsible for how you use this project.

License

MIT. See LICENSE.

About

Simple macOS YouTube downloader with video and audio support

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages