Invidious is an alternative front-end to YouTube
Fix simpleText in comments extractor
Omar Rothca79e81b3956
diff --git a/src/invidious/comments.cr b/src/invidious/comments.crindex 51c092ac..7f593760 100644--- a/src/invidious/comments.cr+++ b/src/invidious/comments.cr@@ -114,8 +114,10 @@ def fetch_youtube_comments(id, db, continuation, proxies, format, locale, thin_mcomments = JSON.build do |json|json.object doif body["header"]?- comment_count = body["header"]["commentsHeaderRenderer"]["countText"]["runs"][0]?- .try &.["text"].as_s.gsub(/\D/, "").to_i? || 0+ count_text = body["header"]["commentsHeaderRenderer"]["countText"]+ comment_count = (count_text["simpleText"]? || count_text["runs"]?.try &.[0]?.try &.["text"]?)+ .try &.as_s.gsub(/\D/, "").to_i? || 0+json.field "commentCount", comment_countend@@ -192,7 +194,8 @@ def fetch_youtube_comments(id, db, continuation, proxies, format, locale, thin_mendif node_replies && !response["commentRepliesContinuation"]?- reply_count = node_replies["moreText"]["runs"][0]?.try &.["text"].as_s.gsub(/\D/, "").to_i? || 1+ reply_count = (node_replies["moreText"]["simpleText"]? || node_replies["moreText"]["runs"]?.try &.[0]?.try &.["text"]?)+ .try &.as_s.gsub(/\D/, "").to_i? || 1continuation = node_replies["continuations"]?.try &.as_a[0]["nextContinuationData"]["continuation"].as_scontinuation ||= ""