Invidious is an alternative front-end to YouTube
Add 'publishedText' to API endpoints
Omar Rothd3eadccd51d5
diff --git a/src/invidious.cr b/src/invidious.crindex 9cf120c5..c5eea78b 100644--- a/src/invidious.cr+++ b/src/invidious.cr@@ -1980,6 +1980,7 @@ get "/api/v1/comments/:id" do |env|json.field "content", contentjson.field "contentHtml", content_htmljson.field "published", published.epoch+ json.field "publishedText", "#{recode_date(video.published)} ago"json.field "likeCount", node_comment["likeCount"]json.field "commentId", node_comment["commentId"]@@ -2098,6 +2099,7 @@ get "/api/v1/videos/:id" do |env|json.field "description", descriptionjson.field "descriptionHtml", video.descriptionjson.field "published", video.published.epoch+ json.field "publishedText", "#{recode_date(video.published)} ago"json.field "keywords" dojson.array dovideo.info["keywords"].split(",").each { |keyword| json.string keyword }@@ -2275,6 +2277,7 @@ get "/api/v1/trending" do |env|json.field "authorUrl", "/channel/#{video.ucid}"json.field "published", video.published.epoch+ json.field "publishedText", "#{recode_date(video.published)} ago"json.field "description", video.descriptionjson.field "descriptionHtml", video.description_htmlend@@ -2303,6 +2306,7 @@ get "/api/v1/top" do |env|json.field "author", video.authorjson.field "authorUrl", "/channel/#{video.ucid}"json.field "published", video.published.epoch+ json.field "publishedText", "#{recode_date(video.published)} ago"description = video.description.gsub("<br>", "\n")description = description.gsub("<br/>", "\n")@@ -2486,6 +2490,7 @@ get "/api/v1/channels/:ucid" do |env|json.field "viewCount", video.viewsjson.field "published", video.published.epoch+ json.field "publishedText", "#{recode_date(video.published)} ago"json.field "lengthSeconds", video.length_secondsendend@@ -2585,6 +2590,7 @@ get "/api/v1/channels/:ucid/videos" do |env|json.field "viewCount", video.viewsjson.field "published", video.published.epoch+ json.field "publishedText", "#{recode_date(video.published)} ago"json.field "lengthSeconds", video.length_secondsendend@@ -2650,6 +2656,7 @@ get "/api/v1/search" do |env|json.field "viewCount", video.viewsjson.field "published", video.published.epoch+ json.field "publishedText", "#{recode_date(video.published)} ago"json.field "lengthSeconds", video.length_secondsendend