From e133b49ee9cedc43613b8a43c81358128f183cbd Mon Sep 17 00:00:00 2001 From: Kfir Dayan Date: Sun, 4 Feb 2024 13:10:12 +0200 Subject: [PATCH] adding more headers --- dist/GameSource.js | 8 +++++++- src/GameSource.ts | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/dist/GameSource.js b/dist/GameSource.js index e9d9562..125e331 100644 --- a/dist/GameSource.js +++ b/dist/GameSource.js @@ -16,7 +16,13 @@ class GameSource { try { const result = await axios_1.default.get(sourceUrl, { headers: { - 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36' + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36', + 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', + 'Accept-Language': 'en-US,en;q=0.9', + 'Accept-Encoding': 'gzip, deflate, br', + 'DNT': '1', + 'Connection': 'keep-alive', + 'Upgrade-Insecure-Requests': '1', } }); const parsedResult = (0, node_html_parser_1.parse)(result.data.toString()); diff --git a/src/GameSource.ts b/src/GameSource.ts index 27cfa0f..b7c9379 100644 --- a/src/GameSource.ts +++ b/src/GameSource.ts @@ -15,7 +15,13 @@ export default class GameSource { const result = await axios.get(sourceUrl, { headers: { - 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36' + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36', + 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', + 'Accept-Language': 'en-US,en;q=0.9', + 'Accept-Encoding': 'gzip, deflate, br', + 'DNT': '1', + 'Connection': 'keep-alive', + 'Upgrade-Insecure-Requests': '1', } });