mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-14 06:10:35 +05:30
Update '/api/v1/popular'
This commit is contained in:
parent
32e4ad0784
commit
9ce02e579d
@ -2617,20 +2617,13 @@ get "/api/v1/popular" do |env|
|
|||||||
generate_thumbnails(json, video.id)
|
generate_thumbnails(json, video.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
json.field "lengthSeconds", video.info["length_seconds"].to_i
|
json.field "lengthSeconds", video.length_seconds
|
||||||
json.field "viewCount", video.views
|
|
||||||
|
|
||||||
json.field "author", video.author
|
json.field "author", video.author
|
||||||
json.field "authorId", video.ucid
|
json.field "authorId", video.ucid
|
||||||
json.field "authorUrl", "/channel/#{video.ucid}"
|
json.field "authorUrl", "/channel/#{video.ucid}"
|
||||||
json.field "published", video.published.to_unix
|
json.field "published", video.published.to_unix
|
||||||
json.field "publishedText", "#{recode_date(video.published)} ago"
|
json.field "publishedText", "#{recode_date(video.published)} ago"
|
||||||
|
|
||||||
description = video.description.gsub("<br>", "\n")
|
|
||||||
description = description.gsub("<br/>", "\n")
|
|
||||||
description = XML.parse_html(description)
|
|
||||||
json.field "description", description.content
|
|
||||||
json.field "descriptionHtml", video.description
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user