support for alt source, sorta

This commit is contained in:
tangent committed 2026-10-03 07:53:23 -06:00
1 parent 2920eab017
commit 820013c309
1 file changed
+15 -1
+15 -1
View File
@@ -33,7 +33,20 @@ end
local output_lines = {} local output_lines = {}
local timecode_free_lines = {} local timecode_free_lines = {}
for index, line in ipairs(input_lines) do
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 if not (line:sub(3, 3) == ":") then
local previous_line = input_lines[index - 1] local previous_line = input_lines[index - 1]
if previous_line and previous_line:sub(3, 3) == ":" then if previous_line and previous_line:sub(3, 3) == ":" then
@@ -47,6 +60,7 @@ for index, line in ipairs(input_lines) do
output_lines[#output_lines + 1] = "`" .. line .. "`" output_lines[#output_lines + 1] = "`" .. line .. "`"
timecode_free_lines[#timecode_free_lines + 1] = line:sub(7) timecode_free_lines[#timecode_free_lines + 1] = line:sub(7)
end end
end
end end
local output_file = io.open(output_file_name, "w") local output_file = io.open(output_file_name, "w")