Skip to content

Shell script to clean subtitle files. Meant to be called by Bazarr.

Notifications You must be signed in to change notification settings

eturk1/bazarr-cleansubs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 

Repository files navigation

About

A shell script to automatically remove common annoying scene branding and attribution entries from subtitle files. Only .SRT format subtitles are supported.

Installation

  1. Place the cleansubs.sh shell script file in the root directory of Bazarr, usually /config

  2. 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!

    Example
    cleansubs

    NOTE: The original subtitle file will be deleted/overwritten and permanently lost.

Usage

The script is not configurable.
The string matching only supports English at this time.

Syntax

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

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
normal log

Example log entry post cleaning
cleaned subtitle log

Removed subtitle entries are included in the Bazarr "Exception" details of each log entry.
cleaned subtitle log detail


Credits

This would not be possible without the following:

Bazarr
LinuxServer.io Bazarr container

About

Shell script to clean subtitle files. Meant to be called by Bazarr.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%