diff options
Diffstat (limited to '')
-rw-r--r-- | scrapers/wallhaven.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scrapers/wallhaven.php b/scrapers/wallhaven.php index 29df5d3..ea03d25 100644 --- a/scrapers/wallhaven.php +++ b/scrapers/wallhaven.php @@ -15,10 +15,13 @@ if ($data) $url = sprintf("%s?%s", $url, http_build_query($data)); } + curl_setopt($curl, CURLOPT_HEADER, "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/120.0"); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($curl); + if ($result == null) + printf("<p id='error'>Request to wallhaven.cc denied :(</p>\n"); curl_close($curl); |