add high res thumbnail

This commit is contained in:
Roy Olav Purser 2021-05-25 09:54:54 +02:00
parent d418b429aa
commit dc164fd377
Signed by: roypur
GPG Key ID: E14D26A036F21656
2 changed files with 10 additions and 1 deletions

View File

@ -381,6 +381,8 @@ class MainHandler(tornado.web.RequestHandler):
meta = await handler.meta()
image = meta.get("og:image")
if isinstance(image, str):
if handler.provider == "youtube":
image = image.removesuffix("hqdefault.jpg") + "maxresdefault.jpg"
url = await handler.proxy.proxy_url(image, None)
if isinstance(url, str):
self.redirect(url, status=303)

View File

@ -18,6 +18,11 @@
return url.href;
}
const getProvider = () => {
const search = new URLSearchParams(location.search);
return search.get("provider");
}
const upstream = findUpstreamVideo();
const xhr = new XMLHttpRequest();
xhr.open("HEAD", upstream, true);
@ -47,7 +52,9 @@
options.plugins.chromecast = {};
options.plugins.chromecast.addButtonToControlBar = false;
const player = videojs(video, options);
if(getProvider() !== "nextcloud") {
player.poster(findUpstreamPoster());
}
const source = {};
source.type = ctype;
source.src = upstream;