mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-06-27 17:38:25 +00:00
Fix extraction of transcript headings
Innertube structure was changed
This commit is contained in:
parent
b781036404
commit
f317e6620a
@ -80,14 +80,15 @@ module Invidious::Videos
|
||||
initial_segments.each do |line|
|
||||
if unpacked_line = line["transcriptSectionHeaderRenderer"]?
|
||||
line_type = HeadingLine
|
||||
text = (unpacked_line.dig?("sectionHeader", "sectionHeaderViewModel", "headline", "content").try &.as_s) || ""
|
||||
else
|
||||
unpacked_line = line["transcriptSegmentRenderer"]
|
||||
text = extract_text(unpacked_line["snippet"]) || ""
|
||||
line_type = RegularLine
|
||||
end
|
||||
|
||||
start_ms = unpacked_line["startMs"].as_s.to_i.millisecond
|
||||
end_ms = unpacked_line["endMs"].as_s.to_i.millisecond
|
||||
text = extract_text(unpacked_line["snippet"]) || ""
|
||||
|
||||
lines << line_type.new(start_ms, end_ms, text)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user