diff --git a/lib/best-image.js b/lib/best-image.js index ddfe1c1..77df786 100644 --- a/lib/best-image.js +++ b/lib/best-image.js @@ -160,8 +160,14 @@ function getBestAltImage(fullUrl, query, scoreFn, callback) { LOGR.debug("GET IMAGES FOR " + fullUrl + ":" + query); + const options = { + url: fullUrl, + headers: { + 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.4 Safari/605.1.15' + } + }; // load the destination page - request.get(fullUrl, function (error, response, body) { + request.get(options, function (error, response, body) { // bail out if there was an error if (error || (response.statusCode && response.statusCode !== 200)) { diff --git a/package.json b/package.json index 9b7cd6c..402c06e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "best-image", - "version": "2.0.11", + "version": "2.0.12", "description": "Library that will retrieve an HTML document (by URL) and return the best image from the page to represent the document", "main": "lib/best-image.js", "scripts": {