From 36dc0cc1e73bf9a32c44df5384dda77b14bd77c2 Mon Sep 17 00:00:00 2001 From: jazzzooo <38244149+jazzzooo@users.noreply.github.com> Date: Wed, 13 Sep 2023 05:36:41 +0000 Subject: [PATCH] [fix] engine - invidious thumbnails --- searx/engines/invidious.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/searx/engines/invidious.py b/searx/engines/invidious.py index 29f276636..566b0cf98 100644 --- a/searx/engines/invidious.py +++ b/searx/engines/invidious.py @@ -5,7 +5,7 @@ import time import random -from urllib.parse import quote_plus +from urllib.parse import quote_plus, urlparse from dateutil import parser # about @@ -75,6 +75,11 @@ def response(resp): else: thumbnail = "" + # some instances return a partial thumbnail url + # we check if the url is partial, and prepend the base_url if it is + if thumbnail and not urlparse(thumbnail).netloc: + thumbnail = resp.search_params['base_url'] + thumbnail + publishedDate = parser.parse(time.ctime(result.get("published", 0))) length = time.gmtime(result.get("lengthSeconds")) if length.tm_hour: