From 8bff63d9c65683ecde68a66fcf40594eda2e6faa Mon Sep 17 00:00:00 2001 From: Mitsu Date: Tue, 27 Aug 2019 01:18:43 +0200 Subject: [PATCH] [ThePirateBay] URI fix, add magnet link --- bridges/ThePirateBayBridge.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bridges/ThePirateBayBridge.php b/bridges/ThePirateBayBridge.php index 0deadedf..706324a4 100644 --- a/bridges/ThePirateBayBridge.php +++ b/bridges/ThePirateBayBridge.php @@ -149,11 +149,12 @@ class ThePirateBayBridge extends BridgeAbstract { || !is_null($element->find('img[alt=VIP]', 0)) || !is_null($element->find('img[alt=Trusted]', 0))) { $item = array(); - $item['uri'] = $element->find('a', 3)->href; + $item['uri'] = self::URI . $element->find('a.detLink', 0)->href; $item['id'] = self::URI . $element->find('a.detLink', 0)->href; $item['timestamp'] = parseDateTimestamp($element); $item['author'] = $element->find('a.detDesc', 0)->plaintext; $item['title'] = $element->find('a.detLink', 0)->plaintext; + $item['magnet'] = $element->find('a', 3)->href; $item['seeders'] = (int)$element->find('td', 2)->plaintext; $item['leechers'] = (int)$element->find('td', 3)->plaintext; $item['content'] = $element->find('font', 0)->plaintext @@ -163,7 +164,11 @@ class ThePirateBayBridge extends BridgeAbstract { . $item['leechers'] . '
info page'; + . '">info page' + . '
magnet link'; + if(isset($item['title'])) $this->items[] = $item;