Workflow guide
How to automate yt-dlp: cron, n8n, Zapier, and beyond
Once a download job repeats on a schedule — a channel every night, a playlist every week — running it by hand stops making sense. This guide covers the automation ladder from a cron line to no-code platforms, including the step most tutorials skip: which platforms can't run yt-dlp at all.
Short answer: On a machine you control, a cron job with a lock and a download archive covers most schedules. Zapier, Make and cloud-hosted n8n can't run yt-dlp at all (below). If downloads have to keep working inside an app, a hosted API such as Importly takes the link and returns the file, transcript or metadata, and it works from servers where self-hosted downloads get blocked, with nothing to install or patch on the box.
The automation ladder, at a glance
| Tool | Runs yt-dlp? | Best for |
|---|---|---|
| cron | Yes | one machine you own, a handful of scheduled jobs |
| systemd timer | Yes | servers already on systemd; real logs and run status |
| Docker + cron | Yes | a reproducible setup you rebuild to stay current |
| self-hosted n8n, Node-RED, Huginn | Yes | visual workflows with branches and alerts |
| GitHub Actions | Yes, but | free scheduled runners — though YouTube blocks their cloud IPs |
| Zapier, Make, cloud-hosted n8n | No | they can't run a binary; call an API instead |
The split that trips people up is the last two rows. Anything that runs on your machine can run yt-dlp; anything that runs on someone else's managed platform usually can't. The rest of this guide works down that ladder.
Quick answer: a safe cron job
0 3 * * * flock -n /tmp/ytdlp.lock yt-dlp -a /home/me/urls.txt \
--download-archive /home/me/archive.txt \
-o "/media/%(uploader)s/%(title)s.%(ext)s" \
>> /var/log/yt-dlp-cron.log 2>&1flock -nstops overlapping runs when last night's job is still going--download-archivemakes reruns skip what you already have- logging to a file is your only visibility — cron fails silently otherwise
Watching channels and playlists on a schedule
Point the cron job at a channel or playlist URL instead of individual videos, and the archive file turns it into a "grab whatever is new" poller:
yt-dlp "https://www.youtube.com/@channel/videos" \
--download-archive archive.txt \
--playlist-end 10 \
--dateafter now-7days--playlist-end 10 keeps the nightly check cheap instead of re-scanning a 2,000-video back catalog, and --dateafter bounds it by upload date.
For a channel poller inside an app on a server, there's a Python version that uses an API instead: it reads the channel's public feed every 10 to 20 minutes and imports each new upload once, with its captions, into your own bucket.
systemd timers: cron with real logs
On a server that already runs systemd, a timer is a sturdier cron. You get systemctl status, real logs in the journal instead of a lone log file, and jobs that catch up after the machine was off. It's two small files:
# /etc/systemd/system/yt-dlp.service
[Unit]
Description=yt-dlp nightly fetch
[Service]
Type=oneshot
User=me
ExecStart=/usr/local/bin/yt-dlp -a /home/me/urls.txt \
--download-archive /home/me/archive.txt \
-o "/media/%%(uploader)s/%%(title)s.%%(ext)s"# /etc/systemd/system/yt-dlp.timer
[Unit]
Description=Run yt-dlp nightly
[Timer]
OnCalendar=*-*-* 03:00:00
Persistent=true
[Install]
WantedBy=timers.targetsudo systemctl enable --now yt-dlp.timer
systemctl list-timers yt-dlp.timer # when does it run next?
journalctl -u yt-dlp.service -n 50 # what happened last time?Two gotchas catch everyone: a literal % in an output template has to be doubled to %% in a unit file, because systemd reads a single % as its own specifier; and Persistent=true runs a job that was missed while the box was down, which plain cron never does.
Scheduled runs in GitHub Actions
A schedule: trigger gives you a free nightly runner with no server to own — the catch is that GitHub's runners live on cloud IPs YouTube treats as bots, so YouTube jobs often 403 there even when the same workflow works for other sites. The cron syntax, cookie handling and the IP wall are covered in run yt-dlp in GitHub Actions.
n8n and other self-hosted automation tools
Self-hosted n8n can run yt-dlp with the Execute Command node, because the workflow runs on your machine where the binary lives. Install yt-dlp in the n8n container (or mount it in), then wire Schedule Trigger → Execute Command → error branch to Slack/email. The same logic applies to Node-RED, Huginn, or a plain systemd timer: self-hosted runner, full power.
The gotchas are the server ones, not the n8n ones: the container needs ffmpeg, an updated yt-dlp, disk space, and a tolerable IP — see running yt-dlp on a server.
Why Zapier and Make can't run yt-dlp
Zapier, Make, and cloud-hosted n8n execute steps on their servers, and they don't let you run arbitrary binaries. There is no "yt-dlp step" and there can't be one. Your two options from a no-code platform:
- Bridge to your own machine: have the Zap call a webhook on a server you run, which executes yt-dlp — now you're maintaining a server anyway
- Call a media-import API: an HTTP step to a service like Importly - URL in, file to S3 or webhook out, no server to babysit. Its docs show the setup with each platform's built-in HTTP step: Zapier, Make and n8n
Make failures loud
Every scheduled yt-dlp setup eventually breaks — extractor changes, expired cookies, full disk, blocked IP. The difference between a hobby setup and a reliable one is whether you find out from an alert or from noticing weeks of missing files:
yt-dlp -a urls.txt --download-archive archive.txt \
|| curl -s -X POST "$SLACK_WEBHOOK" -d '{"text":"yt-dlp nightly failed"}'Common automation mistakes
- no archive file — every run redownloads everything
- no lock — overlapping runs corrupt each other's partial files
- no failure alerting — silence is indistinguishable from success
- hammering a source every 5 minutes and getting the IP rate-limited
- expecting Zapier/Make to execute a binary they will never execute
Automation
Running this on a schedule? See the API version.
Paste a link and watch one API call do what your batch script does — extraction, retries, and site breakage handled.
Building this into an app? See the API your backend calls instead
Frequently asked questions
Can Zapier or Make run yt-dlp?
No. Zapier, Make and cloud-hosted n8n can't run a binary like yt-dlp - they only call hosted services. To automate downloads from those platforms you call an API that does the fetch and hands back the file, rather than running yt-dlp itself.
How do I schedule yt-dlp safely with cron?
Wrap the command in `flock -n` so overlapping runs can't pile up, add `--download-archive` so reruns skip what you already have, and redirect output to a log file - cron fails silently otherwise. A line like `0 3 * * * flock -n /tmp/ytdlp.lock yt-dlp -a urls.txt --download-archive archive.txt ...` covers most schedules.
Can n8n run yt-dlp?
Self-hosted n8n can, through its Execute Command node, because it runs on a machine you control. Cloud-hosted n8n can't run a binary. The same split applies to Node-RED and Huginn: run them yourself and they can shell out to yt-dlp.
How do I automatically download new videos from a channel?
Point the scheduled job at the channel or playlist URL instead of individual videos and keep a `--download-archive` file. The archive turns it into a "grab whatever is new" poller: each run downloads only the videos it hasn't seen before.