Skip to content

Commit

Permalink
[GolemBridge] fix for internal videos (RSS-Bridge#4051)
Browse files Browse the repository at this point in the history
* [GolemBridge] fix for internal videos

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

* Update GolemBridge.php
  • Loading branch information
Tone866 committed Apr 3, 2024
1 parent fb66775 commit f736da6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion bridges/GolemBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ private function extractContent($page)
}
}

//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,
Expand All @@ -142,7 +152,7 @@ private function extractContent($page)
$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;
}

Expand Down

0 comments on commit f736da6

Please sign in to comment.