diff --git a/bridges/GolemBridge.php b/bridges/GolemBridge.php index d127a1e6..51edcad2 100644 --- a/bridges/GolemBridge.php +++ b/bridges/GolemBridge.php @@ -117,14 +117,16 @@ class GolemBridge extends FeedExpander //built youtube iframes foreach ($article->find('.go-embed-container') as &$embedcontent) { - $ytscript = $page->find('script', 14); - if (preg_match('/(www.youtube.com.*?)\"/', $ytscript->innertext, $link)) { - $link = 'https://' . str_replace('\\', '', $link[1]); - $embedcontent->innertext .= <<'; - EOT; + foreach ($page->find('script') as $ytscript) { + if (preg_match('/(www.youtube.com.*?)\"/', $ytscript->innertext, $link)) { + $link = 'https://' . str_replace('\\', '', $link[1]); + $embedcontent->innertext .= <<'; + EOT; + break; + } } }