From d357f4479ad713bfb482062046fbd7f200dbd5c3 Mon Sep 17 00:00:00 2001 From: mekrapp <158028484+mekrapp@users.noreply.github.com> Date: Wed, 5 Jun 2024 20:46:16 +0200 Subject: [PATCH 1/2] Update pycarwings2.py Two changes 1st re line 75: Nissan changed the Base URL of its Carwings API. Since May 20, 2024 the old URL used by pycarwings2 in soc_leaf doesn't work anymore. 2nd re line 121: At least on a Windows 10 PC with Python 3.12 for test purpose, the additional parameter 'headers={"User-Agent": ""}' is needed to run pycarwings2.py successfully. The need for this parameter within OpenWB itself has tbc. For more details see posts on https://forum.openwb.de/viewtopic.php?p=109761#p109761 ff --- modules/soc_leaf/pycarwings2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/soc_leaf/pycarwings2.py b/modules/soc_leaf/pycarwings2.py index d583d9b9e..442f5e82f 100755 --- a/modules/soc_leaf/pycarwings2.py +++ b/modules/soc_leaf/pycarwings2.py @@ -72,7 +72,7 @@ import base64 from Crypto.Cipher import Blowfish -BASE_URL = "https://gdcportalgw.its-mo.com/api_v210707_NE/gdc/" +BASE_URL = "https://gdcportalgw.its-mo.com/api_v230317_NE/gdc/" log = logging.getLogger(__name__) @@ -118,7 +118,7 @@ def _request(self, endpoint, params): else: params["custom_sessionid"] = "" - req = Request('POST', url=BASE_URL + endpoint, data=params).prepare() + req = Request('POST', url=BASE_URL + endpoint, data=params, headers={"User-Agent": ""}).prepare() log.debug("invoking carwings API: %s" % req.url) log.debug("params: %s" % json.dumps( From eca2439d3fe251a546ac84ae3cf6a036eac59c6b Mon Sep 17 00:00:00 2001 From: mekrapp <158028484+mekrapp@users.noreply.github.com> Date: Sat, 8 Jun 2024 10:56:31 +0200 Subject: [PATCH 2/2] Update pycarwings2.py 2nd change removed, because it is not needed on the OpenWB software platform. --- modules/soc_leaf/pycarwings2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/soc_leaf/pycarwings2.py b/modules/soc_leaf/pycarwings2.py index 442f5e82f..5cf51d12d 100755 --- a/modules/soc_leaf/pycarwings2.py +++ b/modules/soc_leaf/pycarwings2.py @@ -118,7 +118,7 @@ def _request(self, endpoint, params): else: params["custom_sessionid"] = "" - req = Request('POST', url=BASE_URL + endpoint, data=params, headers={"User-Agent": ""}).prepare() + req = Request('POST', url=BASE_URL + endpoint, data=params).prepare() log.debug("invoking carwings API: %s" % req.url) log.debug("params: %s" % json.dumps(