mirror of
https://github.com/iv-org/invidious.git
synced 2026-09-06 09:02:45 -05:00
Update comment detection to not use msg renderer
This commit is contained in:
parent
23bc32e29a
commit
d67d032aa2
@ -296,16 +296,14 @@ module Invidious::Videos::Parser
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Comments enabled?
|
# Comments enabled?
|
||||||
comments_enabled = true
|
comments_enabled = false
|
||||||
|
|
||||||
# When comments are enabled the primary results should contain either the comments-entry-point
|
# When comments are enabled there should be a comments-entry-point section in the primary results
|
||||||
# or comment-item-section section
|
|
||||||
if primary_results
|
if primary_results
|
||||||
section = primary_results.as_a.find { |s| s.dig?("itemSectionRenderer", "sectionIdentifier") == "comment-item-section" }
|
section = primary_results.as_a.find { |s| s.dig?("itemSectionRenderer", "sectionIdentifier") == "comments-entry-point" }
|
||||||
|
|
||||||
# messageRenderer should say "Comments are turned off."
|
if section
|
||||||
if section && section.dig?("itemSectionRenderer", "contents", 0, "messageRenderer")
|
comments_enabled = true
|
||||||
comments_enabled = false
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user