spotify-dl/install.sh

38 lines
1.4 KiB
Bash
Raw Normal View History

2022-05-07 02:47:04 +02:00
#!/bin/bash
MP="`dirname \"$0\"`" # relative
MP="`( cd \"$MP\" && pwd )`" # absolutized and normalized
cd $MP
2022-08-15 00:08:03 +02:00
sudo apt install -y lame build-essential libffi-dev jq curl
wget -q -O - https://apt.mopidy.com/mopidy.gpg | sudo apt-key add - #add mopidy's libspotify repository
sudo wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/stretch.list #valid for Debian Stretch.
sudo apt update && sudo apt install libspotify12 libspotify-dev #install libspotify from mopidy's repository
2022-08-14 20:43:11 +02:00
if [[ ! $(which pyenv) ]]; then
2022-05-07 02:47:04 +02:00
echo "pyenv installation..."
curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
2022-05-08 00:14:13 +02:00
echo "export PYENV_ROOT=\"$HOME/.pyenv\"" >> $HOME/.bashrc
echo "command -v pyenv >/dev/null || export PATH=\"$PYENV_ROOT/bin:$PATH\"" >> $HOME/.bashrc
echo "eval \"$(pyenv init -)\"" >> $HOME/.bashrc
2022-05-07 02:47:04 +02:00
echo "Restat terminal and relaunch this install script"
exit 0
2022-08-14 20:43:11 +02:00
fi
2022-05-07 02:47:04 +02:00
2022-08-14 20:43:11 +02:00
if [[ ! $(which python) ]]; then
2022-05-07 02:47:04 +02:00
pyenv install 3.9.6
pyenv global 3.9.6
2022-05-08 00:14:13 +02:00
echo "Restat terminal and relaunch this install script again"
exit 0
2022-05-07 02:47:04 +02:00
fi
mkdir -p lib
2022-05-07 13:54:48 +02:00
[[ ! -f .env ]] && cp .env.template .env && chmod 600 .env
2022-05-07 02:47:04 +02:00
2022-05-08 00:14:13 +02:00
git clone https://github.com/migo1271/spotify-ripper.git lib/spotify-ripper && cd lib/spotify-ripper && sudo python setup.py install
2022-05-07 02:47:04 +02:00
pyenv rehash
2022-05-08 00:14:13 +02:00
## Source: https://github.com/migo1271/spotify-ripper