mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-08 13:42:27 +05:30
Update comment detection to not use msg renderer
This commit is contained in:
parent
b95d5604f8
commit
83953d7fc2
@ -379,16 +379,14 @@ def parse_video_info(video_id : String, player_response : Hash(String, JSON::Any
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Comments enabled?
|
# Comments enabled?
|
||||||
comments_enabled = true
|
|
||||||
|
|
||||||
# When comments are enabled the primary results should contain either the comments-entry-point
|
|
||||||
# or comment-item-section section
|
|
||||||
if primary_results
|
|
||||||
section = primary_results.as_a.find { |s| s.dig?("itemSectionRenderer", "sectionIdentifier") == "comment-item-section" }
|
|
||||||
|
|
||||||
# messageRenderer should say "Comments are turned off."
|
|
||||||
if section && section.dig?("itemSectionRenderer", "contents", 0, "messageRenderer")
|
|
||||||
comments_enabled = false
|
comments_enabled = false
|
||||||
|
|
||||||
|
# When comments are enabled there should be a comments-entry-point section in the primary results
|
||||||
|
if primary_results
|
||||||
|
section = primary_results.as_a.find { |s| s.dig?("itemSectionRenderer", "sectionIdentifier") == "comments-entry-point" }
|
||||||
|
|
||||||
|
if section
|
||||||
|
comments_enabled = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user