Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[weather.multi] 0.0.20 #2550

Merged
merged 1 commit into from
Dec 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion weather.multi/addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="weather.multi" name="Multi Weather" version="0.0.18" provider-name="ronie">
<addon id="weather.multi" name="Multi Weather" version="0.0.20" provider-name="ronie">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="script.openweathermap.maps" version="1.0.4"/>
Expand Down
6 changes: 6 additions & 0 deletions weather.multi/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
v0.0.20
- fix weatherbit

v0.0.19
- fix yahoo weather again

v0.0.18
- fix yahoo weather again

Expand Down
20 changes: 10 additions & 10 deletions weather.multi/lib/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def get_location(self, mode):
return location, locationid, locationlat, locationlon

def get_ycreds(self):
ysess = requests.Session()
ycookie = ADDON.getSettingString('ycookie')
ycrumb = ADDON.getSettingString('ycrumb')
ystamp = ADDON.getSettingString('ystamp')
Expand All @@ -96,25 +97,24 @@ def get_ycreds(self):
try:
retry = 0
while (retry < 6) and (not self.MONITOR.abortRequested()):
response = requests.get(CURL, headers=HEADERS, timeout=10)
response = ysess.get(CURL, headers=HEADERS, timeout=10)
if response.status_code == 200:
break
else:
self.MONITOR.waitForAbort(10)
retry += 1
log('getting yahoo website failed')
if 'consent' in response.url: # EU users need to accept cookies
if 'consent' in response.url: # EU users are asked for cookie consent
token = re.search('csrfToken" value="(.*?)"', response.text, flags=re.DOTALL).group(1)
sessionid = re.search('sessionId" value="(.*?)"', response.text, flags=re.DOTALL).group(1)
redirect = re.search('originalDoneUrl" value="(.*?)"', response.text, flags=re.DOTALL).group(1)
DATA = {'csrfToken': token, 'sessionId': sessionid, 'originalDoneUrl': redirect, 'namespace': 'yahoo', 'agree': 'agree'}
posturl = 'https://consent.yahoo.com/v2/collectConsent?sessionId=%s' % sessionid
response = requests.post(posturl, headers=HEADERS, data=DATA)
DATA = {'csrfToken': token, 'sessionId': sessionid, 'originalDoneUrl': redirect, 'namespace': 'yahoo', 'reject': 'reject'}
response = ysess.post(response.url, headers=HEADERS, data=DATA)
try:
ycookie = response.cookies['A1']
ycookie = response.cookies['A3']
except:
ycookie = response.cookies['A1S'].replace('&j=GDPR', '')
response = requests.get(YURL, headers=HEADERS, cookies=dict(A1=ycookie), timeout=10)
ycookie = response.cookies['A1']
response = ysess.get(YURL, headers=HEADERS, cookies=dict(A3=ycookie), timeout=10)
match = re.search('WeatherStore":{"crumb":"(.*?)","weathers', response.text, re.IGNORECASE)
if not match:
match = re.search("win.YAHOO.context.crumb = '(.*?)'", response.text, re.IGNORECASE)
Expand All @@ -136,7 +136,7 @@ def get_ycreds(self):
def get_data(self, url, cookie=''):
try:
if cookie:
response = requests.get(url, headers=HEADERS, cookies=dict(A1=cookie), timeout=10)
response = requests.get(url, headers=HEADERS, cookies=dict(A3=cookie), timeout=10)
else:
response = requests.get(url, headers=HEADERS, timeout=10)
return response.json()
Expand Down Expand Up @@ -166,7 +166,7 @@ def get_forecast(self, loc, locid, lat, lon, ycookie='', ycrumb=''):
return
add_weather = ''
if WADD and APPID:
daily_string = 'forecast/daily?key=%s&lat=%s&lon=%s' % (APPID, lat, lon)
daily_string = 'forecast/daily?lat=%s&lon=%s&key=%s' % (lat, lon, APPID)
url = AURL % daily_string
add_weather = self.get_data(url)
log('weatherbit data: %s' % add_weather)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ msgstr ""
"Project-Id-Version: Kodi add-ons\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: 2022-02-21 14:46+0000\n"
"Last-Translator: Alfonso Cachero <alfonso.cachero@gmail.com>\n"
"PO-Revision-Date: 2023-06-30 20:42+0000\n"
"Last-Translator: José Antonio Alvarado <jalvarado0.eses@gmail.com>\n"
"Language-Team: Spanish (Spain) <https://kodi.weblate.cloud/projects/kodi-add-ons-weather/weather-multi/es_es/>\n"
"Language: es_es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.10.1\n"
"X-Generator: Weblate 4.18\n"

msgctxt "Addon Summary"
msgid "Weather forecast from several providers"
Expand Down Expand Up @@ -407,7 +407,7 @@ msgstr "Nevada Fuerte"

msgctxt "#32291"
msgid "Blizzard"
msgstr "Tormenta de Nieve"
msgstr "Ventisca"

msgctxt "#32292"
msgid "Not Available"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ msgstr ""
"Project-Id-Version: Kodi add-ons\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: 2022-02-03 10:13+0000\n"
"Last-Translator: rimasx <riks_12@hot.ee>\n"
"PO-Revision-Date: 2023-08-05 23:11+0000\n"
"Last-Translator: Toomas Tänava <toomas.tanava@mail.ee>\n"
"Language-Team: Estonian <https://kodi.weblate.cloud/projects/kodi-add-ons-weather/weather-multi/et_ee/>\n"
"Language: et_ee\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.10.1\n"
"X-Generator: Weblate 4.18.2\n"

msgctxt "Addon Summary"
msgid "Weather forecast from several providers"
Expand Down Expand Up @@ -451,7 +451,7 @@ msgstr "Kahanev kuu"

msgctxt "#32306"
msgid "Last Quarter"
msgstr "Viimane veerandik"
msgstr "Viimane veerand"

msgctxt "#32307"
msgid "Waning Crescent"
Expand Down
94 changes: 47 additions & 47 deletions weather.multi/resources/language/resource.language.is_is/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ msgstr ""
"Project-Id-Version: Kodi add-ons\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: 2021-11-12 18:30+0000\n"
"PO-Revision-Date: 2023-09-29 12:11+0000\n"
"Last-Translator: Sveinn í Felli <[email protected]>\n"
"Language-Team: Icelandic <https://kodi.weblate.cloud/projects/kodi-add-ons-weather/weather-multi/is_is/>\n"
"Language: is_is\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n % 10 != 1 || n % 100 == 11;\n"
"X-Generator: Weblate 4.8.1\n"
"X-Generator: Weblate 5.0.2\n"

msgctxt "Addon Summary"
msgid "Weather forecast from several providers"
Expand Down Expand Up @@ -247,183 +247,183 @@ msgstr "Úrkoma óþekkt"

msgctxt "#32251"
msgid "Tornado"
msgstr ""
msgstr "Hvirfilbylur"

msgctxt "#32252"
msgid "Tropical Storm"
msgstr ""
msgstr "Hitabeltisstormur"

msgctxt "#32253"
msgid "Hurricane"
msgstr ""
msgstr "Fellibylur"

msgctxt "#32254"
msgid "Severe Thunderstorms"
msgstr ""
msgstr "Varhugavert hvassviðri"

msgctxt "#32255"
msgid "Thunderstorms"
msgstr ""
msgstr "Þrumuveður"

msgctxt "#32256"
msgid "Mixed Rain and Snow"
msgstr ""
msgstr "Ýmist regn eða snjókoma"

msgctxt "#32257"
msgid "Mixed Rain and Sleet"
msgstr ""
msgstr "Ýmist rigning eða slydda"

msgctxt "#32258"
msgid "Mixed Snow and Sleet"
msgstr ""
msgstr "Ýmist snjókoma eða slydda"

msgctxt "#32259"
msgid "Freezing Drizzle"
msgstr ""
msgstr "Frostsúld"

msgctxt "#32260"
msgid "Drizzle"
msgstr ""
msgstr "Súld"

msgctxt "#32261"
msgid "Freezing Rain"
msgstr ""
msgstr "Frostrigning"

msgctxt "#32262"
msgid "Showers"
msgstr ""
msgstr "Skúrir"

msgctxt "#32263"
msgid "Rain"
msgstr ""
msgstr "Rigning"

msgctxt "#32264"
msgid "Snow Flurries"
msgstr ""
msgstr "Snjóhryðjur"

msgctxt "#32265"
msgid "Light Snow Showers"
msgstr ""
msgstr "Dálítil snjóél"

msgctxt "#32266"
msgid "Blowing Snow"
msgstr ""
msgstr "Skafrenningur"

msgctxt "#32267"
msgid "Snow"
msgstr ""
msgstr "Snjókoma"

msgctxt "#32268"
msgid "Hail"
msgstr ""
msgstr "Haglél"

msgctxt "#32269"
msgid "Sleet"
msgstr ""
msgstr "Slydda"

msgctxt "#32270"
msgid "Dust"
msgstr ""
msgstr "Ryk"

msgctxt "#32271"
msgid "Foggy"
msgstr ""
msgstr "Þoka"

msgctxt "#32272"
msgid "Haze"
msgstr ""
msgstr "Mistur"

msgctxt "#32273"
msgid "Smoky"
msgstr ""
msgstr "Reykjarkóf"

msgctxt "#32274"
msgid "Blustery"
msgstr ""
msgstr "Vindhviður"

msgctxt "#32275"
msgid "Windy"
msgstr ""
msgstr "Vindasamt"

msgctxt "#32276"
msgid "Cold"
msgstr ""
msgstr "Kalt"

msgctxt "#32277"
msgid "Cloudy"
msgstr ""
msgstr "Skýjað"

msgctxt "#32278"
msgid "Mostly Cloudy"
msgstr ""
msgstr "Alskýjað"

msgctxt "#32279"
msgid "Partly Cloudy"
msgstr ""
msgstr "Hálfskýjað"

msgctxt "#32280"
msgid "Clear"
msgstr ""
msgstr "Heiðskírt"

msgctxt "#32281"
msgid "Sunny"
msgstr ""
msgstr "Sólskin"

msgctxt "#32282"
msgid "Fair"
msgstr ""
msgstr "Bjartviðri"

msgctxt "#32283"
msgid "Mixed Rain and Hail"
msgstr ""
msgstr "Ýmist rigning eða haglél"

msgctxt "#32284"
msgid "Hot"
msgstr ""
msgstr "Heitt"

msgctxt "#32285"
msgid "Isolated Thunderstorms"
msgstr ""
msgstr "Þrumuveður á köflum"

msgctxt "#32286"
msgid "Scattered Thunderstorms"
msgstr ""
msgstr "Þrumuveður á dreif"

msgctxt "#32287"
msgid "Scattered Showers"
msgstr ""
msgstr "Skúrir á dreif"

msgctxt "#32288"
msgid "Heavy Rain"
msgstr ""
msgstr "Úrfelli"

msgctxt "#32289"
msgid "Scattered Snow Showers"
msgstr ""
msgstr "Snjóél á dreif"

msgctxt "#32290"
msgid "Heavy Snow"
msgstr ""
msgstr "Talsverð snjókoma"

msgctxt "#32291"
msgid "Blizzard"
msgstr ""
msgstr "Snjóbylur"

msgctxt "#32292"
msgid "Not Available"
msgstr ""
msgstr "Ekki tiltækt"

msgctxt "#32293"
msgid "Scattered Showers"
msgstr ""
msgstr "Skúrir á dreif"

msgctxt "#32294"
msgid "Scattered Snow Showers"
msgstr ""
msgstr "Snjóél á dreif"

msgctxt "#32295"
msgid "Scattered Thundershowers"
msgstr ""
msgstr "Þrumuskúrir á dreif"

msgctxt "#32300"
msgid "New Moon"
Expand Down
Loading
Loading