commit 58969880a99e4e6bf6e74b6fcd1a1bc7e8e78114 Author: Zoli Date: Sat May 2 10:09:01 2026 +0200 first commit diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bf8571c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM alpine:3.22.4 +USER root +RUN apk upgrade --no-cache +RUN apk add --no-cache ffmpeg mutagen curl +RUN curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /yt-dlp +RUN chmod a+rx /yt-dlp +COPY . . +RUN mkdir /download +RUN mkdir /music +RUN chmod +x download.sh +CMD ["sh", "./download.sh"] diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..f81c527 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,17 @@ +services: + yt-downloader: + build: . + image: yt-downloader + container_name: yt-downloader + volumes: + - ./error:/error + - ./yt-downloader/:/music + restart: "unless-stopped" + environment: + PLAYLIST_URL: "https://www.youtube.com/playlist?list=PL4QRSQmrCreF3dSp3RokdWmS50o0QNesJ" + FILE_NAME_FORMAT: "%(title)s;%(uploader)s" + #deploy: + #resources: + #limits: + #cpus: '0.005' + #memory: 1000M diff --git a/download.sh b/download.sh new file mode 100644 index 0000000..aa1a7ba --- /dev/null +++ b/download.sh @@ -0,0 +1,7 @@ +#!/bin/bash +apt-get -y update +apt-get -y upgrade +cp /music/archive.dat /download +./yt-dlp -U +./yt-dlp -P "/download" --download-archive "/download/archive.dat" --sleep-interval 5 -x -o ${FILE_NAME_FORMAT} --add-metadata --embed-thumbnail --embed-chapters ${PLAYLIST_URL} 2> /error/error.log +cp /download/* /music