This repository contains various Python scripts for processing subtitle and lyrics files, including .ass
, .srt
, and .lrc
formats. These scripts provide functionalities such as reversing, splitting, swapping, converting, merging, and shifting subtitle timestamps.
- ASS File Manipulation:
ass_reverse.py
: Reverses the order of certain dialogue lines in.ass
files.ass_splitlines.py
: Splits lines with\N
into separate subtitle entries.ass_swapline.py
: Swaps adjacent dialogue lines in.ass
files.
- SRT and LRC Conversions:
lrc2srt.py
: Converts.lrc
lyric files to.srt
subtitle format.srt2ass.py
: Converts.srt
subtitle files to.ass
(Advanced SubStation Alpha) format.srt2lrc.py
: Converts.srt
files to.lrc
format.
- Subtitle Merging & Adjustments:
srt_merge.py
: Merges multiple.srt
files into one while maintaining correct timestamps.srt_timeshift.py
: Adjusts timestamps in.srt
files by a specified number of seconds.
These scripts require Python 3.x to run. Ensure you have it installed before using them.
Most scripts work with built-in Python libraries. However, srt_merge.py
requires chardet
. You can install it using:
pip install chardet
Each script is executed via the command line. Below are examples for using each script:
python ass_reverse.py input.ass
python ass_splitlines.py input.ass output.ass
python ass_swapline.py input.ass output.ass
python lrc2srt.py input.lrc output.srt
python srt2ass.py input.srt
python srt2lrc.py input.srt output.lrc
python srt_merge.py file1.srt file2.srt merged.srt
python srt_timeshift.py input.srt
Follow the on-screen prompt to enter the shift time.
If you'd like to contribute, feel free to fork the repo and submit pull requests with improvements or additional features.
This project is licensed under the MIT License. See LICENSE for more details.
For any issues or feature requests, please open an issue on the GitHub repository.