diff --git a/dist/GameSource.js b/dist/GameSource.js index e1796a8..e9d9562 100644 --- a/dist/GameSource.js +++ b/dist/GameSource.js @@ -14,7 +14,11 @@ class GameSource { const sourceUrl = `https://mhaifafc.com/games?lang=en`; console.log('Trying to get games from Haifa...'); try { - const result = await axios_1.default.get(sourceUrl); + 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' + } + }); const parsedResult = (0, node_html_parser_1.parse)(result.data.toString()); const gameBoxs = parsedResult.querySelectorAll(".game-box"); const games = []; diff --git a/src/GameSource.ts b/src/GameSource.ts index 535e144..27cfa0f 100644 --- a/src/GameSource.ts +++ b/src/GameSource.ts @@ -12,7 +12,12 @@ export default class GameSource { const sourceUrl = `https://mhaifafc.com/games?lang=en`; console.log('Trying to get games from Haifa...'); try { - const result = await axios.get(sourceUrl); + 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' + } + }); const parsedResult = parse(result.data.toString()); const gameBoxs = parsedResult.querySelectorAll(".game-box");