Skip to content

A utility that contains various Python scripts for processing subtitle and lyrics files

License

Notifications You must be signed in to change notification settings

nuloperrito/SubtitleLyricsTools

Repository files navigation

Subtitle and Lyrics Processing Tools

Overview

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.

Features

  • 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.

Installation

These scripts require Python 3.x to run. Ensure you have it installed before using them.

Dependencies

Most scripts work with built-in Python libraries. However, srt_merge.py requires chardet. You can install it using:

pip install chardet

Usage

Each script is executed via the command line. Below are examples for using each script:

Reversing ASS Subtitles

python ass_reverse.py input.ass

Splitting Lines in ASS Subtitles

python ass_splitlines.py input.ass output.ass

Swapping Dialogue Lines in ASS Subtitles

python ass_swapline.py input.ass output.ass

Converting LRC to SRT

python lrc2srt.py input.lrc output.srt

Converting SRT to ASS

python srt2ass.py input.srt

Converting SRT to LRC

python srt2lrc.py input.srt output.lrc

Merging Multiple SRT Files

python srt_merge.py file1.srt file2.srt merged.srt

Shifting Timestamps in SRT Files

python srt_timeshift.py input.srt

Follow the on-screen prompt to enter the shift time.

Contributing

If you'd like to contribute, feel free to fork the repo and submit pull requests with improvements or additional features.

License

This project is licensed under the MIT License. See LICENSE for more details.

Contact

For any issues or feature requests, please open an issue on the GitHub repository.

About

A utility that contains various Python scripts for processing subtitle and lyrics files

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages