Skip to content

Instantly share code, notes, and snippets.

@scan
Created October 1, 2014 12:58
Show Gist options
  • Save scan/88ba54a7707adcac23a5 to your computer and use it in GitHub Desktop.
Save scan/88ba54a7707adcac23a5 to your computer and use it in GitHub Desktop.
SubRip .srt to WebVTT .vtt converter
#!/usr/bin/env perl -w
print "WEBVTT\n\n";
while(<>) {
s/(\d),(\d)/$1.$2/g if /--\>/;
s/^[ \t]+//;
s/[ \t]+$//;
s/\r\n$/\n/;
print;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment