From 297c836fdd941871e524a092b8387b5811592227 Mon Sep 17 00:00:00 2001 From: poka Date: Sat, 7 May 2022 13:54:48 +0200 Subject: [PATCH] Change .login.auth to .env unique file --- .env.template | 8 +++++++- .gitignore | 3 +-- .login.auth.template | 3 --- README.md | 3 +-- install.sh | 3 +-- spotify-dl.sh | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) delete mode 100644 .login.auth.template diff --git a/.env.template b/.env.template index 1197e32..dc2e36a 100644 --- a/.env.template +++ b/.env.template @@ -1,2 +1,8 @@ -output="$HOME" +# Authentification +sp_id="" +sp_password="" +sp_token="" + +# Tracks format and location +output="$HOME/music" format="{artist} - {track_name}.{ext}" diff --git a/.gitignore b/.gitignore index 2dfc4e8..acc7008 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ -lib/* -.login.auth +lib/ .env diff --git a/.login.auth.template b/.login.auth.template deleted file mode 100644 index 5106656..0000000 --- a/.login.auth.template +++ /dev/null @@ -1,3 +0,0 @@ -sp_id="" -sp_password="" -sp_token="" diff --git a/README.md b/README.md index 72706b7..113b76e 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,7 @@ This is not a youtube scrapper. This is a real Spotify music downloader, to mp3 320kb/s 44100 Hz, no DRM, with good tags. -**You will need a premium account to Spotify and set your ids in `.login.auth` file.** -You should also edit `.env` file to configure your tracks output format and location. +**You will need a premium account to Spotify and set your ids in `.env` file,** and configure your tracks output format and custom location. If you want to use keywords search, you will also need a developer token, set to the same file (TODO: bypass this token). You can get this token here: https://developer.spotify.com/console/get-search-item/, but this one expire after one hour... diff --git a/install.sh b/install.sh index 4efde26..7bc3251 100755 --- a/install.sh +++ b/install.sh @@ -17,8 +17,7 @@ wget -q -O - https://apt.mopidy.com/mopidy.gpg | sudo apt-key add - #add mopidy' 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 python-spotify #install libspotify from mopidy's repository mkdir -p lib -[[ ! -f .login.auth ]] && cp .login.auth.template .login.auth && chmod 600 .login.auth -[[ ! -f .env ]] && cp .env.template .env +[[ ! -f .env ]] && cp .env.template .env && chmod 600 .env git clone https://github.com/lavolp3/spotify-ripper.git lib/spotify-ripper && cd lib/spotify-ripper && python setup.py install pyenv rehash diff --git a/spotify-dl.sh b/spotify-dl.sh index f4b32dc..dd10cab 100755 --- a/spotify-dl.sh +++ b/spotify-dl.sh @@ -1,8 +1,8 @@ #!/bin/bash [[ ! $1 ]] && echo "Please give a search" && exit 1 -source .login.auth source .env +mkdir -p "$output" track=$(echo "$@" | sed 's/ /%20/g ')