This is an old revision of the document!
Prev to: Radarr: the movies organizer
Next to: Sonarr: the TV shows organizer
Lidarr the music organizer
Lidarr is part of the Servarr suite: it allows to automatically organize, search and download music.
You will need Lidarr if you plan to organize and enrich your music collection. As a bonus point, i will show you how to use DeeMon to fetch low-quality MP3 from Deezer to start filling your collection while Lidarr will improve it over time with FLAC quality.
Installation
Lidarr is easily installed and managed within Gentoo linux since there is an ebuild for it. All you need to do is unmask it (at the time of writing this it's are masked for AMD64 at least):
> echo www-apps/lidarr ~amd64 >> /etc/portage/package.accept_keywords/lidarr
then install it:
> emerge -v lidarr
This step will create a dedicated lidarr user but you will want to add it to the group media, that you have created before, so that the it will be able to access and manage your media collection:
> usermod -a -G media lidarr
Also, you want to move Lidarr home folder under /data/daemons/lidarr for consistency and to be protected on the RAID array, so:
> usermod -m -d /data/daemons/lidarr lidarr
Reverse-Proxy configuration
Before you proceed, you should make Lidarr accessible via the reverse-proxy, so that access, configuration and usage will be simplified from the beginning. Add this file to /etc/nginx/folders:
- lidarr.conf
# Lidarr - Music location ^~ /lidarr { proxy_pass http://127.0.0.1:8686; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_redirect off; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $http_connection; } # Allow the API External Access via NGINX location ~ /lidarr/api { auth_basic off; proxy_pass http://127.0.0.1:8686; }
Add this to your /etc/nginx/folders/main.conf:
include "folders/lidarr.conf";
and restart nginx:
> /etc/init.d/nginx restart
Startup
There are some configuration that must be perform before actually starting the service. You need to briefly start and stop it to let it create the main configuration file, this is required because you need to generate a new API key:
> /etc/init.d/lidarr start > /etc/init.d/lidarr stop
Now edit the newly created xml config file /data/daemons/lidarr/.config/Lidarr and edit the UrlBase to match the reverse-proxy setup. Only change the following lines in the file, do not edit anything else (unless you know what you are doing):
<UrlBase>lidarr</UrlBase> <BindAddress>127.0.0.1</BindAddress> <AuthenticationMethod>Forms</AuthenticationMethod> <AuthenticationRequired>DisabledForLocalAddresses</AuthenticationRequired>
Add Radarr to default runlevel, for autostart on reboot, and start it manually now:
> rc-update add lidarr default > /etc/init.d/lidarr start
Lidarr will now be accessible as http://192.168.0.1/lidarr.
All set! Lidarr is running.
Prowlarr link
In order for Lidarr to benefit from Prowlarr automatic indexers management you need to open http://192.168.0.1/prowlarr in your browser, go to settings → apps and add Lidarr. From the popup window set:
- Lidar server: http://localhost:8686/lidarr
- API Key: grab it from Lidarr settings → general page and paste it here
Then go to the Prowlarr indexers page and click on the synchronize all indexers icon.
Usage
Before you can actually use Lidarr you need to perform some initial setup in settings → media management:
- Add a new Root Folder. Use /data/Music as root folder.
Now enable “advanced settings” and:
- Thick “Set permissions” to on
- Set “chmod folder” to 775 (umask will be 0002)
- set “chmod Group” to “media”
- save and restart the daemon (from the user icon on top-right corner)
you can fine tune and configure many other aspects of Lidarr as you wish. A very common guide is The TRaSH Guides.
Please note that you will not yet be able to use Lidarr fully as you have not yet installed any downloader.
DeeMon
Lidarr is nice and good, but there is a very fast and practical way to start populating your music collection quickly, which is download 128Kb/sec MP3 files from a free Deezer account. Please note to carefully read and follow Deezer user agreement before doing so because i am NOT responsible for you violating it. Also, it seems that with a premium account you can also download high-res MP3 or even FLAC files.
DeeMon is a nice command-line tool that connects to your Deezer account and is able to easily fetch any music from it. Of course, if you want FLAC or 320kbps MP3 files you also need a non-free account. Please read carefully their license agreement and abide to it! There might be restrictions to fetching music and i am not responsible for DeeMon usage or such abuses to Deezer, if any.
In my experience, find music can be hard on the other ways, so this the best workaround i could come up with. I like that there is no need for another daemon, a Docker image or some other over complicated solution. DeeMon uses DeeMix internally to access your own Dezeer account and get the authors, albums or tracks you want. It's simple, it's easy, it's command-line based, and then Lidarr can easily pick it up from there and upgrade the tracks to FLAC when it finds them on you other indexers, but menwhile you can quickly fill up your collection in a breeze. At this time i still haven't found a simple way to force Lidarr to import the tracks immediately or automatically, you still need to login on Lidarr web GUI and trigger an unmapped files import manually. But Jellyfin will pick the tracks up automatically without the need to do any manual steps, so there is that.
DeeMon can do much more, check the online documentation, like monitoring artists and automatically download new releases and so on.
We need to install manually DeeMon since it's not packaged for Gentoo, but it's really very easy. So let's get started by creating a deemon user, we make it's default group the media group, so that any downloaded file will be created belonging to it for ease of access and management of the other apps:
> useradd -d /data/daemons/deemon -m deemon -g media
as usual, we put it in the daemons folder for consistency. Let's install DeeMon itself, as deemon user (do NOT do this as root!). To do this, we need to enable pip install on Gentoo, which is disabled system-wide to avoid breakages. To do this create this file as /data/daemons/deemon/.config/pip/pip.conf:
[global] break-system-packages = true user = true
and we also need to add the local bin folder to the path, so edit /data/daemons/deemon/.bashrc and add the the very end, and since we are editing this file, we also change DeeMon default umask so that any files downloaded will be writable to the media group:
export PATH=$PATH:/opt/deemon/.local/bin umask 0002
then we can proceed to the actual installation:
> su - deemon > pip install deemon > deemon refresh
Running the refresh command is required to have DeeMon autogenerate empty configuration files that we now need to edit.
In order for DeeMon to work it requires the arl cookie from Deezer. Login to Deezer web site from your browser, open the developer console, locate the cookies and copy the string associated to the arl cookie. You can find plenty of guides on the net on how to do so, i will not explain it here now. Then edit the file /data/daemons/deemon/.config/deemon/config.json and paste the string here.
In the same config file, locate the “download_path” under “global” and make it point to the media music folder (/data/Music) because we want DeeMon to put all donwloaded files straight into your Jellyfin collection. In order for Lidarr to properly (and with less fuss) detect and import all the albums and tracks we should at this point edit the DeeMix preferences because by default the downloaded tracks will have a slightly different naming scheme than Lidarr. Now, you could also change Lidarr naming scheme if you prefer, but i think it's more reasonable to fix DeeMix because Lidarr defaults just works for Jellyfin. To do so, edit the file /data/daemons/deemon/.config/deemix/config.json (note, this is DeeMix, not DeeMon config file). We will need to adjust a few lines, the following seems to be working fine for me:
"tracknameTemplate": "%artist% - %title%", "albumTracknameTemplate": "%artist% - %album% - %tracknumber% - %title%", "playlistTracknameTemplate": "%position% - %artist% - %title%", "artistNameTemplate": "%artist%", "albumNameTemplate": "%album% (%year%)",
(note that i have copied only the relevant lines, do not modify the others unless you know what you want to do)
This is actually all… To use it, just type:
> deemon download some_thing
where some_thing is an artist or an album or a Dezeer ID…. and it will directly be downloaded inside your music library for JellyFin to enjoy!
As you can see DeeMon is not really integrated with Lidarr. All you do is actually download music in the same music collection as Lidarr. If you want to allow Lidarr to automatically upgrade your music quality, head to Lidarr GUI and, using the “unmapped files” add the newly downloaded ones to the collection.
Now, head on to install the other services…
Next to: Sonarr: the TV shows organizer
Prev to: Radarr: the movies organizer