diff options
author | IgorA100 <igora100@gmail.com> | 2023-10-15 21:20:01 +0300 |
---|---|---|
committer | Benjamin Brahmer <info@b-brahmer.de> | 2023-10-19 08:26:14 +0200 |
commit | ce8888443c337b2da95f08efb305f74df15e5a26 (patch) | |
tree | dea6b86fc1eeaf3c052e2cc799e8bd521896ab93 /lib | |
parent | 982ff16a2e0acb7513e6b77316be911ba24959cd (diff) |
Update Scraper.php
Use FetcherConfig::DEFAULT_USER_AGENT for Curl
Signed-off-by: IgorA100 <igora100@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Scraper/Scraper.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Scraper/Scraper.php b/lib/Scraper/Scraper.php index b766a00b8..c5ae401f9 100644 --- a/lib/Scraper/Scraper.php +++ b/lib/Scraper/Scraper.php @@ -16,6 +16,7 @@ use fivefilters\Readability\Configuration; use fivefilters\Readability\ParseException; use League\Uri\Exceptions\SyntaxError; use Psr\Log\LoggerInterface; +use OCA\News\Config\FetcherConfig; class Scraper implements IScraper { @@ -37,7 +38,7 @@ class Scraper implements IScraper CURLOPT_RETURNTRANSFER => true, // return web page CURLOPT_HEADER => false, // do not return headers CURLOPT_FOLLOWLOCATION => true, // follow redirects - CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36", // who am i + CURLOPT_USERAGENT => FetcherConfig::DEFAULT_USER_AGENT, // who am i CURLOPT_AUTOREFERER => true, // set referer on redirect CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect CURLOPT_TIMEOUT => 120, // timeout on response |