From 8ad170c317d1ed1e0a86dd1ed46b0c4a5512109d Mon Sep 17 00:00:00 2001 From: DEV2DEV_DE Date: Wed, 13 Dec 2023 13:52:05 +0100 Subject: [PATCH] Sending fake user-agent --- README.md | 1 + main.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 21ddcf0..a67f4bd 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ You need to re-enter your password in the instance settings if you already used ### **WORK IN PROGRESS** * Improved readability * Select data segments read from server +* Changed User-Agent in requests ### 0.1.0 (2023-12-10) * Fixed issue with restarts due to timeouts diff --git a/main.js b/main.js index c40ae37..b9b28ae 100644 --- a/main.js +++ b/main.js @@ -10,13 +10,15 @@ const utils = require('@iobroker/adapter-core'); const axios = require('axios').default; const baseUrl = 'https://api.jablonet.net/api/2.2'; +const userAgent = 'Mozilla/5.0 (iPhone13,2; U; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Mobile/15E148 Safari/602.1'; const headers = { 'x-vendor-id': 'JABLOTRON:Jablotron', 'Content-Type': 'application/json', 'x-client-version': 'MYJ-PUB-ANDROID-12', 'accept-encoding': '*', 'Accept': 'application/json', - 'Accept-Language': 'en' + 'Accept-Language': 'en', + 'User-Agent': userAgent }; class Jablotron extends utils.Adapter {