diff --git a/lib/Conf.php b/lib/Conf.php index bc5a7692..352cc42c 100644 --- a/lib/Conf.php +++ b/lib/Conf.php @@ -29,6 +29,7 @@ class Conf { public $userComposeNames = true; public $userTempPasswordLength = 20; + public $userAgentString = 'Arsse (https://code.jkingweb.ca/jking/arsse)'; public function __construct(string $import_file = "") { if($import_file != "") $this->importFile($import_file); diff --git a/lib/Feed.php b/lib/Feed.php index 444b14e2..3eecbce3 100644 --- a/lib/Feed.php +++ b/lib/Feed.php @@ -1,8 +1,10 @@ reader = new Reader; + $config = new Config; + $config->setClientUserAgent(Data::$conf->userAgentString); + $config->setGrabberUserAgent(Data::$conf->userAgentString); + + $this->reader = new Reader($config); $this->resource = $reader->download($url, $lastModified, $etag, $username, $password); // Grab the favicon for the feed; returns an empty string if it cannot find one. $this->favicon = (new Favicon)->find($url);