From c03ffa885fbbd5f9aec69b428226c2fc402d1c4f Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Tue, 25 May 2021 10:59:30 +0200 Subject: [PATCH] nextcloud video url --- backend/stream.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/backend/stream.py b/backend/stream.py index 429e854..4c828f9 100755 --- a/backend/stream.py +++ b/backend/stream.py @@ -364,19 +364,19 @@ class MainHandler(tornado.web.RequestHandler): self.write("HTML template missing.") async def handle_stream(self, handler, redir): - meta = await handler.meta() - image = meta.get("og:image") - if isinstance(image, str): - if handler.provider == "youtube" and image.endswith("hqdefault.jpg"): - image = image.removesuffix("hqdefault.jpg") + "maxresdefault.jpg" - image = await handler.proxy.proxy_url(image, None) - if isinstance(image, str): - self.set_header("Custom-Poster", image) + if handler.provider != "nextcloud": + meta = await handler.meta() + image = meta.get("og:image") + if isinstance(image, str): + if handler.provider == "youtube" and image.endswith("hqdefault.jpg"): + image = image.removesuffix("hqdefault.jpg") + "maxresdefault.jpg" + image = await handler.proxy.proxy_url(image, None) + if isinstance(image, str): + self.set_header("Custom-Poster", image) upstream = None if handler.provider == "nextcloud": - upstream = urllib.parse.urljoin(handler.upstream, "download") - logger.info(upstream) + upstream = urllib.parse.urljoin(handler.upstream, "/download") else: upstream = await stream_providers.get_any(handler.upstream, handler.proxy, logger) if upstream is None: