Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Support #63

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions Docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 && \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for providing a Dockerfile, however it fails.
Please tag a specific ubuntu version, maybe even an official image for python with PIP installed

 => ERROR [10/15] RUN wget https://bootstrap.pypa.io/get-pip.py &&     python get-pip.py                                                          0.8s
------
 > [10/15] RUN wget https://bootstrap.pypa.io/get-pip.py &&     python get-pip.py:
#14 0.399 --2021-03-26 22:44:16--  https://bootstrap.pypa.io/get-pip.py
#14 0.400 Resolving bootstrap.pypa.io (bootstrap.pypa.io)... 151.101.0.175, 151.101.64.175, 151.101.128.175, ...
#14 0.465 Connecting to bootstrap.pypa.io (bootstrap.pypa.io)|151.101.0.175|:443... connected.
#14 0.516 HTTP request sent, awaiting response... 200 OK
#14 0.532 Length: 1927630 (1.8M) [text/x-python]
#14 0.532 Saving to: 'get-pip.py'
#14 0.532
#14 0.532      0K .......... .......... .......... .......... ..........  2% 3.18M 1s
#14 0.547     50K .......... .......... .......... .......... ..........  5% 7.62M 0s
#14 0.554    100K .......... .......... .......... .......... ..........  7% 5.92M 0s
#14 0.562    150K .......... .......... .......... .......... .......... 10% 7.87M 0s
#14 0.569    200K .......... .......... .......... .......... .......... 13% 6.73M 0s
#14 0.576    250K .......... .......... .......... .......... .......... 15% 11.0M 0s
#14 0.580    300K .......... .......... .......... .......... .......... 18% 7.94M 0s
#14 0.586    350K .......... .......... .......... .......... .......... 21% 14.1M 0s
#14 0.590    400K .......... .......... .......... .......... .......... 23% 6.66M 0s
#14 0.597    450K .......... .......... .......... .......... .......... 26% 9.70M 0s
#14 0.602    500K .......... .......... .......... .......... .......... 29% 12.1M 0s
#14 0.606    550K .......... .......... .......... .......... .......... 31% 3.77M 0s
#14 0.619    600K .......... .......... .......... .......... .......... 34% 32.4M 0s
#14 0.621    650K .......... .......... .......... .......... .......... 37% 27.2M 0s
#14 0.622    700K .......... .......... .......... .......... .......... 39% 4.60M 0s
#14 0.633    750K .......... .......... .......... .......... .......... 42% 8.62M 0s
#14 0.639    800K .......... .......... .......... .......... .......... 45% 12.8M 0s
#14 0.643    850K .......... .......... .......... .......... .......... 47% 12.6M 0s
#14 0.646    900K .......... .......... .......... .......... .......... 50% 8.09M 0s
#14 0.652    950K .......... .......... .......... .......... .......... 53% 12.3M 0s
#14 0.656   1000K .......... .......... .......... .......... .......... 55% 10.8M 0s
#14 0.661   1050K .......... .......... .......... .......... .......... 58% 8.43M 0s
#14 0.667   1100K .......... .......... .......... .......... .......... 61% 12.4M 0s
#14 0.671   1150K .......... .......... .......... .......... .......... 63% 10.2M 0s
#14 0.675   1200K .......... .......... .......... .......... .......... 66% 14.4M 0s
#14 0.679   1250K .......... .......... .......... .......... .......... 69% 14.0M 0s
#14 0.683   1300K .......... .......... .......... .......... .......... 71% 11.7M 0s
#14 0.687   1350K .......... .......... .......... .......... .......... 74% 9.85M 0s
#14 0.691   1400K .......... .......... .......... .......... .......... 77% 16.2M 0s
#14 0.694   1450K .......... .......... .......... .......... .......... 79% 12.0M 0s
#14 0.698   1500K .......... .......... .......... .......... .......... 82% 15.6M 0s
#14 0.702   1550K .......... .......... .......... .......... .......... 84% 10.5M 0s
#14 0.706   1600K .......... .......... .......... .......... .......... 87% 14.1M 0s
#14 0.710   1650K .......... .......... .......... .......... .......... 90% 21.7M 0s
#14 0.712   1700K .......... .......... .......... .......... .......... 92% 11.8M 0s
#14 0.716   1750K .......... .......... .......... .......... .......... 95% 13.9M 0s
#14 0.720   1800K .......... .......... .......... .......... .......... 98% 9.18M 0s
#14 0.725   1850K .......... .......... .......... ..                   100% 16.3M=0.2s
#14 0.727
#14 0.727 2021-03-26 22:44:16 (9.44 MB/s) - 'get-pip.py' saved [1927630/1927630]
#14 0.727
#14 0.764 ERROR: This script does not work on Python 2.7 The minimum supported Python version is 3.6. Please use https://bootstrap.pypa.io/pip/2.7/get-pip.py instead.
------
executor failed running [/bin/sh -c wget https://bootstrap.pypa.io/get-pip.py &&     python get-pip.py]: exit code: 1

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" ]
4 changes: 4 additions & 0 deletions Docker/build&run.sh
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions Docker/config.ini
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions Docker/process_lists.py
Original file line number Diff line number Diff line change
@@ -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)

Binary file added Docker/spotify_appkey.key
Binary file not shown.