Closed Strux-DK closed 4 months ago
The script can absolutely do this. The batch example is just that, an example only. It will try to convert whatever file you pass to it, but will just log an error if it is not a known file type to mkvmerge.
Thanks for the answer! Can you help me with the syntax of the command and where to run it, or where i can read the information i need?
I'm not sure exactly which audio or subs you want to keep, but for example you could try:
find /movies/ -type f | while read file
do /usr/local/bin/striptracks.sh -f "$file" -a :eng:fre:und -s :eng:fre:und
done
To pass every file from your /movies
folder to the script, and if it's a video it would keep only English and French audio and subtitles. It would also keep untagged or unknown tracks for safety.
Please be careful when you do something like this. You could accidentally nuke your whole video library if you typo the wrong language code for example. Please test on a few files to be sure it is doing what you want.
It doesn't seem to work. I should be running it inside either the radarr or the sonarr containers, right? That's where the script is. I run:
find HP-test/ -type f | while read file; do /usr/local/bin/striptracks.sh -f "$file" -a :eng:dan:und -s :eng:dan:und
With HP-test being a folder with a small number of movies.
When i run it, all that happens is it makes a '>' like this:
What am i doing wrong?
I've been responding on my phone, which is not the easiest to troubleshoot from. I likely mistyped something above. Please forgive me, it will be a couple of weeks before I can respond properly.
Sorry for the delay. Please check out this example below:
find HP-test/ -type f | while read file; do if file -i "$file" | grep -q video; then /usr/local/bin/striptracks.sh -f "$file" -a :eng:dan:und -s :eng:dan:und; fi; done
Thanks, i will try it out, hopefully later today. Now that i have your expertise, how can i verify that the script is being run against new media? Is there a log line i can search for?
I'm getting the following output, what does that tell you? Is it expected?
To me, that means you don't have the "file" executable.
Can you please type file -v
at the command line? I would expect the output to be something like:
$ file -v
file-5.44
magic file from /usr/share/misc/magic
Dang. Is that something that should be included or something i should've installed by myself?
Well, that explains it. That was my attempt at safely running this on all video files only. Oh, well.
This should work:
find HP-test/ -type f | while read file; do /usr/local/bin/striptracks.sh -f "$file" -a :eng:dan:und -s :eng:dan:und; done
Please be careful when you do something like this. Please test on a few files to be sure it is doing what you want. I'm not 100% sure what it will do to non-video files.
well, im running the script in the container for Radarr and Sonarr and i guess they only have what is absolutely necessary. Should i run it on the docker host instead?
No, my script will likely not work outside of the container. I just had a thought, you could try running apt install file
(inside the container) and see if that works. If it does, try running my one liner from 2 days ago again.
Apparently that cant be done
How about apt-get install file
?
Nope, can't do that either
Oh, well. Give the last one-liner script I posted a try, just not on your entire library yet.
To answer your earlier question, all the script activity will be logged so you can check what it did afterwards.
It seems everything is working. I found out i used the wrong package manager and by using the right one i was able to install 'file' and use the first one-liner on a small test directory. I checked the logs and found that it did what i wanted it to.
I also saw in the logs, that it removed the danish language and subtitles from other movies that i recently downloaded, apart from this little test. Upon analyzing this, i found i have made a Custom format, 'STD Language' with Danish and English in it, but made none of them required. Would that be the reason why it removed Danish, along with other languages, instead of keeping it?
Oh, good deal!
Custom Formats are not easy to understand. What works for me is making one format with the two languages I want Negated and Required, and then score that format as a -1000 in the Profile. Also make sure you select 'Any' as the profile language in Radarr (not required in Sonarr). Check this section of my docs for more info.
TRaSH Guides made a much better explainer than I ever could about this.
Custom Format:
Profile:
Thanks! I looked at Thrash's site and found an alternative that i think fits the bill. Will have to check in a couple of days. But thanks for the help with this :)
No problem.
Hey, Sorry for opening an issue for this, if that's not the correct thing to do.
I want to clean up my media that is riddled with languages and subtitles from all over the world. I recently added the striptracks mod onto Sonarr and Radarr for doing that. Is there a way to manually run the script against existing media? It seems there is a batch mode, but that also requires one to know all media files extensions in the library, which i have no idea of. I just want all media to have audio and subtitles in 2 languages, no more and no less. Can that be (easily) done with this script or is there another easier way?