diff --git a/Docker/Dockerfile b/Docker/Dockerfile new file mode 100644 index 0000000..51d3bc4 --- /dev/null +++ b/Docker/Dockerfile @@ -0,0 +1,33 @@ +FROM ubuntu + +# installation +RUN apt update && apt upgrade -y +RUN apt install python -y +RUN apt install wget -y +RUN apt install lame -y +RUN apt install build-essential -y +RUN apt install libffi-dev -y +RUN apt install git -y +RUN apt install python-dev -y + +RUN wget https://bootstrap.pypa.io/get-pip.py && \ + python get-pip.py + +RUN wget https://github.com/mopidy/libspotify-archive/raw/master/libspotify-12.1.51-Linux-x86_64-release.tar.gz && \ + tar xvf libspotify-12.1.51-Linux-x86_64-release.tar.gz && \ + cd libspotify-12.1.51-Linux-x86_64-release/ && \ + make install prefix=/usr/local + +RUN git clone https://github.com/hbashton/spotify-ripper.git && \ + cd spotify-ripper && \ + python setup.py install + +# configuration +ADD spotify_appkey.key /root/.spotify-ripper +ADD config.ini /root/.spotify-ripper/ + +# install processing script +ADD process_lists.py ./ + +# start downloading +ENTRYPOINT [ "python", "/process_lists.py" ] diff --git a/Docker/build&run.sh b/Docker/build&run.sh new file mode 100644 index 0000000..8575290 --- /dev/null +++ b/Docker/build&run.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +docker image build . -t spori:latest +docker container run -ti --privileged --mount type=bind,source="$(pwd)"/share,target=/root/.spotify-ripper/share spori:latest diff --git a/Docker/config.ini b/Docker/config.ini new file mode 100644 index 0000000..cec8fee --- /dev/null +++ b/Docker/config.ini @@ -0,0 +1,14 @@ +[main] +user = your email or username +password = your password +ascii = True +format = {album_artist}/{year} {album}/Disc 0{disc_idx}/0{track_idx} {track_name}.{ext} +directory = /root/.spotify-ripper/share/downloads +quality = 320 +bitrate = 320 +grouping = {label} +normalize = True +cbr = True +mp3 = True +last = False +partial_check = strict diff --git a/Docker/process_lists.py b/Docker/process_lists.py new file mode 100644 index 0000000..765461a --- /dev/null +++ b/Docker/process_lists.py @@ -0,0 +1,16 @@ +#!/bin/python2 + +import sys, os, subprocess + +lists_dir = "/root/.spotify-ripper/share/lists" +download_lists = [] + +for fname in os.listdir(lists_dir): + absolute_fname = os.path.join(lists_dir, fname) + if not os.path.isdir(absolute_fname) : + download_lists.append(fname) + +for curr_list in download_lists: + print("\n\n\n[ + ] P R O C E S S I N G C U R R E N T L I S T :{}\n\n\n".format(curr_list)) + subprocess.call('spotify-ripper {} && mv {} done/{}'.format(curr_list,curr_list,curr_list), shell=True, cwd=lists_dir) + diff --git a/Docker/spotify_appkey.key b/Docker/spotify_appkey.key new file mode 100644 index 0000000..4688806 Binary files /dev/null and b/Docker/spotify_appkey.key differ