Skip to main content

CLI SubRip editor

Project description

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

In the project's root directory, 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
  • May join files together

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fsub-0.1.2.tar.gz (17.3 kB view hashes)

Uploaded Source

Built Distribution

fsub-0.1.2-py3-none-any.whl (18.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page