March 29, 2020

My youtube-dl Setup

The YouTube apps on the various platforms (iOS, Apple TV, web, and so on) are ok. I was looking for a better way to watch videos that I saved to view later (especially with pip on the iPad). There is a utility called youtube-dl that you may or may not have seen mentioned online. Here is a rundown of how I am now using it to manage all my YouTube videos I want to watch.

youtube-dl Configuration

The utility can be downloaded here:
Check out the documentation on youtube-dl to get it all setup for your platform. Then it’s time to setup the configuration.

Here is what I am using for my current configuration file.

Located here: /private/etc/youtube-dl.conf
Plus ~/archive.txt to keep an archive and only download videos that have not already been downloaded.

# Save all videos to download folder
-o /Volumes/LaCie/Media/YouTube/%(title)s.%(ext)s

# Mark video as watched

# download playlist

# Dowload new videos only
--download-archive ~/archive.txt

# Download best quality
-f 299+140/137+140/best

# ffmpeg location
--ffmpeg-location /usr/local/Cellar/ffmpeg/4.3_2/bin/ffmpeg

Automating The Setup

Shell Script (
pointing to the YouTube playlist that I am using ytdl

/usr/local/bin/youtube-dl ""

Launch Agent (download_videos.plist)
A simple .plist that is placed in /Library/LaunchAgents set to run the .sh every 90 seconds. There is also a .log file in this example that I was using while testing everything.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">

<plist version="1.0">

This is all running on a 2018 Mac mini that is always on.

Plex Viewing

Now that the videos are being saved to a YouTube folder on the LaCie 6Big, this is where Plex comes in. This folder is monitored by Plex and updated with new videos so I can watch them right in the Plex app on iPhone, iPad, Mac, AppleTV, really anywhere you can get Plex running.

Managing the videos that are on the 6Big Storage.
Once I am done watching a video, Plex has an option to delete the video, which will delete the actual file on the server, so this keeps the folder from getting too out of control.

That’s it! Simply add a video to the ytdl” playlist on YouTube and this handles the rest!

Side Note - Alfred Workflow

Because youtube-dl is so useful and supports many different video platforms, I also have an Alfred workflow that I use for one-off downloads. Since this workflow is different from what I want the above system to accomplish with a YouTube playlist, I have set this up slightly different.

I don’t want the videos downloaded via this workflow to go to the same YouTube folder on the LacIe, so I decided to go with a one off config just for this workflow, it looks like this:

youtube-dl -o "~/Downloads/%(title)s.%(ext)s" -f "mp4" --ignore-config "{query}"

This ignores my standard config file and sets the download location to Downloads’.

  1. Copy the video URL to clipboard
  2. Trigger Alfred
  3. Use the keyword yt followed by pasting the video URL
  4. Hit enter and your video begins downloading!

YouTube-dl Alfred Workflow

iOS Shortcut

I realized I didn’t have a way to complete the workflow if I got a link on my iPhone / iPad, so here is a shortcut to fix that.


  • If your automated downloads stop and you are getting an error in the console related to keyerror: u'content_html' the issue may be that your YouTube playlist has gotten too large. This happened to me and my list was over 400 items! 😱 Probably a good idea to clean that list up from time to time. 👍

YouTube Automation YouTube-dl Mac Plex Alfred Workflow iOS Shortcuts

Previous post
Animated Color Change Blog Logo I have been wanting to swap the logo on my blog to my own logo (instead of the Animoji face I have been using) but I wanted it to be something more
Next post
Making A Board Game - Part 5 Things are progressing, albeit slowly, but they are! We have done some more play testing with beta components, and I think the game is coming along
Jason Burk | 1999-2020! | 🧛‍♂️
📦 Blog Archives 📦