Skip to content

Commit 2395da4

Browse files
committed
Release 2.13..0
1 parent 29c8d67 commit 2395da4

File tree

3 files changed

+103
-39
lines changed

3 files changed

+103
-39
lines changed

README.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# About
2-
A [Docker Mod](https://github.com/linuxserver/docker-mods) for the LinuxServer.io Radarr/Sonarr v3 or higher Docker containers that adds a script to automatically strip out unwanted audio and subtitle tracks, keeping only the desired languages.
2+
A [Docker Mod](https://github.com/linuxserver/docker-mods) for the LinuxServer.io Radarr/Sonarr v3 or higher Docker containers that adds a script to automatically strip out unwanted audio and subtitle tracks, keeping only the desired languages. A [Batch Mode](#batch-mode) is also supported that allows usage outside of Radarr/Sonarr.
33

44
**This unified script works in both Radarr and Sonarr. Use this mod in either container!**
55

@@ -85,7 +85,7 @@ Development Container info:
8585
</details>
8686

8787
The script will detect the language(s) defined in Radarr/Sonarr for the movie or TV show and only keep the audio and subtitles selected.
88-
Alternatively, a wrapper script or an environment variable may be used to more granularly define which tracks to keep. See [Wrapper Scripts](./README.md#wrapper-scripts) or [Environment Variable](./README.md#environment-variable) for more details.
88+
Alternatively, a wrapper script or an environment variable may be used to more granularly define which tracks to keep. See [Wrapper Scripts](#wrapper-scripts) or [Environment Variable](#environment-variable) for more details.
8989

9090
> [!IMPORTANT]
9191
> You **must** configure language(s) in Radarr/Sonarr *or* pass command-line arguments for the script to do anything! See the next section for an example.
@@ -127,7 +127,7 @@ The following is a simplified example and steps to configure Radarr so the scrip
127127
</details>
128128

129129
Now, when Radarr imports a movie with the 'Any' Quality Profile, the script will keep only Original and English languages. This is equivalent to calling the script with `--audio :org:eng --subs :org:eng` command-line arguments.
130-
See [Automatic Language Detection](./README.md#automatic-language-detection) for more details.
130+
See [Automatic Language Detection](#automatic-language-detection) for more details.
131131

132132
# Usage Details
133133
The source video can be any mkvtoolnix supported video format. The output is an MKV file with the same name and the same permissions. Owner is preserved if the script is executed as root.
@@ -157,15 +157,15 @@ Both audio **and** subtitle tracks that match the configured language(s) are kep
157157

158158
### Special Language Selections
159159
The language selection **'Original'** will use the language Radarr pulled from [The Movie Database](https://www.themoviedb.org/ "TMDB") or that Sonarr pulled from [The TVDB](https://www.thetvdb.com/ "TVDB") during its last refresh.
160-
Selecting this language is functionally equivalent to calling the script with `--audio :org --subs :org` command-line arguments. See [Original language code](./README.md#original-language-code) below for more details.
160+
Selecting this language is functionally equivalent to calling the script with `--audio :org --subs :org` command-line arguments. See [Original language code](#original-language-code) below for more details.
161161

162162
The language selection **'Unknown'** will match tracks with **no configured language** in the video file. Selecting this language is functionally equivalent to calling the script with `--audio :und --subs :und` command-line arguments.
163-
See [Unknown language code](./README.md#unknown-language-code) below for more details.
163+
See [Unknown language code](#unknown-language-code) below for more details.
164164

165165
The language selection **'Any'** has two purposes:
166166
1) In Radarr only, when set on a Quality Profile, it will trigger a search of languages in ***Custom Formats***
167167
2) If languages are not configured in a Custom Format, or if you're using Sonarr, it will preserve **all languages** in the video file. This is functionally equivalent to calling the script with `--audio :any --subs :any` command-line arguments.
168-
See [Any language code](./README.md#any-language-code) below for more details.
168+
See [Any language code](#any-language-code) below for more details.
169169

170170
> [!IMPORTANT]
171171
> When using *Custom Formats* language conditions and scoring you may not get the results you expect.
@@ -210,16 +210,17 @@ All language conditions with positive scores *and* Negated conditions with negat
210210
The script also supports command-line arguments that will override the automatic language detection. More granular control can therefore be exerted or extended using tagging and defining multiple *Connect* scripts (this is native Radarr/Sonarr functionality outside the scope of this documentation).
211211

212212
The syntax for the command-line is:
213-
`striptracks.sh [{-a|--audio} <audio_languages> [{-s|--subs} <subtitle_languages>] [{-f|--file} <video_file>]] [{-l|--log} <log_file>] [{-c|--config} <config_file>] [{-d|--debug} [<level>]]`
213+
`striptracks.sh [{-a|--audio} <audio_languages> [{-s|--subs} <subtitle_languages>] [--reorder] [{-f|--file} <video_file>]] [{-l|--log} <log_file>] [{-c|--config} <config_file>] [{-d|--debug} [<level>]]`
214214

215215
<details>
216216
<summary>Table of Command-Line Arguments</summary>
217217

218218
Option|Argument|Description
219219
---|---|---
220-
`-a`, `--audio`|`<audio_languages>`|Audio languages to keep<br/>ISO 639-2 code(s) prefixed with a colon (`:`)<br/>Each code may optionally be followed by a plus (`+`) and one or more [modifiers](./README.md#language-code-modifiers).
220+
`-a`, `--audio`|`<audio_languages>`|Audio languages to keep<br/>ISO 639-2 code(s) prefixed with a colon (`:`)<br/>Each code may optionally be followed by a plus (`+`) and one or more [modifiers](#language-code-modifiers).
221221
`-s`, `--subs`|`<subtitle_languages>`|Subtitle languages to keep<br/>ISO 639-2 code(s) prefixed with a colon (`:`)<br/>Each code may optionally be followed by a plus (`+`) and one or more modifiers.
222-
`-f`, `--file`|`<video_file>`|If included, the script enters **[Batch Mode](./README.md#batch-mode)** and converts the specified video file.<br/>Requires the `-a` option.<br/>![notes] **Do not** use this argument when called from Radarr or Sonarr!
222+
`--reorder`| |Reorder audio and subtitles tracks to match the language code order specified in the `<audio_languages>` and `<subtitle_languages>` arguments.<br/>This is skipped if no tracks are removed.
223+
`-f`, `--file`|`<video_file>`|If included, the script enters **[Batch Mode](#batch-mode)** and converts the specified video file.<br/>Requires the `--audio` option.<br/>![notes] **Do not** use this argument when called from Radarr or Sonarr!
223224
`-l`, `--log`|`<log_file>`|The log filename<br/>Default is `/config/log/striptracks.txt`
224225
`-c`, `--config`|`<config_file>`|Radarr/Sonarr XML configuration file<br/>Default is `/config/config.xml`
225226
`-d`, `--debug`|`[<level>]`|Enables debug logging. Level is optional.<br/>Default is `1` (low)<br/>`2` includes JSON output<br/>`3` contains even more JSON output
@@ -228,7 +229,7 @@ Option|Argument|Description
228229

229230
</details>
230231

231-
The `<audio_languages>` and `<subtitle_languages>` are optional arguments that are colon (`:`) prepended language codes in [ISO 639-2](https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes "List of ISO 639-2 codes") format.
232+
The `<audio_languages>` and `<subtitle_languages>` arguments are colon (`:`) prepended language codes in [ISO 639-2](https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes "List of ISO 639-2 codes") format.
232233
For example:
233234

234235
* `:eng`
@@ -237,7 +238,7 @@ For example:
237238

238239
...etc.
239240

240-
Multiple codes may be concatenated, such as `:eng:spa` for both English and Spanish. Order is unimportant.
241+
Multiple codes may be concatenated, such as `:eng:spa` for both English and Spanish. Order is unimportant, unless the `--reorder` option is also specified.
241242

242243
> [!WARNING]
243244
> If no subtitle language is detected via Radarr/Sonarr configuration or specified on the command-line, all subtitles are removed.
@@ -268,7 +269,7 @@ The `:any` language code is a special code. When used, the script will preserve
268269
### Original language code
269270
The `:org` language code is a special code. When used, instead of retaining a specific language, the script substitutes the original movie or TV show language as specified in its [The Movie Database](https://www.themoviedb.org/ "TMDB") or [The TVDB](https://www.thetvdb.com/ "TVDB") entry.
270271
As an example, when importing "*Amores Perros (2000)*" with options `--audio :org:eng`, the Spanish and English audio tracks are preserved.
271-
Several [Included Wrapper Scripts](./README.md#included-wrapper-scripts) use this special code.
272+
Several [Included Wrapper Scripts](#included-wrapper-scripts) use this special code.
272273

273274
> [!NOTE]
274275
> This feature relies on the 'originalLanguage' field in the Radarr/Sonarr database. The `:org` code is therefore invalid when used in Batch Mode.
@@ -314,15 +315,15 @@ There is no way to force the script to remove audio tracks with these codes.
314315
</details>
315316

316317
## Wrapper Scripts
317-
To supply arguments to the script, you must either use one of the included wrapper scripts, create a custom wrapper script, or set the `STRIPTRACKS_ARGS` [environment variable](./README.md#environment-variable).
318+
To supply arguments to the script, you must either use one of the included wrapper scripts, create a custom wrapper script, or set the `STRIPTRACKS_ARGS` [environment variable](#environment-variable).
318319

319320
> [!TIP]
320321
> If you followed the Linuxserver.io recommendations when configuring your container, the `/config` directory will be mapped to an external storage location.
321322
> 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 Radarr or Sonarr.
322323

323324
### Included Wrapper Scripts
324325
For your convenience, several wrapper scripts are included in the `/usr/local/bin/` directory.
325-
You may use any of these in place of `striptracks.sh` mentioned in the [Installation](./README.md#installation) section above.
326+
You may use any of these in place of `striptracks.sh` mentioned in the [Installation](#installation) section above.
326327

327328
<details>
328329
<summary>List of scripts</summary>
@@ -350,7 +351,7 @@ striptracks-org-spa.sh # Keep Original, Spanish, and Unknown audio, and Orig
350351
<details>
351352
<summary>Example Script</summary>
352353

353-
To configure an entry from the [Examples](./README.md#examples) section above, create and save a file called `striptracks-custom.sh` to `/config` containing the following text:
354+
To configure an entry from the [Examples](#examples) section above, create and save a file called `striptracks-custom.sh` to `/config` containing the following text:
354355

355356
```shell
356357
#!/bin/bash
@@ -364,7 +365,7 @@ Make it executable:
364365
chmod +x /config/striptracks-custom.sh
365366
```
366367

367-
Then put `/config/striptracks-custom.sh` in the **Path** field in place of `/usr/local/bin/striptracks.sh` mentioned in the [Installation](./README.md#installation) section above.
368+
Then put `/config/striptracks-custom.sh` in the **Path** field in place of `/usr/local/bin/striptracks.sh` mentioned in the [Installation](#installation) section above.
368369

369370
</details>
370371

@@ -410,7 +411,7 @@ The only events/notification triggers that are supported are **On Import** and *
410411
## Batch Mode
411412
Batch mode allows the script to be executed independently of Radarr or Sonarr. It converts the file specified on the command-line and ignores any environment variables that are normally expected to be set by the video management program.
412413

413-
Using this function, you can easily process all of your video files in any subdirectory at once. See the [Batch Example](./README.md#batch-example) below.
414+
Using this function, you can easily process all of your video files in any subdirectory at once. See the [Batch Example](#batch-example) below.
414415

415416
### Script Execution Differences in Batch Mode
416417
Because the script is not called from within Radarr or Sonarr, their database is unavailable to the script. Therefore, expect the following behavior while in Batch Mode:
@@ -460,7 +461,7 @@ However, configuring hardlinks is still recommended.
460461
<summary>Hardlink Limitations</summary>
461462

462463
*Radarr Hardlinks Configuration Screenshot*
463-
![radarr-enable-hardlinks](./.assets/radarr-enable-hardlinks.png "Radarr hardlinks screenshot")
464+
![radarr-enable-hardlinks](.assets/radarr-enable-hardlinks.png "Radarr hardlinks screenshot")
464465

465466
Hardlinks are essentially multiple references to the *same file*.
466467
The purpose of a hardlink is to:
@@ -481,7 +482,7 @@ It is therefore still recommended to enable and use hardlinks in Radarr and Sona
481482

482483
# Uninstall
483484
To completely remove the mod:
484-
1. Delete the custom script from Radarr's or Sonarr's *Settings* > *Connect* screen that you created in the [Installation](./README.md#installation) section above.
485+
1. Delete the custom script from Radarr's or Sonarr's *Settings* > *Connect* screen that you created in the [Installation](#installation) section above.
485486
2. Stop and delete the Radarr/Sonarr container.
486487
3. Remove the **DOCKER_MODS** environment variable from your `compose.yaml` file or exclude it from the `docker run` command when re-creating the Radarr/Sonarr container.
487488

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Only the latest major and minor version are supported.
66

77
| Version | Supported |
88
| ------- | ------------------ |
9-
| 2.12.x | :heavy_check_mark: |
10-
| < 2.12 | :x: |
9+
| 2.13.x | :heavy_check_mark: |
10+
| < 2.13 | :x: |
1111

1212
## Reporting a Vulnerability
1313

0 commit comments

Comments
 (0)