Use short syntax for comment entry-point detection

Co-authored-by: Samantaz Fox <coding@samantaz.fr>
This commit is contained in:
syeopite 2023-09-17 18:30:06 +00:00 committed by syeopite
parent 83953d7fc2
commit a455df4a6e
No known key found for this signature in database
GPG Key ID: A73C186DA3955A1A

View File

@ -383,7 +383,7 @@ def parse_video_info(video_id : String, player_response : Hash(String, JSON::Any
# When comments are enabled there should be a comments-entry-point section in the primary results # When comments are enabled there should be a comments-entry-point section in the primary results
if primary_results if primary_results
section = primary_results.as_a.find { |s| s.dig?("itemSectionRenderer", "sectionIdentifier") == "comments-entry-point" } section = primary_results.as_a.find(&.dig?("itemSectionRenderer", "sectionIdentifier").== "comments-entry-point")
if section if section
comments_enabled = true comments_enabled = true