1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-07-30 21:30:14 +02:00

[GolemBridge] fix youtube links (#4144)

This commit is contained in:
Tone
2024-07-04 20:53:49 +02:00
committed by GitHub
parent 8bf1537054
commit 4539eb69aa

View File

@@ -109,10 +109,10 @@ class GolemBridge extends FeedExpander
//built youtube iframes
foreach ($article->find('.embedcontent') as &$embedcontent) {
$ytscript = $embedcontent->find('script', 0);
if (preg_match('/www.youtube.com.*?\"/', $ytscript->innertext, $link)) {
$link = 'https://' . str_replace('\\', '', $link[0]);
if (preg_match('/(www.youtube.com.*?)\"/', $ytscript->innertext, $link)) {
$link = 'https://' . str_replace('\\', '', $link[1]);
$embedcontent->innertext .= <<<EOT
<iframe width="560" height="315" src=$link title="YouTube video player" frameborder="0"
<iframe width="560" height="315" src="$link" title="YouTube video player" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>';
EOT;