mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 06:42:50 +02:00
Hardcode user-agent in google
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
const Command = require('../../structures/Command');
|
const Command = require('../../structures/Command');
|
||||||
const request = require('node-superfetch');
|
const request = require('node-superfetch');
|
||||||
const cheerio = require('cheerio');
|
const cheerio = require('cheerio');
|
||||||
const UserAgent = require('user-agents');
|
|
||||||
const { URLSearchParams, URL } = require('url');
|
const { URLSearchParams, URL } = require('url');
|
||||||
|
|
||||||
module.exports = class GoogleCommand extends Command {
|
module.exports = class GoogleCommand extends Command {
|
||||||
@@ -58,7 +57,7 @@ module.exports = class GoogleCommand extends Command {
|
|||||||
filter: 0,
|
filter: 0,
|
||||||
q: query
|
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 $ = cheerio.load(text);
|
||||||
const links = [];
|
const links = [];
|
||||||
$('body').find('h3').each((i, h3) => {
|
$('body').find('h3').each((i, h3) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user