mirror of
https://github.com/iv-org/invidious.git
synced 2025-06-28 09:38:31 +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|
|
initial_segments.each do |line|
|
||||||
if unpacked_line = line["transcriptSectionHeaderRenderer"]?
|
if unpacked_line = line["transcriptSectionHeaderRenderer"]?
|
||||||
line_type = HeadingLine
|
line_type = HeadingLine
|
||||||
|
text = (unpacked_line.dig?("sectionHeader", "sectionHeaderViewModel", "headline", "content").try &.as_s) || ""
|
||||||
else
|
else
|
||||||
unpacked_line = line["transcriptSegmentRenderer"]
|
unpacked_line = line["transcriptSegmentRenderer"]
|
||||||
|
text = extract_text(unpacked_line["snippet"]) || ""
|
||||||
line_type = RegularLine
|
line_type = RegularLine
|
||||||
end
|
end
|
||||||
|
|
||||||
start_ms = unpacked_line["startMs"].as_s.to_i.millisecond
|
start_ms = unpacked_line["startMs"].as_s.to_i.millisecond
|
||||||
end_ms = unpacked_line["endMs"].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)
|
lines << line_type.new(start_ms, end_ms, text)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user