initial commit

This commit is contained in:
Grizouille
2025-11-06 22:42:49 +01:00
parent 72dfd1e21e
commit 6399ab4af2
50 changed files with 4044 additions and 233 deletions

45
deployment/Vagrantfile vendored Normal file
View File

@@ -0,0 +1,45 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/jammy64"
config.vm.box_check_update = false
config.vm.network "forwarded_port", guest: 5000, host: 5000, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 6600, host: 6600, host_ip: "127.0.0.1"
config.vm.provider "virtualbox" do |vb|
vb.gui = false
vb.memory = "512"
end
config.vm.provision "shell", inline: <<-SHELL
apt-get update -q
apt-get install -qy vim tmux git ffmpeg
# python3-poetry is too old (does not support groups ...)
apt-get install -qy python3-pip
pip install poetry
git clone https://github.com/kmille/deezer-downloader.git /opt/deezer
cd /opt/deezer
poetry install
poetry run deezer-downloader --show-config-template > /opt/deezer/settings.ini
# enable yt-dlp
pip install yt-dlp
sed -i 's,.*command = /usr/bin/yt-dlp.*,command = /usr/local/bin/yt-dlp,' /opt/deezer/settings.ini
# enable mpd
apt-get install -yq mpd ncmpcpp
sed -i 's/^bind_to_address.*"localhost"/bind_to_address "0.0.0.0"/' /etc/mpd.conf
sed -i 's,^music_directory.*,music_directory "/tmp/deezer-downloader",' /etc/mpd.conf
systemctl restart mpd
sed -i 's/.*use_mpd = False.*/use_mpd = True/' /opt/deezer/settings.ini
sed -i 's/.*host = 127.0.0.1.*/host = 0.0.0.0/' /opt/deezer/settings.ini
echo "1) Adjust the Deezer cookie: sudo vim /opt/deezer/settings.ini" >> /etc/motd
echo "2) Run it: cd /opt/deezer && sudo poetry run deezer-downloader --config settings.ini" >> /etc/motd
echo "3) Try out: ncmpcpp -h 127.0.0.1 (you won't hear anything because you are in a vm. But you can use it on a Rasberry Pi)" >> /etc/motd
echo "4) Downloaded files are in /tmp/deezer-downloader" >> /etc/motd
SHELL
end

13
deployment/deezer.service Normal file
View File

@@ -0,0 +1,13 @@
[Unit]
Description = Deezer downloader
After = network.target
[Service]
Environment=PYTHONUNBUFFERED=TRUE
User = deezer
Group = deezer
ExecStart=/home/deezer/.local/bin/deezer-downloader -c /home/deezer/.deezer-downloader.ini
PrivateTmp = false
[Install]
WantedBy = multi-user.target

View File

@@ -0,0 +1 @@
../../Dockerfile

View File

@@ -0,0 +1 @@
The Dockerfile uses `COPY . /app`. So the Dockerfile needs to be placed in the root directory of the project.

View File

@@ -0,0 +1,14 @@
---
services:
deezer-downloader:
build: ../../
environment:
- DEEZER_COOKIE_ARL=changeme
volumes:
- ./downloads:/mnt/deezer-downloader
ports:
- "5000:5000"
security_opt:
- no-new-privileges
cap_drop:
- ALL

View File

View File

@@ -0,0 +1,27 @@
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
# forward for ympd
location / {
proxy_pass http://localhost:8080/;
}
# forward to deezer-downloader
location /d/ {
rewrite /d/(.*) /$1 break;
proxy_pass http://localhost:8081/;
}
# used by flask_autoindex
location /__autoindex__/ {
proxy_pass http://localhost:8081/__autoindex__/;
}
# used by flask_autoindex
location /__icons__/ {
proxy_pass http://localhost:8081/__icons__/;
}
}