Package: deezer-downloader
Music Downloader 🎶 🎧 💃 🦄Featuresdownload 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-dlpKISS (keep it simple and stupid) front endMPD integration (use it on a Raspberry Pi!)simple REST apiproxy support (https/socks5)How to use itThere is a settings file template calledsettings.ini.example. You can specify the download directory withdownload_dir. Pressing the download button only downloads the song/album/playlist. If you setuse_mpd=Truein thesettings.inithe backend will connect to mpd (localhost:6600) and update the music database. Pressing the play button will download the music. Ifuse_mpd=Trueis set the mpd database will be updated and the song/album/playlist will be added to the playlist. Insettings.inimusic_dirshould be the music root location of mpd. Thedownload_dirmust be a subdirectory ofmusic_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 thesettings.ini. The relevant cookie is thearlcookie.How to use itwith pipYou can runpip install --user deezer-downloader. Then you can run~/.local/bin/deezer-downloader --helpwith DockerYou can use the Docker image hosted onhub.docker.com. Login into your free Deezer account and grab thearlcookie. Then:mkdirdownloads
sudodockerrun-p5000:5000--volume$(pwd)/downloads/:/mnt/deezer-downloader--envDEEZER_COOKIE_ARL=changemekmille2/deezer-downloader:latestxdg-openhttp://localhost:5000with Vagrantvagrantup
vagrantssh
sudovim/opt/deezer/settings.ini# insert your Deezer cookiecd/opt/deezer&&sudopoetryrundeezer-downloader--configsettings.ini# On the host:xdg-openhttp://localhost:5000# view frontend in the browserncmpcpp-h127.0.0.1# try the mpd clientas a serviceWe use it with nginx andympdas mpd frontend/ goes to ympd/d/ goes to the downloaderThe deployment directory contains a systemd unit file and a nginx vhost config file. There is also apatchto add a link to the ympd frontend. Thedebugtab will show you the debug output of the app.ShortcutsIf you want to debug or build it from source: there is a docker-compose file in the docker directory. Thedocker/downloadsdirectory is mounted into the container and will be used as download directory. You have to check the permissions of thedocker/downloadsdirectory as docker mounts it with the same owner/group/permissions as on the host. Thedeezeruser 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 updeveloper setup (tested on Ubuntu Jammy)sudoapt-getupdate-qsudoapt-getinstall-qyvimtmuxgitffmpeg# python3-poetry is too old (does not support groups ...)sudoapt-getinstall-qypython3-pipsudopipinstallpoetrygitclonehttps://github.com/kmille/deezer-downloader.gitcddeezer-downloaderpoetryinstallpoetryrundeezer-downloader--show-config-template>settings.ini# enable yt-dlpsudopipinstallyt-dlpsed-i's,.*command = /usr/bin/yt-dlp.*,command = /usr/local/bin/yt-dlp,'settings.ini# enable mpdsudoapt-getinstall-yqmpdncmpcppsudosed-i's,^music_directory.*,music_directory         "/tmp/deezer-downloader",'/etc/mpd.confsudosystemctlrestartmpdsed-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-downloaderctrl-m: focus search barEnter: serach for songsAlt+Enter: search for albumsctrl-b: go to / (this is where our ympd is)ctrl-shift-[1-7] switch tabsSome screenshotsSearch 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-dlDownload a Spotify playlist.Download a Deezer playlist.ncmpcpp mpd client.Testscddeezer-downloaderDEEZER_DOWNLOADER_CONFIG_FILE=settings.inipoetryrunpytest-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)ChangelogVersion 2.0.0 (27.03.2023)use poetry as build systembuild package and uploada to pypiworker threads now "daemon threads" (they now just stop if you stop deezer-downloader)update config template (remove http.debug)update dependenciesswitch to waitress (from gunicorn)Version 1.3.3 (27.12.2021)replace youtube-dl by yt-dlupdate third party dependenciesVersion 1.3.2 (26.11.2021)fix broken deezer download functionality (#66, removes the ability to download flac quality)update third party dependenciesupdate ubuntu base image for the docker containerVersion 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 songsautomated tests with Github Actionspush Docker image tohub.docker.comwith Github ActionsVersion 1.2 (01.11.2020)breaking change:now use thearlcookie instead of thesidcookie. This cookie does not expire so we don't need the background thread that keeps the session aliveadd support for flac as download formatVersion 1.1 (13.05.2020)thanks toluelistafor the contribution!play 30 second preview in browseradd Vagrantfileshow album cover in search resultsuse a threaded queue for download taskslist album songs