commit 39f987fd3ef18bded43334836e0ade0e7f39759f
parent 8c2142a27974288dab4b9b155a79bc87248c7a0d
Author: Andreas Gruhler <andreas.gruhler@adfinis.com>
Date: Tue, 11 Apr 2023 23:52:13 +0200
feat(aload): use yt-dlp instead of youtube-dl
youtube-dl is no longer actively maintained and this fork has the same
functionality with slightly different behavior:
https://github.com/yt-dlp/yt-dlp#differences-in-default-behavior
Diffstat:
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/docker/docker-aload/Dockerfile b/docker/docker-aload/Dockerfile
@@ -8,7 +8,7 @@ RUN usermod -u 1000 apache
RUN groupmod -g 1000 apache
# install python dependencies
-RUN pip install --upgrade youtube-dl
+RUN pip install --upgrade yt-dlp
# prepare cgi directory with aload script
VOLUME /var/www/localhost/cgi-bin
diff --git a/docker/docker-aload/cgi-bin/aload b/docker/docker-aload/cgi-bin/aload
@@ -11,7 +11,7 @@ CONTENT_LENGTH=${CONTENT_LENGTH:-12}
DOCUMENT_ROOT=${DOCUMENT_ROOT:-}
# XDG_CACHE_HOME is /var/www by default for apache user
# which will produce PermissionError because this directory is owned by root
-# https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/cache.py
+# https://github.com/yt-dlp/yt-dlp#notes-about-environment-variables
export XDG_CACHE_HOME=${DOCUMENT_ROOT}
if [[ ! $CONTENT_LENGTH -eq 11 ]]; then
@@ -34,7 +34,7 @@ if [ "$REQUEST_METHOD" = "POST" ]; then
# exit 1
#fi
echo "Downloading video "${QUERY_STRING_POST}" ..."
- youtube-dl -o "${DOCUMENT_ROOT}/music/%(artist)s - %(title)s.%(ext)s" \
+ yt-dlp -o "${DOCUMENT_ROOT}/music/%(artist)s - %(title)s.%(ext)s" \
--extract-audio \
--add-metadata \
--audio-format mp3 \