Skip to content

Commit 1667d24

Browse files
authored
Update Scraper.php
Use FetcherConfig::DEFAULT_USER_AGENT for Curl Signed-off-by: IgorA100 <[email protected]>
1 parent 66f501e commit 1667d24

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Scraper/Scraper.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use fivefilters\Readability\ParseException;
1717
use League\Uri\Exceptions\SyntaxError;
1818
use Psr\Log\LoggerInterface;
19+
use OCA\News\Config\FetcherConfig;
1920

2021
class Scraper implements IScraper
2122
{
@@ -37,7 +38,7 @@ public function __construct(LoggerInterface $logger)
3738
CURLOPT_RETURNTRANSFER => true, // return web page
3839
CURLOPT_HEADER => false, // do not return headers
3940
CURLOPT_FOLLOWLOCATION => true, // follow redirects
40-
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
41+
CURLOPT_USERAGENT => FetcherConfig::DEFAULT_USER_AGENT, // who am i
4142
CURLOPT_AUTOREFERER => true, // set referer on redirect
4243
CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect
4344
CURLOPT_TIMEOUT => 120, // timeout on response

0 commit comments

Comments
 (0)