• Stars
    star
    553
  • Rank 80,462 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created about 6 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Download music from Deezer with a nice front end

Music Downloader 🎶 🎧 💃 🦄

tests push image to dockerhub docker pulls latest tag Python 3.6 pypi-version pypi-downloads

Features

  • download songs, albums, public playlists from Deezer.com (account is required, free plan is enough)
  • download Spotify playlists (by parsing the Spotify website and download the songs from Deezer)
  • download as zip file (including m3u8 playlist file)
  • 320 kbit/s mp3s with ID3-Tags and album cover (UPDATE: right now only 128bkit/s mp3 works, see #66)
  • download songs via yt-dlp
  • KISS (keep it simple and stupid) front end
  • MPD integration (use it on a Raspberry Pi!)
  • simple REST api
  • proxy support (https/socks5)

How to use it

There is a settings file template called settings.ini.example. You can specify the download directory with download_dir. Pressing the download button only downloads the song/album/playlist. If you set use_mpd=True in the settings.ini the backend will connect to mpd (localhost:6600) and update the music database. Pressing the play button will download the music. If use_mpd=True is set the mpd database will be updated and the song/album/playlist will be added to the playlist. In settings.ini music_dir should be the music root location of mpd. The download_dir must be a subdirectory of music_dir.

As Deezer sometimes requires a captcha to login the auto login features was removed. Instead you have to manually insert a valid Deezer cookie to the settings.ini. The relevant cookie is the arl cookie.

How to use it

with pip

You can run pip install --user deezer-downloader. Then you can run ~/.local/bin/deezer-downloader --help

with Docker

You can use the Docker image hosted on hub.docker.com. Login into your free Deezer account and grab the arl cookie. Then:

mkdir downloads
sudo docker run -p 5000:5000 --volume $(pwd)/downloads/:/mnt/deezer-downloader --env DEEZER_COOKIE_ARL=changeme kmille2/deezer-downloader:latest 
xdg-open http://localhost:5000

with Vagrant

vagrant up
vagrant ssh
sudo vim /opt/deezer/settings.ini # insert your Deezer cookie
cd /opt/deezer && sudo poetry run deezer-downloader --config settings.ini

# On the host:
xdg-open http://localhost:5000 # view frontend in the browser
ncmpcpp -h 127.0.0.1 # try the mpd client

as a service

We use it with nginx and ympd as mpd frontend

  • / goes to ympd
  • /d/ goes to the downloader

The deployment directory contains a systemd unit file and a nginx vhost config file. There is also a patch to add a link to the ympd frontend. The debug tab will show you the debug output of the app.Shortcuts

If you want to debug or build it from source: there is a docker-compose file in the docker directory. The docker/downloads directory is mounted into the container and will be used as download directory. You have to check the permissions of the docker/downloads directory as docker mounts it with the same owner/group/permissions as on the host. The deezer user in the docker container has uid 1000. If you also have the uid 1000 then there should be no problem. For debugging: sudo docker-compose build --force-rm && sudo docker-compose up

developer setup (tested on Ubuntu Jammy)

  sudo apt-get update -q
  sudo apt-get install -qy vim tmux git ffmpeg

  # python3-poetry is too old (does not support groups ...)
  sudo apt-get install -qy python3-pip
  sudo pip install poetry
  git clone https://github.com/kmille/deezer-downloader.git
  cd deezer-downloader
  poetry install
  poetry run deezer-downloader --show-config-template > settings.ini

  # enable yt-dlp
  sudo pip install yt-dlp
  sed -i 's,.*command = /usr/bin/yt-dlp.*,command = /usr/local/bin/yt-dlp,' settings.ini

  # enable mpd
  sudo apt-get install -yq mpd ncmpcpp
  sudo sed -i 's,^music_directory.*,music_directory         "/tmp/deezer-downloader",' /etc/mpd.conf
  sudo systemctl restart mpd
  sed -i 's/.*use_mpd = False.*/use_mpd = True/' settings.ini

  # 1) Adjust the Deezer cookie: vim settings.ini
  # 2) Run tests: DEEZER_DOWNLOADER_CONFIG_FILE=settings.ini poetry run pytest -v -s
  # 3) Run it: poetry run deezer-downloader --config settings.ini
  # 4) Try out: ncmpcpp -h 127.0.0.1 && xdg-open http://localhost:5000
  # 5) Downloaded files are in /tmp/deezer-downloader

ctrl-m: focus search bar
Enter: serach for songs
Alt+Enter: search for albums
ctrl-b: go to / (this is where our ympd is)
ctrl-shift-[1-7] switch tabs

Some screenshots

Search for songs. You can listen to a 30 second preview in the browser.

Search for albums. You can download them as zip file.

List songs of an album.

Download songs with youtube-dl

Download a Spotify playlist.

Download a Deezer playlist.

ncmpcpp mpd client.

Tests

cd deezer-downloader
DEEZER_DOWNLOADER_CONFIG_FILE=settings.ini poetry run pytest -v -s
# if you don't setDEEZER_DOWNLOADER_CONFIG_FILE the default template file will be used. Some tests will fail because there is no valid arl_cookie.

Deployment with Ansible (including mpd and ympd)

https://github.com/kmille/music-ansible (almost always outdated)

Changelog

Version 2.0.0 (27.03.2023)

  • use poetry as build system
  • build package and uploada to pypi
  • worker threads now "daemon threads" (they now just stop if you stop deezer-downloader)
  • update config template (remove http.debug)
  • update dependencies
  • switch to waitress (from gunicorn)

Version 1.3.3 (27.12.2021)

  • replace youtube-dl by yt-dl
  • update third party dependencies

Version 1.3.2 (26.11.2021)

  • fix broken deezer download functionality (#66, removes the ability to download flac quality)
  • update third party dependencies
  • update ubuntu base image for the docker container

Version 1.3.1 (21.01.2021)

  • allow to set download quality (flac|mp3) via environment variable DEEZER_FLAC_QUALITY (#43)

Version 1.3 (05.11.2020)

  • feature: download your favorite Deezer songs
  • automated tests with Github Actions
  • push Docker image to hub.docker.com with Github Actions

Version 1.2 (01.11.2020)

  • breaking change: now use the arl cookie instead of the sid cookie. This cookie does not expire so we don't need the background thread that keeps the session alive
  • add support for flac as download format

Version 1.1 (13.05.2020)

  • thanks to luelista for the contribution!
  • play 30 second preview in browser
  • add Vagrantfile
  • show album cover in search results
  • use a threaded queue for download tasks
  • list album songs

More Repositories

1

freetar

freetar - an alternative frontend for ultimate-guitar.com
HTML
588
star
2

dkim-verify

Verifying a DKIM-Signature by hand
Python
93
star
3

linux-debugging

Cheat Sheet for Linux (Network Debugging, Performance Analysis)
84
star
4

pentest-wiki

pwnig all the (web)things
PHP
19
star
5

PlainSSL

Hooking calls to libssl (openssl) to decrypt ssl traffic
C
13
star
6

riseup-vpn-configurator

a simple command line tool to get RiseupVPN up and running
Python
12
star
7

smtp_exporter

Prometheus exporter - monitoring for your mail server
Go
11
star
8

Ist-die-Mate-im-Angebot

Checks REWE and Tegut Angebot for Mate
Python
8
star
9

aldi-talk-parser

Parser for the MEIN ALDI-TALK website to get the history of internet volume consumption
Python
4
star
10

linux-accept-queue

Linux Networking: How does the Accept Queue work?
Shell
4
star
11

signal-account-switcher

a simple tool to run multiple instances of signal-desktop for Linux, Mac and Windows
Go
3
star
12

cda-garbage

sends you an IRC notification if the garbage will be fetched tomorrow
Python
2
star
13

kmille-meta

Overview of my repos/what I do
Python
2
star
14

webprogrammierung-mit-flask

einfache python backends schreiben mit python (Jugend hackt)
Python
2
star
15

evil-maid-attack-on-encrypted-boot

PoC: Implementing evil maid attack on encrypted /boot
Python
2
star
16

cloud-backup

Simple distributed automated tested free cloud backup with rclone and borg (aka: put your borg backups in da cloud)
Python
2
star
17

music-ansible

Deploy the deezer-downloader with ansible
2
star
18

unix-socket-proxy

Looking into UNIX domains socket traffic (e. g. docker)
Python
2
star
19

lalala

simple crawler for http://usdb.animux.de
Python
2
star
20

gitpin

gitpin - ssl certificate pinning for git
Go
2
star
21

docker-dbdump

docker-dbdump – simple script to dump DB container
Python
2
star
22

make-the-internet-usable

some Tampermonkey scripts
1
star
23

IRCme

Simple IRC Notification framework for regular tasks
Python
1
star
24

blind-sql-injection-playground

library for exploiting blind SQL injections with xpath (MySQL + sqlite3)
Python
1
star
25

learning-go

Go
1
star
26

blinkist-downloader

Download blinks from Blinkest.com as mp3
Python
1
star
27

ingdiba-api

Playing around with the ING DiBa Showcase API (https://developer.ing.com/openbanking/)
Python
1
star
28

nfs-systemd-ha

vagrant test environment for disaster recover: nfs server comes up after nfs client
1
star
29

notp

Playing around with one-time-passwords (and yubikey NEO)
Python
1
star
30

borgctl

borgctl - borgbackup without bash scripts
Python
1
star
31

flixcal

generate an ics file for your flixtrain/flixbus ride using you browser cookies
Python
1
star