From 9ce02e579d8f70862788f7af57007647bd4970c1 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Sun, 25 Nov 2018 18:16:56 -0600 Subject: [PATCH] Update '/api/v1/popular' --- src/invidious.cr | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/invidious.cr b/src/invidious.cr index cd1da476..5fa57ea4 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -2617,20 +2617,13 @@ get "/api/v1/popular" do |env| generate_thumbnails(json, video.id) end - json.field "lengthSeconds", video.info["length_seconds"].to_i - json.field "viewCount", video.views + json.field "lengthSeconds", video.length_seconds json.field "author", video.author json.field "authorId", video.ucid json.field "authorUrl", "/channel/#{video.ucid}" json.field "published", video.published.to_unix json.field "publishedText", "#{recode_date(video.published)} ago" - - description = video.description.gsub("
", "\n") - description = description.gsub("
", "\n") - description = XML.parse_html(description) - json.field "description", description.content - json.field "descriptionHtml", video.description end end end