|
|
|
@ -41,9 +41,11 @@ module Invidious::Videos
|
|
|
|
|
if item.name == "body"
|
|
|
|
|
item.children.each do |cue|
|
|
|
|
|
if cue.name == "p"
|
|
|
|
|
if !(cue.children.size == 1 && cue.children[0].content == "\n")
|
|
|
|
|
cues << cue
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
break
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@ -71,13 +73,13 @@ module Invidious::Videos
|
|
|
|
|
start_time = "#{start_time.hours.to_s.rjust(2, '0')}:#{start_time.minutes.to_s.rjust(2, '0')}:#{start_time.seconds.to_s.rjust(2, '0')}.#{start_time.milliseconds.to_s.rjust(3, '0')}"
|
|
|
|
|
|
|
|
|
|
end_time = "#{end_time.hours.to_s.rjust(2, '0')}:#{end_time.minutes.to_s.rjust(2, '0')}:#{end_time.seconds.to_s.rjust(2, '0')}.#{end_time.milliseconds.to_s.rjust(3, '0')}"
|
|
|
|
|
text = String.build do |text|
|
|
|
|
|
|
|
|
|
|
result << start_time + " --> " + end_time + "\n"
|
|
|
|
|
|
|
|
|
|
node.children.each do |s|
|
|
|
|
|
text << s.content
|
|
|
|
|
result << s.content
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
result << start_time + " --> " + end_time + "\n"
|
|
|
|
|
result << text + "\n"
|
|
|
|
|
result << "\n"
|
|
|
|
|
result << "\n"
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|