Subtitle shift by Syed-56 · Pull Request #540 · wasmerio/Python-Scripts
PR Title
Add Subtitle Shifter Script to Shift .srt Timings Forward/Backward
Summary
Added a Python script that allows users to shift subtitle timings by a specified number of seconds (positive or negative). The script supports .srt files and saves the shifted subtitles as a new file.
Description
This script helps when subtitles are out of sync with the video. Users can provide the subtitle file path and the number of seconds to shift. The script uses the pysubs2 library (MIT-licensed) to handle .srt files safely.
The changes are as follows:
- Added subtitle_shifter.py to shift subtitle timings.
- Implemented CLI input for subtitle file and shift duration.
- Outputs a new .srt file with adjusted timings.
- Added simple checks for file extension and user-friendly prompts.
Checks
in the repository
- Made no changes that degrades the functioning of the repository
- Gave each commit a better title (unlike updated README.md)
in the PR
- Followed the format of the pull_request_template
- Made the Pull Request in a small level (for the creator's wellfare)
- Tested the changes you made
Thank You,
Syed Sultan