Skip to content

Commit

Permalink
Update AnisearchBridge.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Tone866 authored Mar 23, 2024
1 parent 5907f67 commit 41dab54
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions bridges/AnisearchBridge.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

class AnisearchBridge extends BridgeAbstract
class Anisearch3Bridge extends BridgeAbstract
{
const MAINTAINER = 'Tone866';
const NAME = 'Anisearch';
const NAME = 'Anisearch2';
const URI = 'https://www.anisearch.de';
const CACHE_TIMEOUT = 1800; // 30min
const DESCRIPTION = 'Feed for Anisearch';
Expand All @@ -28,9 +28,8 @@ public function collectData()
$limit = 10;
$dom = getSimpleHTMLDOM($this->getInput('category'));
foreach ($dom->find('li.btype0') as $key => $li) {
if ($key > $limit) {
if ($key >= $limit)
break;
}

$a = $li->find('a', 0);
$title = $a->find('span.title', 0);
Expand All @@ -44,10 +43,23 @@ public function collectData()
$headerimage = $domarticle->find('img#details-cover', 0);
$src = $headerimage->src;

foreach ($content->find('.hidden') as $element) {
$element->remove();
}

//get trailer
$trailerlink = $domarticle->find('section#trailers > div > div.swiper > ul.swiper-wrapper > li.swiper-slide > a', 0);
$ytlink = '';
if(isset($trailerlink)) {
$trailersite = getSimpleHTMLDOM($baseurl . $trailerlink->href);
$trailer = $trailersite->find('div#player > iframe', 0);
$ytlink = '<br /><iframe width="560" height="315" src="' . $trailer->{'data-xsrc'} . '" 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>';
}

$this->items[] = [
'title' => $title->plaintext,
'uri' => $url,
'content' => $headerimage . '<br />' . $content
'content' => $headerimage . '<br />' . $content . $ytlink
];
}
}
Expand Down

0 comments on commit 41dab54

Please sign in to comment.