thejasonparker Posted May 9, 2020 Share Posted May 9, 2020 (edited) After completing my Lidarr setup using the 'binhex lidarr' docker I noticed that most music files listed these days are in the FLAC format. Being old school and still using a iPod Video 5th Gen I wanted my collections to be in MP3 format so wanted a way to automatically convert these. I searched through the Lidarr GitHub and the unraid forums here and couldn't find a solution but did come across a Lidarr docker container which had the functionality via a shell script. https://hub.docker.com/r/thecaptain989/lidarr As I'd already setup Lidarr I wondered if it was possible to edit my docker container and apply the scripts from the above container. To my surprise the short answer is YES If this is something you want to do here's a short tutorial on how I did it... First, you ned to get access to your Lidarr Docker container. To do this I simply followed spaceinvaderone's YouTube tutorial - How to easily bash into a running docker container (NOTE: I had to use 'bash docker-shell' to run the command) Now I had access to the Lidarr container I needed to check to see of the two dependices 'ffmpeg' and 'awk' needed to run the 'flac2mp3.sh' script were already installed. This I did by just trying to run them and to my surprise both were already in the 'binhex-lidarr' container. ffmpeg awk The next stage was to get to the correct place to download and run the scripts from... cd /usr/local/bin/ Download the scripts from the GitHub repo.. curl -O https://raw.githubusercontent.com/TheCaptain989/lidarr-flac2mp3/7fda34528327e907cf583385c68260512ffb4ba3/flac2mp3.sh curl -O https://raw.githubusercontent.com/TheCaptain989/lidarr-flac2mp3/7fda34528327e907cf583385c68260512ffb4ba3/flac2mp3-debug.sh Make them executable... chmod +x flac2mp3.sh chmod +x flac2mp3-debug.sh Now, if you're happy to have 320Kbps MP3 conversions you can ignore this next section. The default output is 320kbps but if you want to change this because you have a large collection and file size is an important consideration (compare mp3 file sizes here https://audio-rescue.com/file-size/) you can do this by creating a 'wrapper' script which will send arguments to the 'flac2mp3.sh' script First, you'll need to create a new wrapper script so copy the debug script. Copy the 'flac2mp3-debug.sh' file cp flac2mp3-debug.sh flac2mp3-options.sh Edit it in nano nano flac2mp3-options.sh You can remove the 'debug logging' argument -d and add -b with your desired bitrate at the end like below and then save the file. #!/bin/bash . /usr/local/bin/flac2mp3.sh -b 190k You should be done with the terminal now Login to your unread server and go to your Lidarr Docker WebUI and go to 'Settings > Connect'. Create a 'Custom Script' trigger by selecting the + and then 'Custom Script'. Name it something like 'FLAC to MP3' and select 'On Release Import' and 'On Upgrade' as the only notification triggers (these have been tested). In the path find the script you just setup either the default script '/usr/local/bin/flac2mp3.sh' or your wrapper script. Click test to check and if all is good click save and you're done. Now when you download any Flac files once they have been downloaded and moved to your Lidarr directory they will be converted into mp3's You can see this happening if you open the directories as they are being processed. Huge thanks go to thecaptain989 who had done most of the work and @SpaceInvaderOne for the help on editing the doacker container files. Edited April 3, 2021 by thejasonparker Updated GitHub urls 1 Quote Link to comment
JonathanM Posted May 9, 2020 Share Posted May 9, 2020 Something that may be of interest to you. I've never tried to set it up, but in principle it sounds like what you wanted to accomplish without losing the quality of the original lossless files. https://khenriks.github.io/mp3fs/ 1 Quote Link to comment
thejasonparker Posted May 10, 2020 Author Share Posted May 10, 2020 Thanks for the info. It looks an interesting way of dealing with FLAC and MP3's files. Quote Link to comment
Frod Posted November 21, 2020 Share Posted November 21, 2020 Hi all I was having a heck of a time getting this to work, lidarr would keep spitting out error 255 when i went to test the conection. I did some digging and discovered that the link https://raw.githubusercontent.com/TheCaptain989/lidarr-flac2mp3/master/flac2mp3.sh simply downloads a file containing the words "error 404 not found" if you replace the above link with https://raw.githubusercontent.com/TheCaptain989/lidarr-flac2mp3/7fda34528327e907cf583385c68260512ffb4ba3/flac2mp3.sh you can get the script to work within Lidarr, it looks like TheCaptain989 has stopped supporting this script over at github, and the link i have provided is the one that was likey used when thejasonparker wrote this original post. I am very very very new to all of this linux buisness so im sure anyone who reads this could come up with a beter way of fixing this tutorial, but it worked for me :) Hope i helped Frod 1 Quote Link to comment
Kesp Posted December 1, 2020 Share Posted December 1, 2020 Any way this works already imported files? Quote Link to comment
thejasonparker Posted April 3, 2021 Author Share Posted April 3, 2021 On 11/21/2020 at 8:34 AM, Frod said: Hi all I was having a heck of a time getting this to work, lidarr would keep spitting out error 255 when i went to test the conection. I did some digging and discovered that the link https://raw.githubusercontent.com/TheCaptain989/lidarr-flac2mp3/master/flac2mp3.sh simply downloads a file containing the words "error 404 not found" if you replace the above link with https://raw.githubusercontent.com/TheCaptain989/lidarr-flac2mp3/7fda34528327e907cf583385c68260512ffb4ba3/flac2mp3.sh you can get the script to work within Lidarr, it looks like TheCaptain989 has stopped supporting this script over at github, and the link i have provided is the one that was likey used when thejasonparker wrote this original post. I am very very very new to all of this linux buisness so im sure anyone who reads this could come up with a beter way of fixing this tutorial, but it worked for me Hope i helped Frod I've updated the guide with the new urls thanks to @Frod Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.