From 03a937b764fab3e692263a291f9f7d2c001d3b93 Mon Sep 17 00:00:00 2001 From: Mynacol Date: Fri, 24 Oct 2025 14:46:00 +0000 Subject: [PATCH] Normalize www.youtube.com links to this domain Links to (non-www) youtube.com work as well, but they get redirected to the www variant anyways. --- bridges/GenshinImpactBridge.php | 2 +- bridges/WebfailBridge.php | 2 +- bridges/YorushikaBridge.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bridges/GenshinImpactBridge.php b/bridges/GenshinImpactBridge.php index 924155d9..cd8b397b 100644 --- a/bridges/GenshinImpactBridge.php +++ b/bridges/GenshinImpactBridge.php @@ -37,7 +37,7 @@ class GenshinImpactBridge extends BridgeAbstract if (preg_match($exp_youtube, $article_html, $matches)) { // Replace the YouTube embed with a YouTube link $yt_embed = $article_html->find('div[class="ttr-video-frame"]', 0); - $yt_link = sprintf('https://youtube.com/watch?v=%1$s', $matches[1]); + $yt_link = sprintf('https://www.youtube.com/watch?v=%1$s', $matches[1]); $article_html = str_replace($yt_embed, $yt_link, $article_html); } $item = []; diff --git a/bridges/WebfailBridge.php b/bridges/WebfailBridge.php index d969ab07..48caf263 100644 --- a/bridges/WebfailBridge.php +++ b/bridges/WebfailBridge.php @@ -126,7 +126,7 @@ class WebfailBridge extends BridgeAbstract . '">'; } elseif (!is_null($article->find('div.wf-video', 0))) { // Video type $videoId = $this->getVideoId($article->find('div.wf-play', 0)->onclick); - $item['uri'] = 'https://youtube.com/watch?v=' . $videoId; + $item['uri'] = 'https://www.youtube.com/watch?v=' . $videoId; $item['content'] = 'https://youtube.com/watch?v=%1$s', $matches[1]); + $yt_link = sprintf('https://www.youtube.com/watch?v=%1$s', $matches[1]); $art_html = str_replace($yt_embed, $yt_link, $art_html); }