Created
October 1, 2014 12:58
-
-
Save scan/88ba54a7707adcac23a5 to your computer and use it in GitHub Desktop.
SubRip .srt to WebVTT .vtt converter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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