From ef8e0c735990e5f0ec160c32386c9ac02a4a4c29 Mon Sep 17 00:00:00 2001 From: franzz Date: Sun, 2 Dec 2018 19:52:01 +0100 Subject: [PATCH] fix user agent --- inc/rss.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/inc/rss.php b/inc/rss.php index a3298ab..2ad7dd0 100755 --- a/inc/rss.php +++ b/inc/rss.php @@ -38,7 +38,11 @@ class Feed extends PhpObject curl_setopt($oCurl, CURLOPT_URL, $sUrl); curl_setopt($oCurl, CURLOPT_HEADER, false); curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($oCurl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); + curl_setopt($oCurl, CURLOPT_USERAGENT, array_key_exists('HTTP_USER_AGENT', $_SERVER)?$_SERVER['HTTP_USER_AGENT']:'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0'); + $fCookieJar = tempnam('/tmp','cookie'); + curl_setopt($oCurl, CURLOPT_COOKIESESSION, true); + curl_setopt($oCurl, CURLOPT_COOKIEJAR, $fCookieJar); + curl_setopt($oCurl, CURLOPT_COOKIEFILE, $fCookieJar); //curl_setopt($oCurl, CURLOPT_ENCODING, 'gzip'); $sRssContent = curl_exec($oCurl); curl_close($oCurl);