[GolemBridge] fix for internal videos (#4051)

* [GolemBridge] fix for internal videos

with this internal golem-videos can be played directly from feed

* Update GolemBridge.php
This commit is contained in:
Tone 2024-04-03 16:23:52 +02:00 committed by GitHub
parent fb66775ece
commit f736da6fae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -119,6 +119,16 @@ class GolemBridge extends FeedExpander
}
}
//built golem videos
foreach ($article->find('.gvideofig') as &$embedcontent) {
if (preg_match('/gvideo_(.*)/', $embedcontent->id, $videoid)) {
$embedcontent->innertext .= <<<EOT
<video class="rmp-object-fit-contain rmp-video" x-webkit-airplay="allow" controlslist="nodownload" tabindex="-1"
preload="metadata" src="https://video.golem.de/download/$videoid[1]"></video>
EOT;
}
}
// delete known bad elements
foreach (
$article->find('div[id*="adtile"], #job-market, #seminars, iframe,
@ -142,7 +152,7 @@ class GolemBridge extends FeedExpander
$img->src = $img->getAttribute('data-src-full');
}
foreach ($content->find('p, h1, h2, h3, img[src*="."], iframe') as $element) {
foreach ($content->find('p, h1, h2, h3, img[src*="."], iframe, video') as $element) {
$item .= $element;
}