mirror of
https://github.com/manualdousuario/marreta.git
synced 2025-09-01 18:20:22 +00:00
removido logs e liberado selenium como ultimo fallback
This commit is contained in:
parent
775b6bdd3f
commit
c9e59dfce2
3 changed files with 17 additions and 3 deletions
|
@ -39,6 +39,8 @@ https://oantagonista.com.br/brasil/lewandowski-insiste-na-pec-da-seguranca/
|
||||||
https://jornaldebrasilia.com.br/noticias/politica-e-poder/lula-aguarda-pt-para-troca-em-pastas-chefiadas-por-petistas-em-reforma-ministerial/
|
https://jornaldebrasilia.com.br/noticias/politica-e-poder/lula-aguarda-pt-para-troca-em-pastas-chefiadas-por-petistas-em-reforma-ministerial/
|
||||||
https://opopular.com.br/cidades/ex-secretario-de-saude-de-goiania-deixa-hospital-e-volta-para-a-cadeia-1.3207162
|
https://opopular.com.br/cidades/ex-secretario-de-saude-de-goiania-deixa-hospital-e-volta-para-a-cadeia-1.3207162
|
||||||
https://www.cartacapital.com.br/politica/surpresa-natalina/
|
https://www.cartacapital.com.br/politica/surpresa-natalina/
|
||||||
|
https://seucreditodigital.com.br/123milhas-devera-apresentar-plano-de-recuperacao-ainda-este-mes/
|
||||||
|
https://www.matinaljornalismo.com.br/matinal/reportagem-matinal/vazao-guaiba-porto-alegre/
|
||||||
|
|
||||||
## Internacional
|
## Internacional
|
||||||
https://www.nytimes.com/2024/11/20/us/politics/matt-gaetz-venmo-payments-sex.html
|
https://www.nytimes.com/2024/11/20/us/politics/matt-gaetz-venmo-payments-sex.html
|
||||||
|
|
|
@ -16,6 +16,7 @@ return [
|
||||||
'utppublishing.com',
|
'utppublishing.com',
|
||||||
'chronicle.com',
|
'chronicle.com',
|
||||||
'nexojornal.com',
|
'nexojornal.com',
|
||||||
|
'nexojornal.com.br',
|
||||||
'lesoir.be',
|
'lesoir.be',
|
||||||
'weeklytimesnow.com.au',
|
'weeklytimesnow.com.au',
|
||||||
'barrons.com',
|
'barrons.com',
|
||||||
|
|
|
@ -123,7 +123,6 @@ class URLAnalyzer
|
||||||
$host = preg_replace('/^www\./', '', $host);
|
$host = preg_replace('/^www\./', '', $host);
|
||||||
|
|
||||||
if (in_array($host, BLOCKED_DOMAINS)) {
|
if (in_array($host, BLOCKED_DOMAINS)) {
|
||||||
Logger::getInstance()->log($cleanUrl, 'BLOCKED_DOMAIN');
|
|
||||||
throw new Exception('Este domínio está bloqueado para extração.');
|
throw new Exception('Este domínio está bloqueado para extração.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,7 +152,7 @@ class URLAnalyzer
|
||||||
return $processedContent;
|
return $processedContent;
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
Logger::getInstance()->log($cleanUrl, 'DIRECT_FETCH_ERROR', $e->getMessage());
|
error_log("DIRECT_FETCH_ERROR: " . $e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
// 6. Tenta buscar do Wayback Machine como fallback
|
// 6. Tenta buscar do Wayback Machine como fallback
|
||||||
|
@ -165,7 +164,19 @@ class URLAnalyzer
|
||||||
return $processedContent;
|
return $processedContent;
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
Logger::getInstance()->log($cleanUrl, 'WAYBACK_FETCH_ERROR', $e->getMessage());
|
error_log("WAYBACK_FETCH_ERROR: " . $e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 7. Tenta buscar com Selenium como fallback
|
||||||
|
try {
|
||||||
|
$content = $this->fetchFromSelenium($cleanUrl, 'firefox');
|
||||||
|
if (!empty($content)) {
|
||||||
|
$processedContent = $this->processContent($content, $host, $cleanUrl);
|
||||||
|
$this->cache->set($cleanUrl, $processedContent);
|
||||||
|
return $processedContent;
|
||||||
|
}
|
||||||
|
} catch (Exception $e) {
|
||||||
|
error_log("SELENIUM_ERROR: " . $e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger::getInstance()->log($cleanUrl, 'GENERAL_FETCH_ERROR');
|
Logger::getInstance()->log($cleanUrl, 'GENERAL_FETCH_ERROR');
|
||||||
|
|
Loading…
Add table
Reference in a new issue