Code Monkey home page Code Monkey logo

lidarr-flac2mp3's Introduction

Development Repository

This is a development and test repo. Visit the production repository and branch for stable/production releases.

About

A Docker Mod for the LinuxServer.io Lidarr Docker container that uses ffmpeg and a script to automatically convert downloaded FLAC (or other format) files to MP3s. Default output quality is 320Kbps constant bit rate. Advanced options act as a light wrapper to ffmpeg, allowing conversion to any supported audio format, including AAC, AC3, Opus, and many others. A Batch Mode is also supported that allows usage outside of Lidarr.

NOTE: This mod supports Linux OSes only.

Production Container info: Docker Image Size
Development Container info: Docker Image Size Docker Pulls

Installation

  1. Pull the linuxserver/lidarr docker image from GitHub Container Registry or Docker Hub:
    docker pull lscr.io/linuxserver/lidarr:latest

  2. Configure the Docker container with all the port, volume, and environment settings from the original container documentation here:
    linuxserver/lidarr

    1. Add a DOCKER_MODS environment variable to your compose.yml file or docker run command, as follows:

      • Stable release: DOCKER_MODS=linuxserver/mods:lidarr-flac2mp3
      • Dev/test release: DOCKER_MODS=thecaptain989/lidarr-flac2mp3:latest

      Example Docker Compose YAML Configuration

      version: "2.1"
      services:
        lidarr:
          image: lscr.io/linuxserver/lidarr
          container_name: lidarr
          environment:
            - PUID=1000
            - PGID=1000
            - TZ=America/Chicago
            - DOCKER_MODS=linuxserver/mods:lidarr-flac2mp3
          volumes:
            - /path/to/appdata/config:/config
            - /path/to/music:/music
            - /path/to/downloads:/downloads
          ports:
            - 8686:8686
          restart: unless-stopped

      Example Docker Run Command

      docker run -d \
        --name=lidarr \
        -e PUID=1000 \
        -e PGID=1000 \
        -e TZ=America/Chicago \
        -e DOCKER_MODS=linuxserver/mods:lidarr-flac2mp3 \
        -p 8686:8686 \
        -v /path/to/appdata/config:/config \
        -v /path/to/music:/music \
        -v /path/to/downloads:/downloads \
        --restart unless-stopped \
        lscr.io/linuxserver/lidarr

      Example Synology Configuration
      flac2mp3

    2. Start the container.

  3. Configure a custom script from Lidarr's Settings > Connect screen and type the following in the Path field:
    /usr/local/bin/flac2mp3.sh

    Example
    lidarr-flac2mp3

    This will use the defaults to create a 320Kbps MP3 file.

    For any other setting, you must use one of the supported methods to pass arguments to the script. See the Syntax section below.

Usage

New file(s) will be placed in the same directory as the original FLAC file(s) (unless redirected with the --output option below) and have the same owner and permissions. Existing files with the same track name will be overwritten.

By default, if you've configured Lidarr's Recycle Bin path correctly, the original audio file will be moved there.
danger NOTE: If you have not configured the Recycle Bin, the original FLAC audio file(s) will be deleted and permanently lost. This behavior may be modified with the --keep-file option.

Syntax

Note: The Arguments field for Custom Scripts was removed in Lidarr release v0.7.0.1347 due to security concerns.

To supply arguments to the script, you must either use one of the included wrapper scripts, create a custom wrapper script, or set the FLAC2MP3_ARGS environment variable.

Command Line Options and Arguments

The script may be called with optional command line arguments.

The syntax for the command line is:
flac2mp3 [{-b|--bitrate} <bitrate> | {-v|--quality} <quality> | {-a|--advanced} "<options>" {-e|--extension} <extension>] [{-f|--file} <audio_file>] [{-k|--keep-file}] [{-o|--output} <directory>] [{-r|--regex} '<regex>'] [{-t|--tags} <taglist>] [{-l|--log} <log_file>] [{-d|--debug} [<level>]]

Where:

Option Argument Description
-b, --bitrate <bitrate> Sets the output quality in constant bits per second (CBR).
Examples: 160k, 240k, 300000
Note: May not be specified with -v, -a, or -e.
-v, --quality <quality> Sets the output variable bit rate (VBR).
Specify a value between 0 and 9, with 0 being the highest quality.
See the FFmpeg MP3 Encoding Guide for more details.
Note: May not be specified with -b, -a, or -e.
-a, --advanced "<options>" Advanced ffmpeg options.
The specified options replace all script defaults and are sent directly to ffmpeg.
The options value must be enclosed in quotes.
See FFmpeg Options for details on valid options, and Guidelines for high quality audio encoding for suggested usage.
Note: Requires the -e option to also be specified. May not be specified with -v or -b.
warning WARNING: You must specify an audio codec (by including a -c:a <codec> ffmpeg option) or the resulting file will contain no audio!
warning WARNING: Invalid options could result in script failure!
-e, --extension <extension> Sets the output file extension.
The extension may be prefixed by a dot (".") or not.
Example: .ogg
Note: Requires the -a option to also be specified. May not be specified with -v or -b.
-f, --file <audio_file> If included, the script enters Batch Mode and converts the specified audio file.
warning WARNING: Do not use this argument when called from Lidarr!
-o, --output <directory> Converted audio file(s) are saved to directory instead of being located in the same directory as the source audio file.
The path will be created if it does not exist.
-k, --keep-file Do not delete the source file or move it to the Lidarr Recycle bin.
Note: This also disables importing the new files into Lidarr after conversion.
-r, --regex '<regex>' Sets the regular expression used to select input files.
The regex value should be enclosed in single quotes and escaped properly.
Defaults to [.]flac$.
-l, --log <log_file> The log filename
Default of /config/log/flac2mp3.txt
-t, --tags <taglist> Comma separated list of metadata tags to apply automated corrections to.
See Metadata Corrections section.
-d, --debug [<level>] Enables debug logging. Level is optional.
Default of 1 (low).
2 includes JSON and FFmpeg output.
3 contains even more JSON output.
--help Display help and exit.
--version Display version and exit.

If neither -b, -v, -a, or -e options are specified, the script will default to a constant 320Kbps MP3.

Technical notes on advanced options

The -a option effectively makes the script a generic wrapper for ffmpeg. FFmpeg is executed once per track with only the loglevel, input filename, and output filename being set. All other options are passed unparsed to the command line.

The exact format of the executed ffmpeg command is:

ffmpeg -loglevel error -nostdin -i "input.flac" ${options} "output.${extension}"

Technical notes on regex

By default, the script only matches and interacts with FLAC files (specifically, files ending in ".flac"). The -r option allows the script to match on a user specified regular expression (i.e. "regex") pattern.

Files are passed to the script with the full Linux path intact. (Ex: /path/to/audio/a-ha/Hunting High and Low/01 Take on Me.mp3). Craft your regex with this in mind.

warning NOTE: Escaping special regex characters (like a dot .) requires a double backslash or a character class. A character class (i.e. [.]) is recommended because backslashes can be stripped by the bash shell and getting this right can be confusing.

For example, to convert all audio files to AAC audio files, use the following options:

-a "-y -map 0 -c:a aac -b:a 240k -c:v copy" -e m4a --regex '[.][^.]*$'

Regular expression syntax is beyond the scope of this document. See this tutorial for more information. Regex patterns may be tested here.

Examples

-b 320k        # Output 320 kbit/s MP3 (non-VBR; same as default behavior)
-v 0           # Output variable bitrate MP3, VBR 220-260 kbit/s
-d -b 160k     # Enable debugging level 1, and output a 160 kbit/s MP3
-r '[.][^.]*$' # Convert any file to MP3 (not just FLAC)
-a "-c:v libtheora -map 0 -q:v 10 -c:a libopus -b:a 192k" -e .opus
               # Convert to Opus format, 192 kbit/s, cover art
-a "-vn -c:a libopus -b:a 192K" -e .opus -r '[.]mp3$'
               # Convert .mp3 files to Opus format, 192 kbit/s, no cover art
-a "-y -map 0 -c:a aac -b:a 240k -c:v copy" -e m4a
               # Convert to M4A format, using AAC 240 kbit/s audio, cover art, overwrite file
--file "/path/to/audio/a-ha/Hunting High and Low/01 Take on Me.flac"
               # Batch Mode
               # Output 320kbit/s MP3
-o "/path/to/audio" -k
               # Place the converted file(s) in the specified directory and do not delete the original audio file(s)

Included Wrapper Scripts

For your convenience, several wrapper scripts are included in the /usr/local/bin/ directory.
You may use any of these scripts in place of the flac2mp3.sh mentioned in the Installation section above.

flac2mp3-debug.sh        # Enable debugging, level 1
flac2mp3-debug-2.sh      # Enable debugging, level 2
flac2mp3-vbr.sh          # Use variable bit rate MP3, quality 0
flac2opus.sh             # Convert to Opus format using .opus extension, 192 kbit/s, no covert art
flac2alac.sh             # Convert to Apple Lossless using an .m4a extension

Example Wrapper Script

To configure an entry from the Examples section above, create and save a file called flac2mp3-custom.sh to /config containing the following text:

#!/bin/bash

. /usr/local/bin/flac2mp3.sh -d -b 160k

Make it executable:

chmod +x /config/flac2mp3-custom.sh

Then put /config/flac2mp3-custom.sh in the Path field in place of /usr/local/bin/flac2mp3.sh mentioned in the Installation section above.

Note: If you followed the Linuxserver.io recommendations when configuring your container, the /config directory will be mapped to an external storage location. It is therefore recommended to place custom scripts in the /config directory so they will survive container updates, but they may be placed anywhere that is accessible by Lidarr.

Environment Variable

The flac2mp3.sh script also allows the use of arguments provided by the FLAC2MP3_ARGS environment variable. This allows advanced use cases without having to provide a custom script.

For example, the following value in your docker run command would convert any .mp3 to Opus:

-e FLAC2MP3_ARGS='-a "-vn -c:a libopus -b:a 192k" -e .opus -r "[.]mp3$"'

Make sure to correctly use quotes and/or escape special characters when using this method. (See regex notes above.)
In Docker Compose, the previous command would need an extra $ to match the end-of-line:

environment:
  - FLAC2MP3_ARGS=-a "-vn -c:a libopus -b:a 192k" -e .opus -r '[.]mp3$$'

Example Synology Configuration
flac2mp3

NOTE: The environment variable settings are only used when no command line arguments are present. Any command line argument will disable the use of the environment variable.

Triggers

The only events/notification triggers that are supported are On Release Import and On Upgrade

Batch Mode

Batch mode allows the script to be executed independently of Lidarr. It converts the file specified on the command line and ignores any environment variables that are normally expected to be set by the music management program.

Using this function, you can easily process all of your audio files in any subdirectory at once. See the Batch Example below.

Script Execution Differences in Batch Mode

Because the script is not called from within Lidarr, expect the following behavior while in Batch Mode:

  • The filename must be specified on the command line
    (The -f option places the script in Batch Mode)
  • Lidarr APIs are not called and its database is not updated.
    This may require a manual import of converted music files or an artist rescan.
  • Original audio files are deleted.
    The Recycle Bin function is not available. (Modifiable using the -k option.)

Batch Example

To convert all .FLAC files in the /music directory to Apple Lossless Audio Codec (ALAC), enter the following at the Linux command line:

find /music/ -type f -name "*.flac" | while read file; do /usr/local/bin/flac2mp3.sh -f "$file" -a "-c:a alac" -e m4a; done

Logs

By default, a log file is created for the script activity called:

/config/logs/flac2mp3.txt

This log can be downloaded from Lidarr under System > Log Files. The log filename can be modified with the --log command-line option.

Log rotation is performed, with 5 log files of 1MB each kept, matching Lidarr's log retention.

danger NOTE: If debug logging is enabled with a level above 1, the log file can grow very large very quickly and is much more likely to be rotated. Do not leave high-level debug logging enabled permanently.

Metadata Corrections

This feature is not meant for general purpose use. It is only documented here for completeness.

List of supported tags and metadata corrections that are applied:

Tag Original Correction
title Parenthesis for live|remix, etc. "()" Square brackets "[]"
disc 1 1/1
genre /Pop/ "Pop"
/Indie/ "Alternative & Indie"
/Industrial/ "Industrial Rock"
/Electronic/ "Electronica & Dance"
/Punk|Alternative/ "Alternative & Punk"
/Rock/ "Rock"

Uninstall

To completely remove the mod:

  1. Delete the custom script from Lidarr's Settings > Connect screen that you created in the Installation section above.
  2. Stop and delete the Lidarr container.
  3. Exclude the DOCKER_MODS environment variable from your compose.yaml file or the docker run command when re-creating the Lidarr container.

Credits

This would not be possible without the following:

Lidarr
LinuxServer.io Lidarr container
LinuxServer.io Docker Mods project
ffmpeg
Icons made by Freepik from Flaticon

lidarr-flac2mp3's People

Contributors

thecaptain989 avatar youegraillot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

lidarr-flac2mp3's Issues

Add images for ARM architecture

Currently the dockerhub images are amd64 only. Using buildx would allow multi-architecture builds.

For example, I was able to clone this repo and run

docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 --tag patrickjmcd/lidarr:latest --push .

to build a multi-arch image

How to Remove/Uninstall

I tried using Portainer by removing the ENV variable and then re-deploying the container, but it just comes right back.

This is an awesome mod but I decided to upgrade all my albums to FLAC instead of converting to MP3.

I couldn't find any removal instructions. Sorry to bother you

Script just never converts, creates a 0KB file

Hi, getting an issue with this where after enabling and running, it creates a 0KB file for the first item it tries to convert and then just stops. Used debug-2 as the script and got this result (can provide more if needed):

22-6-20 00:57:31.1|[442]Info|Lidarr event: AlbumDownload, Artist: Beck (12), Album: Beck (2757), Export bitrate: 320k, Track(s): /music/Beck/Beck (2000)/01 - Arabian Nights.flac|/music/Beck/Beck (2000)/02 - Dirty Dirty.flac|/music/Beck/Beck (2000)/03 - Midnite Vultures.flac|/music/Beck/Beck (2000)/04 - Mixed Bizness (The Latin Mix by Scatter-Shot Theory).flac|/music/Beck/Beck (2000)/05 - Mixed Bizness (Hardmixn by Jake Kozel, aka Socket 7).flac|/music/Beck/Beck (2000)/06 - Salt in the Wound.flac|/music/Beck/Beck (2000)/07 - Sexx Laws (Malibu remix).flac|/music/Beck/Beck (2000)/08 - Zatyricon.flac 22-6-20 00:57:31.1|[442]Debug|Using constant bitrate of 320k 22-6-20 00:57:31.1|[442]Info|Writing: /music/Beck/Beck (2000)/01 - Arabian Nights.mp3 22-6-20 00:57:31.1|[442]Debug|Executing: nice /usr/bin/ffmpeg -loglevel error -i "/music/Beck/Beck (2000)/01 - Arabian Nights.flac" -c:v copy -map 0 -y -acodec libmp3lame -b:a 320k -write_id3v1 1 -id3v2_version 3 "/music/Beck/Beck (2000)/01 - Arabian Nights.mp3" 22-6-20 00:57:31.5|[442] 22-6-20 00:57:31.5|[442]Enter command: <target>|all <time>|-1 <command>[ <argument>]

Format option "ALAC"

Hi. Could you add support for flac2alac please?

ffmpeg -i input.flac -c:v copy -c:a alac output.m4a

Is it possible to batch convert like in your Sonarr/Radarr script?

Compensate for Lidarr adding disc number “1” to all tracks

On some albums with a single disc, Lidarr will update the metadata to set the disc number to “1”. This causes some music managers, like iTunes to prefix a “1-“ to the file name of all tracks.

It would be better to leave the disc number blank for single disc albums.

Unsure if this script should compensate for Lidarr here, since this may be desirable behavior for some.

[enhancement] additional codecs possible?

Since this project uses ffmpeg would it be possible to convert to Opus instead of mp3, or even other codecs?

Official support for other codecs would be cool but I'm also going to try to modify the scripts to do this on my own. However this will be my first time using docker mods so we'll see how that goes.

If allowing other codecs is something this project is open to then I would be happy to propose a pull request if I get something working.

I'm going to focus on Opus first.

Implement Lidarr API feedback to scan converted audio files

After script processing, the resulting audio files will have the same name base name, but different extensions. This currently results in a mismatch between what Lidarr shows in the UI and what is actually stored on disk.

The thought here is to call the API and tell Lidarr to rescan the directory. Will require research into the Lidarr API, getting the key from config.xml, etc.

Cue/Flac split

Hi, this script works really well for Releases with individual flac files for each track. There are however albums that consist of just one flac and a cue file.

A method to automatically split these into individual tracks would be the perfect addition to this project.

Lidarr has no current method of splitting these, so you might not be able to fix this in your script.

Question, not issue: how to update?

Hi, I've been using your script for a few months. Today I decided to check your github and saw you updated several times.
How do I update it? Or does it update by itself? I'm on Docker and I can see from Portainer if a container as been updated by Watchtower in the Image list on left panel, but flac2mp3 is a script, not a container, so I don't know what version I have.

How to add cover art to converted opus file?

Hello,

This is not an issue but I didn't know where else I could ask about it.

I used the custom script flac2opus.sh and it works perfectly fine, but I would like it to save the cover art in the file, as it was there for the original .flac. I'm using the default command ". /usr/local/bin/flac2mp3.sh -a "-vn -c:a libopus -b:a 192k" -e .opus"

I checked the syntax, and the options/arguments, but I can't see a clear way to specify this. I blindly tried adding "-map 0" to the command because it felt like this could be the option, but nothing changed.

Could you help me? Thank you!

lidarr api url building is not correct

Hi,
I'm using this script as docker_mod attached to the lidarr cointainer and I've noticed that in my library flac files weren't deleted after conversion to mp3 anymore (but I don't know when this problem came out).

I've enabled debug and found out that api lidarr url was created with an additional "/" between port and urlbase:

24-1-14 18:22:30.5|[20104]Debug|Getting Lidarr version. Calling Lidarr API using GET and URL 'http://localhost:8686//lidarr/api/v1/system/status' 24-1-14 18:22:30.5|[20104]Debug|API returned: 24-1-14 18:22:30.5|[20104]Debug|Detected Lidarr version 24-1-14 18:22:30.5|[20104]Debug|Getting track file info for album id 5766. Calling Lidarr API using GET and URL 'http://localhost:8686//lidarr/api/v1/trackFile?albumId=5766' 24-1-14 18:22:30.5|[20104]Debug|API returned:

The result is that calls to API return nothing and files are not deleted.

This is the current expression for building the url:

# Build URL to Lidarr API flac2mp3_api_url="http://$flac2mp3_bindaddress:$flac2mp3_port${flac2mp3_urlbase:+/$flac2mp3_urlbase}/api/v1"

So I tried to change myself the url expression removing the "/" after the "+" sign and everything started to work again, but I don't know if it's a fix that works for every case (for example when urlbase is not used).

Anyway please fix this bug and add a docker environment variable to override the url and permitting the user to specify it.

Thanks and congratulations for the excellent work

Feature request: flag to prevent rescan

First the obligatory: this is amazing, and I sincerely appreciate all your hard work!

Next the request: It seems Lidarr scan ALL the files every time the script calls for a re-scan, and with tens of thousands of files, it takes quite a long time. As I'm currently rebuilding my library, I have dozens and dozens of re-scans queued up in Lidarr, and it's spending much more time re-scanning already-imported/converted files than importing/converting more. Would it be possible to implement a flag to run the script (and still delete FLAC files after conversion) but not tell Lidarr to scan afterwards? Just to be used until my library is back at steady-state then I could set it back to normal behaviour. For now I've commented out the section of the script that tells the API to scan, but that's not ideal if the container is recreated.

Option to use -v0 instead of CBR

Would be nice to have the option of using lame -v0 instead of static 320 CBR... Quality ends up the same with alot smaller file size.

VBR wrapper outputs 128 kbit mp3

The VBR wrapper script seems to suddenly output 128 kbit mp3 instead of -V0 VBR?
Think this started with the additional codec support being added. But can't seem to find where the logic is broken in the code.

FLAC files not being deleted in 2.2

After updating to the latest release, 2.2, I've found the FLAC files are no longer deleted after conversion.

Here's the output for an album using 2.2:

22-12-5 17:23:17.5|[8930]Info|Lidarr event: AlbumDownload, Artist: Eric Johnson (881), Album: EJ (20072), Advanced options: '-vn -c:a libopus -b:a 128k', File extension: .opus, Matching regex: '\.(flac|wav)$', Track(s): /music/Eric Johnson/EJ/01-01 Mrs. Robinson.flac|/music/Eric Johnson/EJ/01-02 Water Under the Bridge.flac|/music/Eric Johnson/EJ/01-03 Wonder.flac|/music/Eric Johnson/EJ/01-04 Wrapped in a Cloud.flac|/music/Eric Johnson/EJ/01-05 Once Upon a Time in Texas.flac|/music/Eric Johnson/EJ/01-06 One Rainy Wish.flac|/music/Eric Johnson/EJ/01-07 Serinidad.flac|/music/Eric Johnson/EJ/01-08 Fatherly Downs.flac|/music/Eric Johnson/EJ/01-09 The World Is Waiting for the Sunrise.flac|/music/Eric Johnson/EJ/01-10 November.flac|/music/Eric Johnson/EJ/01-11 All Things You Are.flac|/music/Eric Johnson/EJ/01-12 Scarborough Fair+Canticle.flac|/music/Eric Johnson/EJ/01-13 Song for Irene.flac
22-12-5 17:23:17.6|[8930]Info|Writing: /music/Eric Johnson/EJ/01-01 Mrs. Robinson.opus
22-12-5 17:23:25.2|[8930]Error|Exit code 1 setting permissions and/or recycling on "/music/Eric Johnson/EJ/01-01 Mrs. Robinson.opus"
22-12-5 17:23:25.2|[8930]Info|Writing: /music/Eric Johnson/EJ/01-02 Water Under the Bridge.opus
22-12-5 17:23:30.1|[8930]Error|Exit code 1 setting permissions and/or recycling on "/music/Eric Johnson/EJ/01-02 Water Under the Bridge.opus"
22-12-5 17:23:30.1|[8930]Info|Writing: /music/Eric Johnson/EJ/01-03 Wonder.opus
22-12-5 17:23:36.0|[8930]Error|Exit code 1 setting permissions and/or recycling on "/music/Eric Johnson/EJ/01-03 Wonder.opus"
22-12-5 17:23:36.0|[8930]Info|Writing: /music/Eric Johnson/EJ/01-04 Wrapped in a Cloud.opus
22-12-5 17:23:46.0|[8930]Error|Exit code 1 setting permissions and/or recycling on "/music/Eric Johnson/EJ/01-04 Wrapped in a Cloud.opus"
22-12-5 17:23:46.0|[8930]Info|Writing: /music/Eric Johnson/EJ/01-05 Once Upon a Time in Texas.opus
22-12-5 17:23:52.3|[8930]Error|Exit code 1 setting permissions and/or recycling on "/music/Eric Johnson/EJ/01-05 Once Upon a Time in Texas.opus"
22-12-5 17:23:52.3|[8930]Info|Writing: /music/Eric Johnson/EJ/01-06 One Rainy Wish.opus
22-12-5 17:24:00.1|[8930]Error|Exit code 1 setting permissions and/or recycling on "/music/Eric Johnson/EJ/01-06 One Rainy Wish.opus"
22-12-5 17:24:00.1|[8930]Info|Writing: /music/Eric Johnson/EJ/01-07 Serinidad.opus
22-12-5 17:24:04.3|[8930]Error|Exit code 1 setting permissions and/or recycling on "/music/Eric Johnson/EJ/01-07 Serinidad.opus"
22-12-5 17:24:04.3|[8930]Info|Writing: /music/Eric Johnson/EJ/01-08 Fatherly Downs.opus
22-12-5 17:24:11.3|[8930]Error|Exit code 1 setting permissions and/or recycling on "/music/Eric Johnson/EJ/01-08 Fatherly Downs.opus"
22-12-5 17:24:11.3|[8930]Info|Writing: /music/Eric Johnson/EJ/01-09 The World Is Waiting for the Sunrise.opus
22-12-5 17:24:16.3|[8930]Error|Exit code 1 setting permissions and/or recycling on "/music/Eric Johnson/EJ/01-09 The World Is Waiting for the Sunrise.opus"
22-12-5 17:24:16.3|[8930]Info|Writing: /music/Eric Johnson/EJ/01-10 November.opus
22-12-5 17:24:26.4|[8930]Error|Exit code 1 setting permissions and/or recycling on "/music/Eric Johnson/EJ/01-10 November.opus"
22-12-5 17:24:26.5|[8930]Info|Writing: /music/Eric Johnson/EJ/01-11 All Things You Are.opus
22-12-5 17:24:35.1|[8930]Error|Exit code 1 setting permissions and/or recycling on "/music/Eric Johnson/EJ/01-11 All Things You Are.opus"
22-12-5 17:24:35.1|[8930]Info|Writing: /music/Eric Johnson/EJ/01-12 Scarborough Fair+Canticle.opus
22-12-5 17:24:43.3|[8930]Error|Exit code 1 setting permissions and/or recycling on "/music/Eric Johnson/EJ/01-12 Scarborough Fair+Canticle.opus"
22-12-5 17:24:43.4|[8930]Info|Writing: /music/Eric Johnson/EJ/01-13 Song for Irene.opus
22-12-5 17:24:48.9|[8930]Error|Exit code 1 setting permissions and/or recycling on "/music/Eric Johnson/EJ/01-13 Song for Irene.opus"
22-12-5 17:24:48.9|[8930]Info|Calling Lidarr API to rescan artist
22-12-5 17:25:03.8|[8930]Info|Completed in 1m 48s

And here's the output for the next album, using 2.1 by pinning it with the Docker Hub tag:

22-12-5 18:06:16.7|[310]Info|Lidarr event: AlbumDownload, Artist: Eric Johnson (881), Album: The Book of Making (20070), Advanced options: '-vn -c:a libopus -b:a 128k', File extension: .opus, Matching regex: '\.(flac|wav)$', Track(s): /music/Eric Johnson/The Book of Making/01-01 Soundtrack Life.flac|/music/Eric Johnson/The Book of Making/01-02 Floating Through This World.flac|/music/Eric Johnson/The Book of Making/01-03 Love Will Never Say Goodbye.flac|/music/Eric Johnson/The Book of Making/01-04 Bigger Than My Life.flac|/music/Eric Johnson/The Book of Making/01-05 Just To Be With You.flac|/music/Eric Johnson/The Book of Making/01-06 To Be Alive.flac|/music/Eric Johnson/The Book of Making/01-07 Another One Like You.flac|/music/Eric Johnson/The Book of Making/01-08 My Faith In You.flac|/music/Eric Johnson/The Book of Making/01-09 A Thousand Miles.flac
22-12-5 18:06:16.8|[310]Info|Writing: /music/Eric Johnson/The Book of Making/01-01 Soundtrack Life.opus
22-12-5 18:06:24.3|[310]Info|Writing: /music/Eric Johnson/The Book of Making/01-02 Floating Through This World.opus
22-12-5 18:06:29.3|[310]Info|Writing: /music/Eric Johnson/The Book of Making/01-03 Love Will Never Say Goodbye.opus
22-12-5 18:06:36.3|[310]Info|Writing: /music/Eric Johnson/The Book of Making/01-04 Bigger Than My Life.opus
22-12-5 18:06:40.6|[310]Info|Writing: /music/Eric Johnson/The Book of Making/01-05 Just To Be With You.opus
22-12-5 18:06:45.8|[310]Info|Writing: /music/Eric Johnson/The Book of Making/01-06 To Be Alive.opus
22-12-5 18:06:53.8|[310]Info|Writing: /music/Eric Johnson/The Book of Making/01-07 Another One Like You.opus
22-12-5 18:07:00.8|[310]Info|Writing: /music/Eric Johnson/The Book of Making/01-08 My Faith In You.opus
22-12-5 18:07:07.7|[310]Info|Writing: /music/Eric Johnson/The Book of Making/01-09 A Thousand Miles.opus
22-12-5 18:07:11.6|[310]Info|Calling Lidarr API to rescan artist
22-12-5 18:07:26.3|[310]Info|Completed in 1m 11s

sqlite3: command not found

Noticed recently that I get the following error in my event log in Lidarr:

/usr/local/bin/flac2mp3.sh: line 32: sqlite3: command not found

It doesn't stop the conversion from happening, so not a big deal, but thought I'd bring it up.

Looking at the script, I wonder if it the setup script needs to check for the dependency and install it if missing. I tried recreating my Lidarr image with the plugin but it made no difference.

Error warning for something that it's not an error.

I have just delpoyed https://github.com/RandomNinjaAtk/docker-lidarr-extended which is a standard Lidarr + AMD/AMVD scripts included to download via Deemix/Youtube. I've added flac2mp3 and it just works fine. Nevertheless lidarr-extended log says:

[Error] flac2mp3-debug-2.sh: Debug|Enabling debug logging level 2. Starting AlbumDownload run. [Info] RefreshArtistService: Updating Info for Sam Sparro [Info] RefreshAlbumService: Updating Info for Return To Paradise [Info] RefreshAlbumService: Updating Info for Sam Sparro [Error] flac2mp3-debug-2.sh: Warn|Lidarr job ID 171387 timed out or failed.

and flac2mp3.txt says
https://pastebin.com/kdVuSJW0

but it works. I just wanted to notify about this weird error message for something that doesn't look as an error. I'm not sure whether this issue is from lidarr side or your script side. FLACs are normally downloaded, compressed to MP3-320 and moved to recycle. No half-baked tracks, everything's fine. Just this apparently bogus error warning.

linuxserver/lidarr:preview

I am not seeing the script in linuxserver/lidarr:preview. I tried mounting /usr/local/bin with the downloaded script files there and /usr/bin/ffmpeg as local volumes. I updated the location in the script for ffmpeg to be /usr/bin/ffmpeg/bin/ffmpeg. I also created wrapper.sh in /usr/local/bin/. I don't seem to be having any luck. Is there something else I am missing?

I see "20-8-17 08:14:20.6|/bin/sh: 1: /usr/bin/ffmpeg/bin/ffmpeg: not found" in the log file, but the path looks correct to me.

image

docker create --name=lidarr -e TZ=America/Chicago -p 8686:8686 -e PUID=0 -e PGID=0 \
-v C:\Users\user\Documents\Docker\lidarr\config:/config/ \
-v C:\Users\user\Downloads\:/downloads/ \
-v C:\Users\user\Documents\Docker\lidarr\ffmpeg:/usr/bin/ffmpeg \
-v C:\Users\user\Documents\Docker\lidarr\bin:/usr/local/bin \
-v xbmcmusic:/music/  linuxserver/lidarr:preview

Options for convert destination path and keep source files

Hi, thank you for this awesome Lidarr docker mod !

Made a custom wrapper for flac2alac as mentioned here on the repo and it's working very well :)

I plan to use this mod in my workflow to keep source .flac files intact in the Lidarr-managed library, and just "mirror" imported files in their own ALAC library for iTunes (using its own Automatically Add to iTunes folder for import upon next opening, but that's outside the scope here).

One improvement I would love to see to this script is to be able keep original files as well as specifying a different target location for converted files (ie. --target and --keep options ?).

Here are the impacts I see with such new options :

  • target option not set would still default to source directory
  • keep option not set would still default to current behaviour with Lidarr's Recycle Bin
  • if both options are set, I guess Lidarr API scan call can be skipped (?)

What would you think about it ?
Thank you

Use Recycle Bin

Use the Lidarr Recycle Bin if configured and move the original audio files there instead of deleting them.

Script not triggered on Manual import

I would expect that custom scripts would be triggered from either an automated or manual import. Currently, will all versions of Lidarr up to v0.7.1.1381, if you perform a Wanted->Manual import my script is not triggered.

I'm unsure if this is something that I can even fix, or if the lidarr project must fix this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.