mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
Add fix for vdieo thumbnails where video is not HD
This commit is contained in:
parent
9fd0a02f16
commit
b3cad0355b
2 changed files with 11 additions and 3 deletions
|
@ -439,7 +439,11 @@ get "/watch" do |env|
|
|||
host_params = env.request.query_params
|
||||
host_params.delete_all("v")
|
||||
|
||||
thumbnail = "https://i.ytimg.com/vi/#{id}/maxresdefault.jpg"
|
||||
if fmt_stream.select { |x| x["label"].starts_with? "hd720" }.size != 0
|
||||
thumbnail = "https://i.ytimg.com/vi/#{video.id}/maxresdefault.jpg"
|
||||
else
|
||||
thumbnail = "https://i.ytimg.com/vi/#{video.id}/hqdefault.jpg"
|
||||
end
|
||||
|
||||
templated "watch"
|
||||
end
|
||||
|
@ -1525,7 +1529,11 @@ get "/embed/:id" do |env|
|
|||
host_params = env.request.query_params
|
||||
host_params.delete_all("v")
|
||||
|
||||
thumbnail = "https://i.ytimg.com/vi/#{id}/maxresdefault.jpg"
|
||||
if fmt_stream.select { |x| x["label"].starts_with? "hd720" }.size != 0
|
||||
thumbnail = "https://i.ytimg.com/vi/#{video.id}/maxresdefault.jpg"
|
||||
else
|
||||
thumbnail = "https://i.ytimg.com/vi/#{video.id}/hqdefault.jpg"
|
||||
end
|
||||
|
||||
rendered "embed"
|
||||
end
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<meta name="twitter:url" content="<%= host_url %>/watch?v=<%= video.id %>">
|
||||
<meta name="twitter:title" content="<%= HTML.escape(video.title) %>">
|
||||
<meta name="twitter:description" content="<%= description %>">
|
||||
<meta name="twitter:image" content="https://i.ytimg.com/vi/<%= video.id %>/maxresdefault.jpg">
|
||||
<meta name="twitter:image" content="<%= thumbnail %>">
|
||||
<meta name="twitter:player" content="<%= host_url %>/embed/<%= video.id %>">
|
||||
<meta name="twitter:player:width" content="1280">
|
||||
<meta name="twitter:player:height" content="720">
|
||||
|
|
Loading…
Reference in a new issue