From 392423957e7c4865c382e75a60e6d32490a1fe26 Mon Sep 17 00:00:00 2001 From: dangered wolf Date: Fri, 3 Feb 2023 12:18:46 -0500 Subject: [PATCH] Recognize Firefox/38 as a bot (Discord) --- src/constants.ts | 2 +- src/fetch.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/constants.ts b/src/constants.ts index 6a369ff..a0efc5f 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -15,7 +15,7 @@ export const Constants = { TWITTER_ROOT: 'https://twitter.com', TWITTER_API_ROOT: 'https://api.twitter.com', BOT_UA_REGEX: - /bot|facebook|embed|got|firefox\/92|curl|wget|go-http|yahoo|generator|whatsapp|preview|link|proxy|vkshare|images|analyzer|index|crawl|spider|python|cfnetwork|node/gi, + /bot|facebook|embed|got|firefox\/92|firefox\/38|curl|wget|go-http|yahoo|generator|whatsapp|preview|link|proxy|vkshare|images|analyzer|index|crawl|spider|python|cfnetwork|node/gi, /* 3 hours */ GUEST_TOKEN_MAX_AGE: 3 * 60 * 60, /* Twitter Web App actually uses Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA diff --git a/src/fetch.ts b/src/fetch.ts index b7057d6..c15fe3c 100644 --- a/src/fetch.ts +++ b/src/fetch.ts @@ -12,7 +12,7 @@ export const twitterFetch = async ( let newTokenGenerated = false; const [userAgent, secChUa] = generateUserAgent(); - console.log('Hello, I am', userAgent); + console.log(`Outgoing useragent for this request:`, userAgent); const tokenHeaders: { [header: string]: string } = { 'Authorization': Constants.GUEST_BEARER_TOKEN,