From 902bd0f1f5af98129b3b7dc0db7330c27f0f9dc6 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Thu, 18 Mar 2021 17:16:56 -0400 Subject: [PATCH] Hardcode user-agent in google --- commands/search/google.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/commands/search/google.js b/commands/search/google.js index e3e84284..e1767f17 100644 --- a/commands/search/google.js +++ b/commands/search/google.js @@ -1,7 +1,6 @@ const Command = require('../../structures/Command'); const request = require('node-superfetch'); const cheerio = require('cheerio'); -const UserAgent = require('user-agents'); const { URLSearchParams, URL } = require('url'); module.exports = class GoogleCommand extends Command { @@ -58,7 +57,7 @@ module.exports = class GoogleCommand extends Command { filter: 0, q: query }) - .set({ 'User-Agent': new UserAgent({ deviceCategory: 'desktop' }).toString() }); + .set({ 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1' }); const $ = cheerio.load(text); const links = []; $('body').find('h3').each((i, h3) => {