From 9fc1e97efe01a07b6f701ffff70a03ceac1110b3 Mon Sep 17 00:00:00 2001 From: Quentin Delmas Date: Wed, 22 Aug 2018 16:21:39 +0100 Subject: [PATCH] Avoid bot exclusion. --- bridges/LeBonCoinBridge.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bridges/LeBonCoinBridge.php b/bridges/LeBonCoinBridge.php index ac2a76f7..855eb43c 100644 --- a/bridges/LeBonCoinBridge.php +++ b/bridges/LeBonCoinBridge.php @@ -161,7 +161,14 @@ class LeBonCoinBridge extends BridgeAbstract { ); $url = self::URI . 'recherche/?' . http_build_query($params); - $html = getContents($url) + + $header = array( + 'Accept: text/html', + 'Accept-Language: ' . getEnv('HTTP_ACCEPT_LANGUAGE'), + 'Accept-Encoding: identity' + ); + + $html = getContents($url, $header) or returnServerError('Could not request LeBonCoin. Tried: ' . $url); if(!preg_match('/^