Invidious is an alternative front-end to YouTube
Fix for /comments/ where there is only one comment
Omar Roth6aeb508f291e
diff --git a/src/invidious.cr b/src/invidious.crindex b1a59dcb..7fdfbcfe 100644--- a/src/invidious.cr+++ b/src/invidious.cr@@ -568,7 +568,7 @@ get "/api/v1/comments/:id" do |env|comments = JSON.build do |json|json.object doif body["header"]?- comment_count = body["header"]["commentsHeaderRenderer"]["countText"]["simpleText"].as_s.rchop(" Comments").delete(',').to_i+ comment_count = body["header"]["commentsHeaderRenderer"]["countText"]["simpleText"].as_s.rchop(" Comment").delete("s,").to_ijson.field "commentCount", comment_countend