You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.9 KiB

# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config| = "ubuntu/focal64"
config.vm.box_check_update = false "forwarded_port", guest: 5000, host: 5000, host_ip: "" "forwarded_port", guest: 6600, host: 6600, host_ip: ""
config.vm.provider "virtualbox" do |vb|
vb.gui = false
vb.memory = "512"
config.vm.provision "shell", inline: <<-SHELL
apt-get update -q
apt-get install -qy vim tmux git gcc ffmpeg
apt-get install -qy python3-virtualenv python3-dev
git clone /opt/deezer
python3 -m virtualenv -p python3 /opt/deezer/app/venv
source /opt/deezer/app/venv/bin/activate && pip install -r /opt/deezer/requirements.txt && deactivate
source /opt/deezer/app/venv/bin/activate && pip install -U yt-dlp && deactivate
cp /opt/deezer/app/settings.ini.example /opt/deezer/app/settings.ini
sed -i 's/.*use_mpd = False.*/use_mpd = True/' /opt/deezer/app/settings.ini
sed -i 's/.*host =*/host =' /opt/deezer/app/settings.ini
sed -i 's,.*command = /usr/bin/yt-dlp.*,command = /opt/deezer/app/venv/bin/yt-dlp,' /opt/deezer/app/settings.ini
apt-get install -yq mpd ncmpcpp
sed -i 's/^bind_to_address.*"localhost"/bind_to_address ""/' /etc/mpd.conf
sed -i 's,^music_directory.*,music_directory "/tmp/deezer-downloader",' /etc/mpd.conf
systemctl restart mpd
echo "1) Adjust the Deezer Cookie in /opt/deezer/app/settings.ini" >> /etc/motd
echo "2) Run it: /opt/deezer/app/venv/bin/python /opt/deezer/app/" >> /etc/motd
echo "3) Try out: ncmpcpp -h (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