No project description provided
Project description
srtedit
A command-line tool for quickly editing subtitle (.srt) files.
Installation
pip install srtedit
Basic Usage
Offset subtitles in milliseconds
srtedit subtitles.srt --offset 1000 -o modified.srt
Will add exactly 1 second to all subtitle elements. Conversely:
srtedit subtitles.srt --offset -1000 -o modified.srt
Will subtract 1 second from all subtitle elements.
Offset individual subtitle element
Use the -s/--select option to select an individual element to offset. Example:
srtedit subtitles.srt -s 1 --offset 2000 -o modified.srt
Will add 2s to the first subtitle element only.
View contents of subtitle element
srtedit subtitles.srt -s 1 --view
Will display the start/end times and the content of the selected element. Omitting the -s option will display all subtitle elements in the file.
Note: The output from --view is not compatible with the .srt format. You should use the -o/--output option when writing any files.
Remove subtitle element
Use the -r/--remove option to remove a selected element.
srtedit subtitles.srt -s 1 --remove -o modified.srt
Edit subtitle element
srtedit subtitles.srt -s 1 --edit "New text" -o modified.srt
Count number of elements
srtedit subtitles.srt --count
Multiple options
You can use multiple options together like this:
srtedit subtitles.srt -s 1 --edit "New text" --offset 1000 --view -o modified.srt
Will set the text of the first element to "New text" then add 1 second to the start and end times and then display the new values to the terminal and then finally write it to modified.srt
Disclaimer
Note that srtedit will select all subtitle elements by default. Omitting the -s/--select option will result in the specified operation (--edit/--remove/--offset) being applied to all elements.
Without specifying an output path, you can use the --view flag in conjuction with any of the operations above to see your changes before writing.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file srtedit-0.1.1.tar.gz.
File metadata
- Download URL: srtedit-0.1.1.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.2 Linux/6.1.0-32-amd64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54b2d71d998cd65cea030f6209048349fbbcbc5a029ee90f9cc7208d0464343e
|
|
| MD5 |
cfcf139144abb7ffb6068d2ee2c963fb
|
|
| BLAKE2b-256 |
aeb4b877533c4f7ea657bb9a738e2c5a640a1cff91ffb83a28072d20c28f70bc
|
File details
Details for the file srtedit-0.1.1-py3-none-any.whl.
File metadata
- Download URL: srtedit-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.2 Linux/6.1.0-32-amd64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d3d5f7ec88ab3ebf9c350fb752db307a77175dc8a64830febe93f7408eb3f6f
|
|
| MD5 |
1e16bc1c59efe475140fe804ccc6aec0
|
|
| BLAKE2b-256 |
162de210d3c27eb9068115e155668bbb2ec12ec0ba27192a95778bb47a0cbe91
|