Hello,
Have tested version weather.multi-0.0.24.zip but it don't work in France.
Partial kodi.log -> ko
Quote:2024-02-02 11:30:06.886 T:6464 debug <general>: CPythonInvoker(7, C:\Users\nic020\AppData\Roaming\Kodi\addons\weather.multi\default.py): instantiating addon using automatically obtained id of "weather.multi" dependent on version 3.0.0 of the xbmc.python api
2024-02-02 11:30:07.541 T:6464 debug <general>: weather.multi: version 0.0.24 started: ['C:\\Users\\nic020\\AppData\\Roaming\\Kodi\\addons\\weather.multi\\default.py', '1']
2024-02-02 11:30:07.541 T:6464 debug <general>: weather.multi: location: Paris, Ile-de-France, FR
2024-02-02 11:30:07.541 T:6464 debug <general>: weather.multi: location id: 615702
2024-02-02 11:30:07.541 T:6464 debug <general>: weather.multi: cookie from settings:
2024-02-02 11:30:07.541 T:6464 debug <general>: weather.multi: crumb from settings:
2024-02-02 11:30:07.541 T:6464 debug <general>: weather.multi: stamp from settings:
2024-02-02 11:30:09.042 T:10000 debug <general>: CAESinkDirectSound:einitialize: Cleaning up
2024-02-02 11:30:09.324 T:6464 debug <general>: weather.multi: EU user
2024-02-02 11:30:09.325 T:6464 debug <general>: weather.multi: EU token: Y2sqd3A
2024-02-02 11:30:09.325 T:6464 debug <general>: weather.multi: EU sessionid: 3_cc-session_6a87944a-cb40-45ac-b23b-1da62e98b8ac
2024-02-02 11:30:09.325 T:6464 debug <general>: weather.multi: EU redirect https://www.yahoo.com/?guccounter=1
2024-02-02 11:30:10.060 T:6464 debug <general>: weather.multi: cookies: <RequestsCookieJar[]>
2024-02-02 11:30:11.574 T:5300 info <general>: Skipped 3 duplicate messages..
2024-02-02 11:30:11.574 T:5300 debug <general>: ------ Window Init (Pointer.xml) ------
2024-02-02 11:30:11.982 T:6464 debug <general>: weather.multi: cookies: <RequestsCookieJar[]>
2024-02-02 11:30:12.431 T:6464 debug <general>: weather.multi: save cookie to settings:
2024-02-02 11:30:12.431 T:6464 debug <general>: weather.multi: save crumb to settings: 5YY5smmobLY
2024-02-02 11:30:12.432 T:6464 debug <general>: weather.multi: save stamp to settings: 1706869812
2024-02-02 11:30:12.432 T:6464 debug <general>: weather.multi: no cookie
2024-02-02 11:30:12.432 T:6464 debug <general>: weather.multi: available locations: 1
2024-02-02 11:30:12.432 T:6464 debug <general>: weather.multi: finished
2024-02-02 11:30:12.432 T:6464 debug <general>: CPythonInvoker(7, C:\Users\nic020\AppData\Roaming\Kodi\addons\weather.multi\default.py): script successfully run
After some searches, I found it's because
ysess Session() was already open.
To fix, I moved line 89 to line 99 in file weather.py and in kodi.log you can see that
Weather.multi check all url to find cookies.
kodi.log with patch -> ok
Quote:2024-02-02 11:33:32.520 T:8372 debug <general>: CPythonInvoker(7, C:\Users\nic020\AppData\Roaming\Kodi\addons\weather.multi\default.py): instantiating addon using automatically obtained id of "weather.multi" dependent on version 3.0.0 of the xbmc.python api
2024-02-02 11:33:33.166 T:8372 debug <general>: weather.multi: version 0.0.24 started: ['C:\\Users\\nic020\\AppData\\Roaming\\Kodi\\addons\\weather.multi\\default.py', '1']
2024-02-02 11:33:33.166 T:8372 debug <general>: weather.multi: location: Paris, Ile-de-France, FR
2024-02-02 11:33:33.166 T:8372 debug <general>: weather.multi: location id: 615702
2024-02-02 11:33:33.166 T:8372 debug <general>: weather.multi: cookie from settings:
2024-02-02 11:33:33.166 T:8372 debug <general>: weather.multi: crumb from settings:
2024-02-02 11:33:33.166 T:8372 debug <general>: weather.multi: stamp from settings:
2024-02-02 11:33:34.965 T:8372 debug <general>: weather.multi: EU user
2024-02-02 11:33:34.967 T:8372 debug <general>: weather.multi: EU token: CeYDObM
2024-02-02 11:33:34.967 T:8372 debug <general>: weather.multi: EU sessionid: 3_cc-session_d7a4657c-3067-44e3-9077-22d26491e3da
2024-02-02 11:33:34.967 T:8372 debug <general>: weather.multi: EU redirect https://www.yahoo.com/?guccounter=1
2024-02-02 11:33:35.745 T:8372 debug <general>: weather.multi: cookies: <RequestsCookieJar[]>
2024-02-02 11:33:36.461 T:8372 debug <general>: weather.multi: EU user
2024-02-02 11:33:36.462 T:8372 debug <general>: weather.multi: EU token: AxUFK3Q
2024-02-02 11:33:36.462 T:8372 debug <general>: weather.multi: EU sessionid: 3_cc-session_988ac64e-192f-42c0-ba12-c8a57116cebe
2024-02-02 11:33:36.462 T:8372 debug <general>: weather.multi: EU redirect https://www.yahoo.com/?guccounter=2
2024-02-02 11:33:36.628 T:8372 debug <general>: weather.multi: cookies: <RequestsCookieJar[<Cookie A1=d=AQABBADFvGUCEBKXELDvyp-PkDtXq6NiPxkFEgABCAETvmXkZeUzb2UBAiAAAAcI_ ...
2024-02-02 11:33:37.061 T:8372 debug <general>: weather.multi: save cookie to settings: d=AQABBADFvGUCEBKXELDvyp-PkDtXq6NiPxkFEgABCAETvmXkZeUzb2UBAiAAAAcI_ ...
2024-02-02 11:33:37.061 T:8372 debug <general>: weather.multi: save crumb to settings: 6NwFhK2lbpX
2024-02-02 11:33:37.061 T:8372 debug <general>: weather.multi: save stamp to settings: 1706870017
2024-02-02 11:33:37.062 T:8372 debug <general>: weather.multi: weather location: 615702
2024-02-02 11:33:37.242 T:8372 debug <general>: weather.multi: yahoo forecast data: {'weathers': [{'woeid': 615702, 'unit': 'imperial', 'location': {'woeid': 615702, ....
2024-02-02 11:33:37.249 T:8372 debug <general>: weather.multi: available locations: 1
2024-02-02 11:33:37.249 T:8372 debug <general>: weather.multi: finished
2024-02-02 11:33:37.249 T:8372 debug <general>: CPythonInvoker(7, C:\Users\nic020\AppData\Roaming\Kodi\addons\weather.multi\default.py): script successfully run
Fix: weather.py
Replace::
88: def get_ycreds(self):
89: ysess = requests.Session()
90: ycookie = ADDON.getSettingString('ycookie')
91: ycrumb = ADDON.getSettingString('ycrumb')
92: ystamp = ADDON.getSettingString('ystamp')
93: log('cookie from settings: %s' % ycookie)
94: log('crumb from settings: %s' % ycrumb)
95: log('stamp from settings: %s' % ystamp)
96: if ystamp == '' or (int(time.time()) - int(ystamp) > 31536000): # cookie expires after 1 year
97: try:
98: for URL in CURL:
99: retry = 0
100: while (retry < 6) and (not self.MONITOR.abortRequested()):
101: response = ysess.get(URL, headers=HEADERS, timeout=10)
102: if response.status_code == 200:
103: break
By::
88: def get_ycreds(self):
89:* #ysess = requests.Session()
90: ycookie = ADDON.getSettingString('ycookie')
91: ycrumb = ADDON.getSettingString('ycrumb')
92: ystamp = ADDON.getSettingString('ystamp')
93: log('cookie from settings: %s' % ycookie)
94: log('crumb from settings: %s' % ycrumb)
95: log('stamp from settings: %s' % ystamp)
96: if ystamp == '' or (int(time.time()) - int(ystamp) > 31536000): # cookie expires after 1 year
97: try:
98: for URL in CURL:
99:* ysess = requests.Session()
100 retry = 0
101: while (retry < 6) and (not self.MONITOR.abortRequested()):
102: response = ysess.get(URL, headers=HEADERS, timeout=10)
103: if response.status_code == 200:
104: break
[/quote]