GoSaveTool for Perl
Parse, convert, shift and repair SRT and WebVTT subtitles, and count words, characters and reading time with social media character limits, Title Case, slugs and other case changes. Perl 5.10+, nothing outside the core.
Made by GoSaveTool, free online tools for creators.
Install
cpanm GoSaveTool
Subtitles
use GoSaveTool::Subtitles qw(convert parse shift_cues repair to_srt);
my $vtt = convert($srt_text, 'vtt');
my $cues = parse($text); # [ { start => 1000, end => 3500, settings => '', text => 'Hello' }, ... ]
my $later = to_srt(shift_cues($cues, 1500)); # 1.5 s later
my ($fixed, $n) = repair($cues); # sorted, no overlaps, no empty cues
Text
use utf8;
use GoSaveTool::Text qw(stats limits title sentence slug camel clean);
my $st = stats($post); # words, chars, charsNoSpaces, lines, sentences, readSeconds
print limits($post)->{'x-post'}{left}, " characters left\n";
print title('the lord of the rings'); # The Lord of the Rings
print slug('Ölçü Birimi & Çeviri!'); # olcu-birimi-ceviri
print camel('best posting time'); # bestPostingTime
Limits: X post, Instagram caption, TikTok caption, YouTube title and description, LinkedIn post, Pinterest description, SEO title, meta description. Characters are Unicode code points, so an emoji counts as one. The results are the same as the @gosavetool/text and @gosavetool/subtitles JavaScript packages.
Full documentation: perldoc GoSaveTool::Subtitles, perldoc GoSaveTool::Text.
Tests
prove -l t
Online tools
VTT Subtitle Generator, Auto Captions Generator, Character Counter
License
MIT