Created
January 20, 2019 23:50
-
-
Save pavels/0fb78287560feb3f35fd9f44cdbf8626 to your computer and use it in GitHub Desktop.
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
#!/bin/ruby | |
require 'rubygems' | |
require 'bundler' | |
Bundler.setup(:default) | |
require 'srt' | |
file = SRT::File.parse(File.new(ARGV[0])) | |
outfile_name = File.basename(ARGV[0], '.srt') + '.txt' | |
File.open(outfile_name, "w") do |f| | |
file.lines.each do |line| | |
f.puts line.text.join(" ") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment