[DOCKER] Include Deno dependency, other fixes (#1345)

Closes
- Deno requirement: https://github.com/jmbannon/ytdl-sub/issues/1340
  - yt-dlp announcement: https://github.com/yt-dlp/yt-dlp/issues/14404
- Docker cron log double-logging: https://github.com/jmbannon/ytdl-sub/issues/1202 (thanks @timetocode for https://github.com/jmbannon/ytdl-sub/pull/1330 !)
- Missing pip dependency when updating yt-dlp: https://github.com/jmbannon/ytdl-sub/issues/1346
This commit is contained in:
Jesse Bannon 2025-09-27 16:43:34 -07:00 committed by GitHub
parent 609bec8aaf
commit 2deafc9f2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 35 additions and 21 deletions

View file

@ -18,7 +18,9 @@ RUN mkdir -pv "${DEFAULT_WORKSPACE}" && \
vim \
g++ \
nano \
unzip \
make \
deno \
libffi-dev \
"python3>=3.10" \
py3-pip \
@ -30,6 +32,7 @@ RUN mkdir -pv "${DEFAULT_WORKSPACE}" && \
"aria2>=1.36.0" && \
ffmpeg -version && \
aria2c --version && \
deno --version && \
# Install phantomjs if using x86_64, ensure it is properly installed
if [[ $(uname -m) == "x86_64" ]]; then \
echo "installing phantomjs" && \
@ -43,7 +46,6 @@ RUN mkdir -pv "${DEFAULT_WORKSPACE}" && \
phantomjs --version && \
cd -; \
fi && \
echo "hi" && \
# Install ytdl-sub, ensure it is installed properly
python3 -m pip install --break-system-packages --no-cache-dir ytdl_sub-*.whl && \
ytdl-sub -h && \
@ -52,8 +54,9 @@ RUN mkdir -pv "${DEFAULT_WORKSPACE}" && \
apk del \
g++ \
make \
libffi-dev \
py3-setuptools
libffi-dev && \
python3 -m pip --help
###############################################################################
# CONTAINER CONFIGS

View file

@ -23,6 +23,7 @@ RUN mkdir -p /config && \
vim \
g++ \
nano \
unzip \
make \
python3-pip \
fontconfig \
@ -61,8 +62,11 @@ RUN mkdir -p /config && \
echo "Phantom JS version:" && \
phantomjs --version ; \
fi && \
# Install Deno, required for YouTube downloads
curl -fsSL https://deno.land/install.sh | DENO_INSTALL=/usr/local sh -s -- -y --no-modify-path && \
deno --help && \
# Install ytdl-sub, ensure it is installed properly
pip install --no-cache-dir --break-system-packages ytdl_sub-*.whl && \
python3 -m pip install --no-cache-dir --break-system-packages ytdl_sub-*.whl && \
ytdl-sub -h && \
# Delete unneeded packages after install
rm ytdl_sub-*.whl && \
@ -70,11 +74,11 @@ RUN mkdir -p /config && \
g++ \
make \
xz-utils \
bzip2 \
python3-venv && \
bzip2 && \
apt-get autoremove -y && \
apt-get purge -y --auto-remove && \
rm -rf /var/lib/apt/lists/*
rm -rf /var/lib/apt/lists/* && \
python3 -m pip --help
###############################################################################
# CONTAINER CONFIGS

View file

@ -26,6 +26,7 @@ RUN mkdir -pv "${DEFAULT_WORKSPACE}" && \
vim \
g++ \
nano \
unzip \
make \
python3-pip \
fontconfig \
@ -64,8 +65,11 @@ RUN mkdir -pv "${DEFAULT_WORKSPACE}" && \
echo "Phantom JS version:" && \
phantomjs --version ; \
fi && \
# Install Deno, required for YouTube downloads
curl -fsSL https://deno.land/install.sh | DENO_INSTALL=/usr/local sh -s -- -y --no-modify-path && \
deno --help && \
# Install ytdl-sub, ensure it is installed properly
pip install --no-cache-dir --break-system-packages ytdl_sub-*.whl && \
python3 -m pip install --no-cache-dir --break-system-packages ytdl_sub-*.whl && \
ytdl-sub -h && \
# Delete unneeded packages after install
rm ytdl_sub-*.whl && \
@ -73,11 +77,11 @@ RUN mkdir -pv "${DEFAULT_WORKSPACE}" && \
g++ \
make \
xz-utils \
bzip2 \
python3-venv && \
bzip2 && \
apt-get autoremove -y && \
apt-get purge -y --auto-remove && \
rm -rf /var/lib/apt/lists/*
rm -rf /var/lib/apt/lists/* && \
python3 -m pip --help
###############################################################################
# CONTAINER CONFIGS

View file

@ -28,16 +28,16 @@ echo "" > "$LOGS_TO_STDOUT"
# https://github.com/yt-dlp/yt-dlp/wiki/Installation#with-pip
if [ "$UPDATE_YT_DLP_ON_START" == "stable" ] ; then
echo "UPDATE_YT_DLP_ON_START is set to stable, attempting to update to a new stable version of yt-dlp if it exists."
python3 -m pip install -U "yt-dlp[default]" --break-system-packages
python3 -m pip install -U "yt-dlp[default]" --break-system-packages --root-user-action=ignore
elif [ "$UPDATE_YT_DLP_ON_START" == "nightly" ] ; then
echo "UPDATE_YT_DLP_ON_START is set to nightly, attempting to update to the latest nightly version of yt-dlp."
python3 -m pip install -U --pre "yt-dlp[default]"
python3 -m pip install -U --pre "yt-dlp[default]" --root-user-action=ignore
elif [ "$UPDATE_YT_DLP_ON_START" == "master" ] ; then
echo "UPDATE_YT_DLP_ON_START is set to master, pulling yt-dlp's latest commit for install."
python3 -m pip install -U pip hatchling wheel
python3 -m pip install --force-reinstall "yt-dlp[default] @ https://github.com/yt-dlp/yt-dlp/archive/master.tar.gz"
python3 -m pip install -U pip hatchling wheel --root-user-action=ignore
python3 -m pip install --force-reinstall "yt-dlp[default] @ https://github.com/yt-dlp/yt-dlp/archive/master.tar.gz" --root-user-action=ignore
else
echo "UPDATE_YT_DLP_ON_START is not set, using packaged version."
echo "UPDATE_YT_DLP_ON_START is not set, using packaged version."
fi
# set up cron
@ -49,7 +49,7 @@ if [ "$CRON_SCHEDULE" != "" ] ; then
echo '#!/bin/bash' > "$CRON_WRAPPER_SCRIPT"
echo "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" >> "$CRON_WRAPPER_SCRIPT"
echo "cd \"$DEFAULT_WORKSPACE\"" >> "$CRON_WRAPPER_SCRIPT"
echo ". \"$CRON_SCRIPT\" | tee -a \"$LOGS_TO_STDOUT\"" >> "$CRON_WRAPPER_SCRIPT"
echo ". \"$CRON_SCRIPT\" >> \"$LOGS_TO_STDOUT\" 2>&1" >> "$CRON_WRAPPER_SCRIPT"
chmod +x "$CRON_WRAPPER_SCRIPT"
chown abc:abc "$CRON_WRAPPER_SCRIPT"

View file

@ -9,8 +9,9 @@ services:
PUID: "1000"
PGID: "1000"
TZ: "America/Los_Angeles"
CRON_SCHEDULE: '"*/1 * * * *"'
CRON_SCHEDULE: '*/1 * * * *'
CRON_RUN_ON_START: "true"
UPDATE_YT_DLP_ON_START: "stable"
volumes:
- "./volumes/ytdl-sub-gui/:/config/"
ports:
@ -19,14 +20,15 @@ services:
ytdl-sub-headless:
build:
context: "../"
image: "ytdl-sub-headless:local"
image: "ytdl-sub:local"
container_name: "ytdl-sub-headless"
environment:
PUID: "1000"
PGID: "1000"
TZ: "America/Los_Angeles"
CRON_SCHEDULE: '"*/1 * * * *"'
CRON_SCHEDULE: '*/1 * * * *'
CRON_RUN_ON_START: "true"
UPDATE_YT_DLP_ON_START: "stable"
volumes:
- "./volumes/ytdl-sub-headless/:/config/"
restart: "unless-stopped"
@ -40,8 +42,9 @@ services:
PUID: "1000"
PGID: "1000"
TZ: "America/Los_Angeles"
CRON_SCHEDULE: '"*/1 * * * *"'
CRON_SCHEDULE: '*/1 * * * *'
CRON_RUN_ON_START: "true"
UPDATE_YT_DLP_ON_START: "stable"
volumes:
- "./volumes/ytdl-sub-ubuntu/:/config/"
restart: "unless-stopped"