Invidious is an alternative front-end to YouTube
Fix non-existent 'content_html' on empty comment section
Omar Rotha5fb1d38e042
diff --git a/src/invidious.cr b/src/invidious.crindex 30a27058..ce518a08 100644--- a/src/invidious.cr+++ b/src/invidious.cr@@ -1708,7 +1708,12 @@ get "/api/v1/comments/:id" do |env|ctoken = body.match(/'COMMENTS_TOKEN': "(?<ctoken>[^"]+)"/)if !ctokenenv.response.content_type = "application/json"++ if format == "json"next {"comments" => [] of String}.to_json+ else+ next {"content_html" => ""}.to_json+ endendctoken = ctoken["ctoken"]itct = body.match(/itct=(?<itct>[^"]+)"/).not_nil!["itct"]