CLI SubRip editor PyPi: https://pypi.org/project/fsub
Go to file
Augusto Gunsch 13874b3363
Add --join to the README's usage
2021-11-15 18:17:30 -03:00
src/fsub Add join flag 2021-11-15 18:14:33 -03:00
tests Add join flag 2021-11-15 18:14:33 -03:00
.gitignore Add join flag 2021-11-15 18:14:33 -03:00
LICENSE Add LICENSE 2021-11-14 16:01:34 -03:00
README.md Add --join to the README's usage 2021-11-15 18:17:30 -03:00
build.sh Restructure project 2021-11-14 18:06:21 -03:00
pyproject.toml Restructure project 2021-11-14 18:06:21 -03:00
requirements.txt Rewrite script in Python 2021-11-14 15:49:35 -03:00
setup.cfg Fix program name 2021-11-14 20:39:01 -03:00

README.md

fsub

fsub is a Python script for cleaning, editing and fixing a SubRip (.srt) file

Installation

Through Python's pip:

pip install fsub

Usage

usage: fsub [-h] [-c] [-s MS] [-n] [-f FILE] [-j] file [file ...]

Fix, edit and clean SubRip (.srt) files.

positional arguments:
  file                  list of input files (they all must be SubRip files)

optional arguments:
  -h, --help            show this help message and exit
  -c, --clean           remove subtitles matching regular expressions listed in the config
                        file (this is the default behavior if no other flag is passed)
  -s MS, --shift MS     shift all subtitles by MS milliseconds, which may be positive or
                        negative
  -n, --no-html         strip HTML tags from subtitles content
  -f FILE, --config-file FILE
                        overwrite the default config file (Unix: $HOME/.config/fsubrc,
                        Windows: %APPDATA%\fsubrc)
  -j, --join            join all files into the first, shifting their time accordingly (this
                        will delete files)

Testing

Run all the tests with:

python -m unittest tests

Or, just the unit/integration tests:

python -m unittest tests.unit
python -m unittest tests.integration

Features

  • Fixes subtitle numbering
  • Converts files to UTF-8 encoding
  • Validates file structure
  • May remove subtitles containing lines that match any regular expression listed in the config file (by default on Unix: $HOME/.config/fsubrc; on Windows: %APPDATA%\fsubrc)
  • May shift the time of all subtitles
  • May strip HTML