Use Node runtime for YouTube backups

This commit is contained in:
juvdiaz 2026-06-27 14:30:28 -06:00
parent 6b673e3bdd
commit 1dab330a38
5 changed files with 16 additions and 4 deletions

View File

@ -28,7 +28,8 @@ debian_pc_enable_services:
- bluetooth - bluetooth
debian_pc_pipx_packages: debian_pc_pipx_packages:
- yt-dlp - package: "yt-dlp[default]"
app: yt-dlp
debian_pc_hold_packages: debian_pc_hold_packages:
- containerd.io - containerd.io

View File

@ -177,8 +177,13 @@
- name: Install user pipx CLI tools - name: Install user pipx CLI tools
ansible.builtin.command: ansible.builtin.command:
cmd: "python3 -m pipx install {{ item }}" argv:
creates: "{{ debian_pc_user_home }}/.local/bin/{{ item }}" - python3
- -m
- pipx
- install
- "{{ item.package }}"
creates: "{{ debian_pc_user_home }}/.local/bin/{{ item.app }}"
become: true become: true
become_user: "{{ debian_pc_user }}" become_user: "{{ debian_pc_user }}"
environment: environment:

View File

@ -15,6 +15,7 @@ YOUTUBE_BACKUP_COOKIES_FROM_BROWSER=
YOUTUBE_BACKUP_FORMAT=bv*+ba/best YOUTUBE_BACKUP_FORMAT=bv*+ba/best
YOUTUBE_BACKUP_MERGE_FORMAT=mp4 YOUTUBE_BACKUP_MERGE_FORMAT=mp4
YOUTUBE_BACKUP_SUB_LANGS=all,-live_chat YOUTUBE_BACKUP_SUB_LANGS=all,-live_chat
YOUTUBE_BACKUP_JS_RUNTIMES=node
YOUTUBE_BACKUP_SLEEP_REQUESTS=1 YOUTUBE_BACKUP_SLEEP_REQUESTS=1
YOUTUBE_BACKUP_RATE_LIMIT= YOUTUBE_BACKUP_RATE_LIMIT=
YOUTUBE_BACKUP_EXTRA_ARGS= YOUTUBE_BACKUP_EXTRA_ARGS=

View File

@ -13,7 +13,10 @@ pipx install yt-dlp
``` ```
The Debian host bootstrap installs `yt-dlp`, `ffmpeg`, and `nodejs` for this The Debian host bootstrap installs `yt-dlp`, `ffmpeg`, and `nodejs` for this
helper. On another machine, install those tools before running the backup. helper. It installs yt-dlp with its default dependency group so the YouTube EJS
challenge scripts are available, and the backup script passes
`--js-runtimes node` by default. On another machine, install those tools before
running the backup.
## Configure ## Configure

View File

@ -22,6 +22,7 @@ FORMAT="${YOUTUBE_BACKUP_FORMAT:-bv*+ba/best}"
OUTPUT_TEMPLATE="${YOUTUBE_BACKUP_OUTPUT_TEMPLATE:-%(playlist_title)s/%(upload_date>%Y-%m-%d,release_date>%Y-%m-%d,epoch>%Y-%m-%d)s - %(title)s [%(id)s].%(ext)s}" OUTPUT_TEMPLATE="${YOUTUBE_BACKUP_OUTPUT_TEMPLATE:-%(playlist_title)s/%(upload_date>%Y-%m-%d,release_date>%Y-%m-%d,epoch>%Y-%m-%d)s - %(title)s [%(id)s].%(ext)s}"
SUB_LANGS="${YOUTUBE_BACKUP_SUB_LANGS:-all,-live_chat}" SUB_LANGS="${YOUTUBE_BACKUP_SUB_LANGS:-all,-live_chat}"
MERGE_FORMAT="${YOUTUBE_BACKUP_MERGE_FORMAT:-mp4}" MERGE_FORMAT="${YOUTUBE_BACKUP_MERGE_FORMAT:-mp4}"
JS_RUNTIMES="${YOUTUBE_BACKUP_JS_RUNTIMES:-node}"
RATE_LIMIT="${YOUTUBE_BACKUP_RATE_LIMIT:-}" RATE_LIMIT="${YOUTUBE_BACKUP_RATE_LIMIT:-}"
SLEEP_REQUESTS="${YOUTUBE_BACKUP_SLEEP_REQUESTS:-1}" SLEEP_REQUESTS="${YOUTUBE_BACKUP_SLEEP_REQUESTS:-1}"
EXTRA_ARGS="${YOUTUBE_BACKUP_EXTRA_ARGS:-}" EXTRA_ARGS="${YOUTUBE_BACKUP_EXTRA_ARGS:-}"
@ -73,6 +74,7 @@ args=(
--sub-langs "${SUB_LANGS}" --sub-langs "${SUB_LANGS}"
--embed-metadata --embed-metadata
--embed-thumbnail --embed-thumbnail
--js-runtimes "${JS_RUNTIMES}"
--sleep-requests "${SLEEP_REQUESTS}" --sleep-requests "${SLEEP_REQUESTS}"
) )