mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-02-16 15:19:55 +03:00
[GolemBridge] fix youtube links (#4144)
This commit is contained in:
parent
8bf1537054
commit
4539eb69aa
1 changed files with 3 additions and 3 deletions
|
@ -109,10 +109,10 @@ class GolemBridge extends FeedExpander
|
||||||
//built youtube iframes
|
//built youtube iframes
|
||||||
foreach ($article->find('.embedcontent') as &$embedcontent) {
|
foreach ($article->find('.embedcontent') as &$embedcontent) {
|
||||||
$ytscript = $embedcontent->find('script', 0);
|
$ytscript = $embedcontent->find('script', 0);
|
||||||
if (preg_match('/www.youtube.com.*?\"/', $ytscript->innertext, $link)) {
|
if (preg_match('/(www.youtube.com.*?)\"/', $ytscript->innertext, $link)) {
|
||||||
$link = 'https://' . str_replace('\\', '', $link[0]);
|
$link = 'https://' . str_replace('\\', '', $link[1]);
|
||||||
$embedcontent->innertext .= <<<EOT
|
$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"
|
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||||
referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>';
|
referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>';
|
||||||
EOT;
|
EOT;
|
||||||
|
|
Loading…
Add table
Reference in a new issue