A shell script to automatically remove common annoying scene branding and attribution entries from subtitle files. Only .SRT format subtitles are supported.
-
Place the
cleansubs.sh
shell script file in the root directory of Bazarr, usually/config
-
Configure a custom script from the Bazarr Settings > Subtitles screen to call:
/config/cleansubs.sh "{{subtitles}}" ;
from the Post-processing command field. Note the double quotes!
NOTE: The original subtitle file will be deleted/overwritten and permanently lost.
The script is not configurable.
The string matching only supports English at this time.
The script accepts one argument:
<subtitle_file>
The argument is the full path and file name to a subtitle file. In Bazarr, you should use the {{subtitles}}
variable.
Logs are integrated into the Bazarr log file. The text output of the script is designed to be compatible with the Bazarr log file format. This has been tested with Bazarr version(s):
- v0.8.2.4 - v1.1.1
Example log entry with no changes
Example log entry post cleaning
Removed subtitle entries are included in the Bazarr "Exception" details of each log entry.
This would not be possible without the following:
Bazarr
LinuxServer.io Bazarr container