Invidious is an alternative front-end to YouTube
fix likes parsing
Emilien Devos960bd2a6be5d
diff --git a/src/invidious/comments.cr b/src/invidious/comments.crindex 5d72503e..81d6ac2b 100644--- a/src/invidious/comments.cr+++ b/src/invidious/comments.cr@@ -185,12 +185,14 @@ def fetch_youtube_comments(id, db, cursor, format, locale, thin_mode, region, sojson.field "published", published.to_unixjson.field "publishedText", translate(locale, "`x` ago", recode_date(published, locale))- json.field "likeCount", node_comment["likeCount"]+ comment_action_buttons_renderer = node_comment["actionButtons"]["commentActionButtonsRenderer"]++ json.field "likeCount", comment_action_buttons_renderer["likeButton"]["toggleButtonRenderer"]["accessibilityData"]["accessibilityData"]["label"].as_s.scan(/\d/).map(&.[0]).join.to_ijson.field "commentId", node_comment["commentId"]json.field "authorIsChannelOwner", node_comment["authorIsChannelOwner"]- if node_comment["actionButtons"]["commentActionButtonsRenderer"]["creatorHeart"]?- hearth_data = node_comment["actionButtons"]["commentActionButtonsRenderer"]["creatorHeart"]["creatorHeartRenderer"]["creatorThumbnail"]+ if comment_action_buttons_renderer["creatorHeart"]?+ hearth_data = comment_action_buttons_renderer["creatorHeart"]["creatorHeartRenderer"]["creatorThumbnail"]json.field "creatorHeart" dojson.object dojson.field "creatorThumbnail", hearth_data["thumbnails"][-1]["url"]