video parsing: add secondary_results root element

pull/2856/head
Samantaz Fox 3 years ago
parent 99091e919c
commit d7ebd763f5
No known key found for this signature in database
GPG Key ID: F42821059186176E

@ -890,8 +890,11 @@ def extract_video_info(video_id : String, proxy_region : String? = nil, context_
raise BrokenTubeException.new("twoColumnWatchNextResults") if !main_results
primary_results = main_results.dig?("results", "results", "contents")
secondary_results = main_results
.dig?("secondaryResults", "secondaryResults", "results")
raise BrokenTubeException.new("results") if !primary_results
raise BrokenTubeException.new("secondaryResults") if !secondary_results
video_primary_renderer = primary_results
.as_a.find(&.["videoPrimaryInfoRenderer"]?)

Loading…
Cancel
Save