support for alt source, sorta
This commit is contained in:
1 parent
2920eab017
commit
820013c309
1 file changed
+14
@@ -33,6 +33,19 @@ end
|
||||
|
||||
local output_lines = {}
|
||||
local timecode_free_lines = {}
|
||||
|
||||
if arg[2] == "--tube" then -- transcript from https://tubetranscript.com/
|
||||
for i = 4, #input_lines do
|
||||
local line = input_lines[i]
|
||||
output_lines[#output_lines + 1] = line
|
||||
|
||||
line = line:sub(9)
|
||||
if line:sub(1, 1) == ")" then -- handle very long videos
|
||||
line = line:sub(3)
|
||||
end
|
||||
timecode_free_lines[#timecode_free_lines + 1] = line
|
||||
end
|
||||
else
|
||||
for index, line in ipairs(input_lines) do
|
||||
if not (line:sub(3, 3) == ":") then
|
||||
local previous_line = input_lines[index - 1]
|
||||
@@ -48,6 +61,7 @@ for index, line in ipairs(input_lines) do
|
||||
timecode_free_lines[#timecode_free_lines + 1] = line:sub(7)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local output_file = io.open(output_file_name, "w")
|
||||
assert(output_file, "Could not open \"" .. output_file_name .. "\"")
|
||||
|
||||
Reference in new issue
Block a user