From da8681c8c4b914f71ac465858aa2ebb103e81d5b Mon Sep 17 00:00:00 2001 From: MrPetovan Date: Tue, 19 Mar 2024 12:56:08 -0400 Subject: [PATCH] [invidious] Drop support for the addon - Please use the URL replace addon instead --- invidious/invidious.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/invidious/invidious.php b/invidious/invidious.php index ec16b4dc..1078d26d 100644 --- a/invidious/invidious.php +++ b/invidious/invidious.php @@ -5,7 +5,8 @@ * Version: 0.3 * Author: Matthias Ebers * Author: Michael Vogel - * + * Status: Unsupported + * Note: Please use the URL Replace addon instead */ use Friendica\Core\Hook; @@ -91,7 +92,7 @@ function invidious_render(array &$b) $original = $b['html']; $server = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'invidious', 'server', DI::config()->get('invidious', 'server', INVIDIOUS_DEFAULT)); - + $b['html'] = preg_replace("/https?:\/\/www.youtube.com\/watch\?v\=(.*?)/ism", $server . '/watch?v=$1', $b['html']); $b['html'] = preg_replace("/https?:\/\/www.youtube.com\/embed\/(.*?)/ism", $server . '/embed/$1', $b['html']); $b['html'] = preg_replace("/https?:\/\/www.youtube.com\/shorts\/(.*?)/ism", $server . '/shorts/$1', $b['html']);