From 92cedc88792580cfff6f8dcafcfb53191ee8b36a Mon Sep 17 00:00:00 2001
From: Tone <66808319+Tone866@users.noreply.github.com>
Date: Thu, 26 Mar 2026 15:59:59 +0100
Subject: [PATCH 01/13] add own hosted youtube iframe option
---
lib/html.php | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/lib/html.php b/lib/html.php
index 508cfa261bb..fcb8915758f 100644
--- a/lib/html.php
+++ b/lib/html.php
@@ -564,7 +564,7 @@ function handleYoutube(string $string)
return '';
}
- if ($useIframe) {
+ if ($useIframe == 'iframe') {
if ($useNocookie) {
$embedUri = 'https://www.youtube-nocookie.com/embed/' . $videoID;
} else {
@@ -575,6 +575,16 @@ function handleYoutube(string $string)
'
+EOD
+ , $embedUri);
+ } elseif ($useIframe == 'rssbridge'){
+ $rssbridgedir = dirname($_SERVER['PHP_SELF']);
+ $videoUri = 'https://' . $_SERVER['SERVER_NAME'] . $rssbridgedir . '/youtubeiframe.php?v=' . $videoID;
+
+ return sprintf(<<'
EOD
, $embedUri);
} else {
From 797e384bf2368a794b9564d8dbe9aac610ea963e Mon Sep 17 00:00:00 2001
From: Tone <66808319+Tone866@users.noreply.github.com>
Date: Thu, 26 Mar 2026 16:06:52 +0100
Subject: [PATCH 02/13] Update html.php
---
lib/html.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/html.php b/lib/html.php
index fcb8915758f..dbb47eba826 100644
--- a/lib/html.php
+++ b/lib/html.php
@@ -579,7 +579,7 @@ function handleYoutube(string $string)
, $embedUri);
} elseif ($useIframe == 'rssbridge'){
$rssbridgedir = dirname($_SERVER['PHP_SELF']);
- $videoUri = 'https://' . $_SERVER['SERVER_NAME'] . $rssbridgedir . '/youtubeiframe.php?v=' . $videoID;
+ $videoUri = 'https://' . $_SERVER['SERVER_NAME'] . $rssbridgedir . '/youtubeiframe.html?v=' . $videoID;
return sprintf(<<
Date: Thu, 26 Mar 2026 16:08:12 +0100
Subject: [PATCH 03/13] Create youtubeiframe.html
---
lib/youtubeiframe.html | 92 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 92 insertions(+)
create mode 100644 lib/youtubeiframe.html
diff --git a/lib/youtubeiframe.html b/lib/youtubeiframe.html
new file mode 100644
index 00000000000..c1e166332f8
--- /dev/null
+++ b/lib/youtubeiframe.html
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+ YouTube Video
+
+
+
+
+
+
+
+
From 85dc3d970ff7516fe364e1d6442c44662453c802 Mon Sep 17 00:00:00 2001
From: Tone <66808319+Tone866@users.noreply.github.com>
Date: Thu, 26 Mar 2026 16:12:21 +0100
Subject: [PATCH 04/13] Update html.php
---
lib/html.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/html.php b/lib/html.php
index dbb47eba826..f815146b84e 100644
--- a/lib/html.php
+++ b/lib/html.php
@@ -579,7 +579,7 @@ function handleYoutube(string $string)
, $embedUri);
} elseif ($useIframe == 'rssbridge'){
$rssbridgedir = dirname($_SERVER['PHP_SELF']);
- $videoUri = 'https://' . $_SERVER['SERVER_NAME'] . $rssbridgedir . '/youtubeiframe.html?v=' . $videoID;
+ $embedUri = 'https://' . $_SERVER['SERVER_NAME'] . $rssbridgedir . '/youtubeiframe.html?v=' . $videoID;
return sprintf(<<
Date: Thu, 26 Mar 2026 16:20:44 +0100
Subject: [PATCH 05/13] Update html.php
---
lib/html.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/html.php b/lib/html.php
index f815146b84e..1e5fa055134 100644
--- a/lib/html.php
+++ b/lib/html.php
@@ -579,7 +579,7 @@ function handleYoutube(string $string)
, $embedUri);
} elseif ($useIframe == 'rssbridge'){
$rssbridgedir = dirname($_SERVER['PHP_SELF']);
- $embedUri = 'https://' . $_SERVER['SERVER_NAME'] . $rssbridgedir . '/youtubeiframe.html?v=' . $videoID;
+ $embedUri = 'https://' . $_SERVER['SERVER_NAME'] . $rssbridgedir . '/lib/youtubeiframe.html?v=' . $videoID;
return sprintf(<<
Date: Thu, 26 Mar 2026 16:31:27 +0100
Subject: [PATCH 06/13] Update html.php
---
lib/html.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/html.php b/lib/html.php
index 1e5fa055134..3d9e903133e 100644
--- a/lib/html.php
+++ b/lib/html.php
@@ -577,7 +577,7 @@ function handleYoutube(string $string)
referrerpolicy="strict-origin" allowfullscreen>'
EOD
, $embedUri);
- } elseif ($useIframe == 'rssbridge'){
+ } elseif ($useIframe == 'rssbridge') {
$rssbridgedir = dirname($_SERVER['PHP_SELF']);
$embedUri = 'https://' . $_SERVER['SERVER_NAME'] . $rssbridgedir . '/lib/youtubeiframe.html?v=' . $videoID;
From d0d5cadb7dd61a53b0037ba4e6140d81dfc8245a Mon Sep 17 00:00:00 2001
From: Tone <66808319+Tone866@users.noreply.github.com>
Date: Fri, 27 Mar 2026 09:02:23 +0100
Subject: [PATCH 07/13] Update html.php
---
lib/html.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/html.php b/lib/html.php
index 3d9e903133e..78b75be74e8 100644
--- a/lib/html.php
+++ b/lib/html.php
@@ -564,7 +564,7 @@ function handleYoutube(string $string)
return '';
}
- if ($useIframe == 'iframe') {
+ if ($useIframe == 'youtube' || $useIframe == true) {
if ($useNocookie) {
$embedUri = 'https://www.youtube-nocookie.com/embed/' . $videoID;
} else {
From 42476b1ac6ce99546c0ef16db4c356b4f252f6ac Mon Sep 17 00:00:00 2001
From: Tone <66808319+Tone866@users.noreply.github.com>
Date: Sat, 16 May 2026 17:26:58 +0200
Subject: [PATCH 08/13] Create youtube-iframe.html
---
templates/youtube-iframe.html | 92 +++++++++++++++++++++++++++++++++++
1 file changed, 92 insertions(+)
create mode 100644 templates/youtube-iframe.html
diff --git a/templates/youtube-iframe.html b/templates/youtube-iframe.html
new file mode 100644
index 00000000000..c1e166332f8
--- /dev/null
+++ b/templates/youtube-iframe.html
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+ YouTube Video
+
+
+
+
+
+
+
+
From e1c1087adee3d3bb32f7be2909373a32b3f7397a Mon Sep 17 00:00:00 2001
From: Tone <66808319+Tone866@users.noreply.github.com>
Date: Sat, 16 May 2026 17:31:35 +0200
Subject: [PATCH 09/13] Delete lib/youtubeiframe.html
---
lib/youtubeiframe.html | 92 ------------------------------------------
1 file changed, 92 deletions(-)
delete mode 100644 lib/youtubeiframe.html
diff --git a/lib/youtubeiframe.html b/lib/youtubeiframe.html
deleted file mode 100644
index c1e166332f8..00000000000
--- a/lib/youtubeiframe.html
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-
-
-
- YouTube Video
-
-
-
-
-
-
-
-
From 53c7510136c6e4cb74e302f5b20f504f9ff08ddc Mon Sep 17 00:00:00 2001
From: Tone <66808319+Tone866@users.noreply.github.com>
Date: Sat, 16 May 2026 17:33:34 +0200
Subject: [PATCH 10/13] Update html.php
---
lib/html.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/html.php b/lib/html.php
index 78b75be74e8..5b15d3853cd 100644
--- a/lib/html.php
+++ b/lib/html.php
@@ -579,7 +579,7 @@ function handleYoutube(string $string)
, $embedUri);
} elseif ($useIframe == 'rssbridge') {
$rssbridgedir = dirname($_SERVER['PHP_SELF']);
- $embedUri = 'https://' . $_SERVER['SERVER_NAME'] . $rssbridgedir . '/lib/youtubeiframe.html?v=' . $videoID;
+ $embedUri = 'https://' . $_SERVER['SERVER_NAME'] . $rssbridgedir . '/templates/youtube-iframe.html?v=' . $videoID;
return sprintf(<<
Date: Sat, 16 May 2026 17:41:32 +0200
Subject: [PATCH 11/13] separate youtube iframes
---
lib/html.php | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/html.php b/lib/html.php
index 5b15d3853cd..13f3be62153 100644
--- a/lib/html.php
+++ b/lib/html.php
@@ -553,6 +553,7 @@ function handleYoutube(string $string)
{
$useIframe = Configuration::getConfig('youtube', 'iframe');
$useNocookie = Configuration::getConfig('youtube', 'nocookie');
+ $useRss-Bridge-Iframe = Configuration::getConfig('youtube', 'rss-bridge-iframe');
// sourced from https://gist.github.com/afeld/1254889?permalink_comment_id=3580082#gistcomment-3580082
$regex = '#(?:https?://|//)?(?:www\.|m\.|.+\.)?(?:youtu\.be/|youtube(?:-nocookie)\.com/(?:embed/|v/|shorts/|feeds/api/videos/|watch\?v=|watch\?.+&v=))([\w-]{11})#i';
@@ -564,7 +565,7 @@ function handleYoutube(string $string)
return '';
}
- if ($useIframe == 'youtube' || $useIframe == true) {
+ if ($useIframe == true) {
if ($useNocookie) {
$embedUri = 'https://www.youtube-nocookie.com/embed/' . $videoID;
} else {
@@ -577,7 +578,7 @@ function handleYoutube(string $string)
referrerpolicy="strict-origin" allowfullscreen>'
EOD
, $embedUri);
- } elseif ($useIframe == 'rssbridge') {
+ } elseif ($useIframe == true && $useRss-Bridge-Iframe == true) {
$rssbridgedir = dirname($_SERVER['PHP_SELF']);
$embedUri = 'https://' . $_SERVER['SERVER_NAME'] . $rssbridgedir . '/templates/youtube-iframe.html?v=' . $videoID;
From 6b0c5e61fd652a4a0005067b3765b09dd776acc2 Mon Sep 17 00:00:00 2001
From: Tone <66808319+Tone866@users.noreply.github.com>
Date: Sat, 16 May 2026 17:45:34 +0200
Subject: [PATCH 12/13] add rss-bridge-iframe setting
---
config.default.ini.php | 3 +++
1 file changed, 3 insertions(+)
diff --git a/config.default.ini.php b/config.default.ini.php
index ecd5989eb06..4cf63263f79 100644
--- a/config.default.ini.php
+++ b/config.default.ini.php
@@ -144,6 +144,9 @@
; If false, a clickable video thumbnail is used instead. This avoids sending a referrer to YouTube or only getting the error 153 if suppressing the referrer browser-wide.
iframe = true
+; If still getting error 153 you can selfhost the link over this rss-bridge instance, which should avoid this error.
+rss-bridge-iframe = false
+
; Use the youtube-nocookie.com domain instead of youtube.com for iframe embeds.
; Only relevant if youtube.iframe is true.
; See the following for a description:
From 5810aa1e73cefff12b6dde2f3861814c92172aa7 Mon Sep 17 00:00:00 2001
From: Tone <66808319+Tone866@users.noreply.github.com>
Date: Sat, 16 May 2026 17:49:15 +0200
Subject: [PATCH 13/13] Update html.php
---
lib/html.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/html.php b/lib/html.php
index 13f3be62153..aef7d6645ae 100644
--- a/lib/html.php
+++ b/lib/html.php
@@ -553,7 +553,7 @@ function handleYoutube(string $string)
{
$useIframe = Configuration::getConfig('youtube', 'iframe');
$useNocookie = Configuration::getConfig('youtube', 'nocookie');
- $useRss-Bridge-Iframe = Configuration::getConfig('youtube', 'rss-bridge-iframe');
+ $useRssBridgeIframe = Configuration::getConfig('youtube', 'rss-bridge-iframe');
// sourced from https://gist.github.com/afeld/1254889?permalink_comment_id=3580082#gistcomment-3580082
$regex = '#(?:https?://|//)?(?:www\.|m\.|.+\.)?(?:youtu\.be/|youtube(?:-nocookie)\.com/(?:embed/|v/|shorts/|feeds/api/videos/|watch\?v=|watch\?.+&v=))([\w-]{11})#i';
@@ -578,7 +578,7 @@ function handleYoutube(string $string)
referrerpolicy="strict-origin" allowfullscreen>'
EOD
, $embedUri);
- } elseif ($useIframe == true && $useRss-Bridge-Iframe == true) {
+ } elseif ($useIframe == true && $useRssBridgeIframe == true) {
$rssbridgedir = dirname($_SERVER['PHP_SELF']);
$embedUri = 'https://' . $_SERVER['SERVER_NAME'] . $rssbridgedir . '/templates/youtube-iframe.html?v=' . $videoID;