mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-03-14 20:21:14 +03:00
fix: add workaround for NYTBridge antibot (#3022)
This commit is contained in:
parent
27b3d7c34e
commit
6ac347d5ac
1 changed files with 9 additions and 2 deletions
|
@ -19,8 +19,15 @@ class NYTBridge extends FeedExpander
|
|||
$article = '';
|
||||
|
||||
// $articlePage gets the entire page's contents
|
||||
$articlePage = getSimpleHTMLDOM($newsItem->link);
|
||||
|
||||
try {
|
||||
$articlePage = getSimpleHTMLDOM($newsItem->link);
|
||||
} catch (HttpException $e) {
|
||||
// 403 Forbidden, This means we got anti-bot response
|
||||
if ($e->getCode() === 403) {
|
||||
return $item;
|
||||
}
|
||||
throw $e;
|
||||
}
|
||||
// handle subtitle
|
||||
$subtitle = $articlePage->find('p.css-w6ymp8', 0);
|
||||
if ($subtitle != null) {
|
||||
|
|
Loading…
Add table
Reference in a new issue