TheCaptain989 / radarr-striptracks

A Docker Mod to Radarr/Sonarr to automatically strip out unwanted audio and subtitle tracks
https://hub.docker.com/r/thecaptain989/radarr-striptracks
GNU General Public License v3.0
20 stars 1 forks source link

is there a way to keep both audio/subtitle track of same language? #48

Closed rmnavz closed 1 year ago

rmnavz commented 1 year ago

I'm currently having issue with a series on sonarr that have actual audio (audio track 1) and commentary (audio track 2). I'm wondering if there is a way to keep both.

I'm running this custom wrapper as I wanted it to run on every series I have in sonarr that have american, chinese, japanese, anime and more. so I used keep original audio.

#!/bin/bash

. /usr/local/bin/striptracks.sh --audio :org --subs :eng:und

this is the logs for specific issue that it's keeping only the commentary audio and original audio subtitle.

2023-6-9 14:38:16.5|[1563]Info|Sonarr event: Download, Video: /anime/Monogatari (2009)/Season 01/Monogatari (2009) - S01E01 - 001 - Hitagi Crab Part 1 [HDTV-1080p v2][10bit][x264][AAC 2.0][JA]-MTBB.mkv, Size: 881.124M, AudioKeep: , SubsKeep: :eng:und
2023-6-9 14:38:17.3|[1563]Info|Original tracks: 6 (audio: 2, subtitles: 3)
2023-6-9 14:38:17.3|[1563]Info|Chapters: 5
2023-6-9 14:38:17.3|[1563]Info|Keeping last audio track 2: jpn (AAC)
2023-6-9 14:38:17.3|[1563]Info|Keeping subtitles track 3: eng (SubStationAlpha)
2023-6-9 14:38:17.3|[1563]Info|Keeping subtitles track 5: eng (SubStationAlpha)
2023-6-9 14:38:17.3|[1563]Info|Removed audio tracks: 1: jpn (AAC)
2023-6-9 14:38:17.3|[1563]Info|Removed subtitles tracks: 4: enm (SubStationAlpha)
2023-6-9 14:38:17.3|[1563]Info|Kept tracks: 4 (audio: 1, subtitles: 2)
2023-6-9 14:38:41.0|[1563]Info|New size: 832.225M
2023-6-9 14:38:41.1|[1563]Info|Calling Sonarr API to rescan series, try #1
2023-6-9 14:38:43.9|[1563]Info|Completed in 0m 28s

Note: for now I imported this specific season by disabling striptracks as I wanted all that it have mostly. but if I plan to import more BD disks that have commentary in them,

I checked also on using tags but might be an issue as I mostly pull from lists like trakt and anilist. and language might vary. and checking them 1 by 1 would be an issue as family member also uses lists, and only have access to adding shows to lists.

TheCaptain989 commented 1 year ago

You've just encountered a limitation of Sonarr. Specifying :org is only supported on Radarr (the last time I checked Sonarr it didn't have that capability.) I do document this in my README.

I'll check again, though.

What's happening is that you're effectively selecting no audio tracks. This is evidenced by the AudioKeep: , text on the first log entry and Keeping last audio track on the fourth log entry. However, I do think my script could handle this situation better. Let me think on that.

For your purposes, please discontinue the use of :org in Sonarr. Either create a Language Profile with the specific language(s) you want to keep, or use a wrapper with all possible languages. Something like:

#!/bin/bash

. /usr/local/bin/striptracks.sh --audio :ara:bul:zho:chi:ces:cze:dan:nld:dut:eng:fin:fra:fre:deu:ger:ell:gre:heb:hin:hun:isl:ice:ita:jpn:kor:lit:nor:pol:por:ron:rom:rus:spa:swe:tha:tur:vie:und --subs :eng:und

Inelegant, but I don't have a better way right now. (See issue thecaptain989/striptracks#42 for some additional background.)

TheCaptain989 commented 1 year ago

I've just pushed a new version that adds more warning messages, and will not exit if the code evaluates to selecting no audio languages.

rmnavz commented 1 year ago

Hi @TheCaptain989, thank you for quickly responding and attending to this appreciate it big time.

Will try to create a separate wrapper for sonarr without using org tag language.

btw if I use jpn (or any specific languages) tag for audio will it keep both audio for main audio track and commentary track? image

or does it only keep 1 of the specified languages?

TheCaptain989 commented 1 year ago

No problem.

It will keep all tracks that match the language(s) you specify. In your example, if you specify --audio :jpn both tracks would be kept.