mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-01-16 21:58:21 +01:00
AnnasArchiveBridge: correctly handling partial matches and file links (#3997)
This commit is contained in:
parent
683c968d64
commit
7a7f8d5050
@ -126,30 +126,36 @@ class AnnasArchiveBridge extends BridgeAbstract
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$elements = $list->find('.w-full > .mb-4 > div > a');
|
$elements = $list->find('.w-full > .mb-4 > div');
|
||||||
foreach ($elements as $element) {
|
foreach ($elements as $element) {
|
||||||
$item = [];
|
// stop added entries once partial match list starts
|
||||||
$item['title'] = $element->find('h3', 0)->plaintext;
|
if (str_contains($element->innertext, 'partial match')) {
|
||||||
$item['author'] = $element->find('div.italic', 0)->plaintext;
|
break;
|
||||||
$item['uri'] = $element->href;
|
}
|
||||||
$item['content'] = $element->plaintext;
|
if ($element = $element->find('a', 0)) {
|
||||||
$item['uid'] = $item['uri'];
|
$item = [];
|
||||||
|
$item['title'] = $element->find('h3', 0)->plaintext;
|
||||||
|
$item['author'] = $element->find('div.italic', 0)->plaintext;
|
||||||
|
$item['uri'] = $element->href;
|
||||||
|
$item['content'] = $element->plaintext;
|
||||||
|
$item['uid'] = $item['uri'];
|
||||||
|
|
||||||
$item_html = getSimpleHTMLDOMCached($item['uri'], 86400 * 20);
|
$item_html = getSimpleHTMLDOMCached($item['uri'], 86400 * 20);
|
||||||
if ($item_html) {
|
if ($item_html) {
|
||||||
$item_html = defaultLinkTo($item_html, self::URI);
|
$item_html = defaultLinkTo($item_html, self::URI);
|
||||||
$item['content'] .= $item_html->find('main img', 0);
|
$item['content'] .= $item_html->find('main img', 0);
|
||||||
$item['content'] .= $item_html->find('main .mt-4', 0); // Summary
|
$item['content'] .= $item_html->find('main .mt-4', 0); // Summary
|
||||||
if ($links = $item_html->find('main ul.mb-4', -1)) {
|
foreach ($item_html->find('main ul.mb-4 > li > a.js-download-link') as $file) {
|
||||||
foreach ($links->find('li > a.js-download-link') as $file) {
|
if (!str_contains($file->href, 'fast_download')) {
|
||||||
$item['enclosures'][] = $file->href;
|
$item['enclosures'][] = $file->href;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Remove bulk torrents from enclosures list
|
// Remove bulk torrents from enclosures list
|
||||||
$item['enclosures'] = array_diff($item['enclosures'], [self::URI . 'datasets']);
|
$item['enclosures'] = array_diff($item['enclosures'], [self::URI . 'datasets']);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$this->items[] = $item;
|
$this->items[] = $item;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user