Correct timestamps within subtitle files (.srt only lol) [=[==[[=[=
|
8 months ago | |
---|---|---|
serbur | 8 months ago | |
.editorconfig | 1 year ago | |
.gitignore | 2 years ago | |
LICENSE | 2 years ago | |
README.md | 8 months ago | |
srthax.pl | 8 months ago |
This shit allows you to correct the timestamps within subtitle files (.srt
and .ass
only lol). ;;];]]; As a b0nus, it also converts the files to use Linux-style line endings, cuz many are uploaded with Wind0ngs ones instead. It also shits out a bunch of warnings to help ya find inconsistencies within em subs y0.
Besides the main skrip, there's also a "server" thingy which I'm using from my k0di app so I can easily correct subs as I watch some shit. [=[[=[==[=[=[
srthax itself:
Data::Dumper
File::Slurp
Getopt::Mixed
The server script:
Config::IniFiles
Data::Dumper
File::Basename
IO::Handle
IO::Select
IO::Socket::INET
IO::Socket::SSL
srthax [options] <time shift> <subtitle file(s)>
Due to how Getopt::Mixed
works, if you want a negative time shift make sure to terminate the options with --
:
srthax -o -- -10 poop.srt
Simply run srthax --halp
to view the built-in halp and see all the supported options. ;] The server doesn't take any arguments but works with a config file. Just copy serbur/muhconf.ini.example
to serbur/muhconf.ini
and edit that shit, everything's explained in thur. ;];]];;] It also doesn't log anything by itself, all info is printed to stdout so you can do whatever you want with it. =] This also means it runs in the foreground and you should probably just run it within screen
/tmux
.
Note: if you shift subtitles by a negative amount, some lines may end up with negative timestamps too. Those are normally not even shown by the player so I'm not removing them. You can also pass a negative starting timestamp to srthax
if needed, although omitting the time will have it read the entire file anyways.