# How to automate yt-dlp: cron, n8n, Zapier, and beyond

Automate yt-dlp downloads on a schedule: safe cron setups, n8n's Execute Command node, why Zapier and Make can't run yt-dlp directly, and when to switch to an API.

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.

<HostedAnswer>
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).
</HostedAnswer>

## 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

```bash
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>&1
```

- `flock -n` stops overlapping runs when last night's job is still going
- `--download-archive` makes 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:

```bash
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](https://www.importly.io/docs/recipes/youtube-channel-new-videos-python?utm_source=ytdlp.org&utm_medium=referral&utm_campaign=doc-cta&utm_content=channel-recipe&utm_term=%2Fguides%2Fyt-dlp-automation): 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:

```ini
# /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"
```

```ini
# /etc/systemd/system/yt-dlp.timer
[Unit]
Description=Run yt-dlp nightly

[Timer]
OnCalendar=*-*-* 03:00:00
Persistent=true

[Install]
WantedBy=timers.target
```

```bash
sudo 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](/guides/yt-dlp-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](/guides/run-yt-dlp-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](https://importly.io/?utm_source=ytdlp.org&utm_medium=referral&utm_campaign=doc-cta&utm_content=automation-guide-inline&utm_term=%2Fguides%2Fyt-dlp-automation) - 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](https://www.importly.io/docs/integrations/zapier?utm_source=ytdlp.org&utm_medium=referral&utm_campaign=doc-cta&utm_content=zapier-docs&utm_term=%2Fguides%2Fyt-dlp-automation), [Make](https://www.importly.io/docs/integrations/make?utm_source=ytdlp.org&utm_medium=referral&utm_campaign=doc-cta&utm_content=make-docs&utm_term=%2Fguides%2Fyt-dlp-automation) and [n8n](https://www.importly.io/docs/integrations/n8n?utm_source=ytdlp.org&utm_medium=referral&utm_campaign=doc-cta&utm_content=n8n-docs&utm_term=%2Fguides%2Fyt-dlp-automation)

## 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:

```bash
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

<DocCta variant="workflow" />

<Faq />

## Related guides

- [Use yt-dlp as an API](/guides/yt-dlp-api)
- [Use yt-dlp in Python](/guides/yt-dlp-python)
- [Run yt-dlp in GitHub Actions](/guides/yt-dlp-github-actions)
- [Run yt-dlp on a server](/guides/run-yt-dlp-server)
- [Batch download videos](/guides/batch-download)
- [Use output templates](/guides/yt-dlp-output-template)