From c108c20c91b8dc9edf002be9f766f2623e384932 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Tue, 17 Dec 2019 22:35:15 +0200 Subject: [PATCH] Pretend to be facebook and twitter bots --- src/plugins/irc-events/link.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/irc-events/link.js b/src/plugins/irc-events/link.js index 9b2edf3b..9398202a 100644 --- a/src/plugins/irc-events/link.js +++ b/src/plugins/irc-events/link.js @@ -306,8 +306,11 @@ function removePreview(msg, preview) { function getRequestHeaders(headers) { const formattedHeaders = { + // Certain websites like Amazon only add tags to known bots, + // lets pretend to be them to get the metadata "User-Agent": - "Mozilla/5.0 (compatible; The Lounge IRC Client; +https://github.com/thelounge/thelounge)", + "Mozilla/5.0 (compatible; The Lounge IRC Client; +https://github.com/thelounge/thelounge)" + + " facebookexternalhit/1.1 Twitterbot/1.0", Accept: headers.accept || "*/*", "X-Purpose": "preview", };