From 41dab54091abc8679771934a3edf165d514067ab Mon Sep 17 00:00:00 2001
From: Tone <66808319+Tone866@users.noreply.github.com>
Date: Sat, 23 Mar 2024 20:18:22 +0100
Subject: [PATCH] Update AnisearchBridge.php
---
bridges/AnisearchBridge.php | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/bridges/AnisearchBridge.php b/bridges/AnisearchBridge.php
index 639d143feb5c..82a26ab738b8 100644
--- a/bridges/AnisearchBridge.php
+++ b/bridges/AnisearchBridge.php
@@ -1,9 +1,9 @@
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);
@@ -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 = '
';
+ }
+
$this->items[] = [
'title' => $title->plaintext,
'uri' => $url,
- 'content' => $headerimage . '
' . $content
+ 'content' => $headerimage . '
' . $content . $ytlink
];
}
}