Skip to content

Commit c14e526

Browse files
authored
Merge pull request #4694 from dimkroon/matrix-viwx-172
[plugin.video.viwx] v1.7.2
2 parents 9dd27d5 + 757df99 commit c14e526

File tree

15 files changed

+546
-268
lines changed

15 files changed

+546
-268
lines changed

plugin.video.viwx/addon.xml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<addon id="plugin.video.viwx" name="viwX" version="1.6.2" provider-name="Dimitri Kroon">
2+
<addon id="plugin.video.viwx" name="viwX" version="1.7.2" provider-name="Dimitri Kroon">
33
<requires>
44
<import addon="xbmc.python" version="3.0.0"/>
55
<import addon="inputstream.adaptive" version="19.0.5"/>
66
<import addon="script.module.requests" version="2.31.0"/>
7-
<import addon="script.module.pytz" version="2023.3"/>
7+
<import addon="script.module.backports.zoneinfo" version="0.2.1"/>
8+
<import addon="script.module.tzdata" version="0.2.1"/>
89
<import addon="script.module.tzlocal" version="5.0.1"/>
910
<import addon="script.module.codequick" version="1.0.3"/>
1011
<import addon="script.module.inputstreamhelper" version="0.6.1"/>
@@ -16,7 +17,7 @@
1617
<platform>all</platform>
1718
<summary lang="en_GB">Live TV and video on-demand from ITVX (UK only, ITVX account required)</summary>
1819
<description lang="en_GB">
19-
A Vibrant ITVX Web eXperience. Play live TV and video on-demand from the webservices of British broadcaster ITV. An ITVX account is required, either free or premium, to play any stream.[CR][CR]This add-on is not developed by ITV and is no way affiliated with, or endorsed by ITV.
20+
A Vibrant ITVX Web eXperience. Play live TV and video on-demand from the webservices of British broadcaster ITV. An ITVX account is required, either free or premium, to play any stream.[CR][CR]This add-on is not developed by ITV and is in no way affiliated with, or endorsed by ITV.
2021
</description>
2122
<disclaimer lang="en_GB">
2223
This addon is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -30,9 +31,23 @@
3031
<fanart>resources/fanart.png</fanart>
3132
</assets>
3233
<news>
33-
[B]v 1.6.2[/B]
34+
[B]v1.7.2[/B]
3435
[B]Fixes:[/B]
35-
- Logging in to IVX account with username and password works again.
36+
- In some cases, Kodi continued to run the previous version for a while after the add-on was updated.
37+
- Short news clips fail to play in category News.
38+
- Support live items without start and end time.
39+
40+
[B]v 1.7.1[/B]
41+
[B]Fixes:[/B]
42+
- Short sport clips fail to play with error 'Not Found'
43+
44+
[B]v 1.7.0[/B]
45+
[B]New Features:[/B]
46+
- Optional full HD streams - must be enabled in settings, off by default.
47+
48+
[B]Fixes:[/B]
49+
- Search with live items in the results failed.
50+
- Some episode listings failed.
3651
</news>
3752
<reuselanguageinvoker>true</reuselanguageinvoker>
3853
</extension>

plugin.video.viwx/changelog.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
v 1.7.2
2+
Fixes:
3+
- In some cases, Kodi continued to run the previous version for a while after the add-on was updated.
4+
- Short news clips fail to play in category News.
5+
- Support live items without start and end time.
6+
7+
v 1.7.1
8+
Fixes:
9+
- Short sport clips fail to play with error 'Not Found'
10+
11+
v 1.7.0
12+
New Features:
13+
- Optional full HD streams - must be enabled in settings, off by default.
14+
15+
Fixes:
16+
- Search with live items in the results failed.
17+
- Some episode listings failed.
18+
119
v 1.6.2
220
Fixes:
321
- Logging in to IVX account with username and password works again.

plugin.video.viwx/resources/language/resource.language.en_gb/strings.po

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ msgctxt "#30121"
7373
msgid "Offer to play from the start"
7474
msgstr ""
7575

76+
msgctxt "#30122"
77+
msgid "TV region"
78+
msgstr ""
79+
7680
msgctxt "#30131"
7781
msgid "Install IPTV Manager"
7882
msgstr ""
@@ -85,6 +89,14 @@ msgctxt "#30133"
8589
msgid "Go to IPTV Manager settings"
8690
msgstr ""
8791

92+
msgctxt "#30140"
93+
msgid "Stream quality"
94+
msgstr ""
95+
96+
msgctxt "#30141"
97+
msgid "Enable full HD (1080p)"
98+
msgstr ""
99+
88100
msgctxt "#30200"
89101
msgid "itvX account"
90102
msgstr ""
@@ -134,9 +146,9 @@ msgid "When a category or collection has more items than specified here, items w
134146
msgstr ""
135147

136148
msgctxt "#30311"
137-
msgid "Target of itvX logging.\n"
149+
msgid "Target of viwX logging.\n"
138150
"Default is the standard 'Kodi log' - nothing will be logged until 'debug logging' is enabled in Kodi's settings.\n"
139-
"'File' logs to itvX's own log file stored in the addon's user data directory. Only of use if you know where to "
151+
"'File' logs to viwX's own log file stored in the addon's user data directory. Only of use if you know where to "
140152
"find that file.\n"
141153
"'No logging' if you want to ensure the addon spends as little time on logging as possible."
142154
msgstr ""
@@ -146,11 +158,21 @@ msgid "Show a dialog with the option to play the current program from the start
146158
"When disabled 'play form the start' is still available on the context menu of the main live channels."
147159
msgstr ""
148160

161+
msgctxt "#30322"
162+
msgid "Region for local news and weather on ITV1.\n"
163+
"Only available when Full HD is enabled."
164+
msgstr ""
165+
149166
msgctxt "#30332"
150167
msgid "It may take a few hours before this setting takes effect.\n"
151168
"To force an update, select 'Refresh channels and guide now' in IPTV Manager's settings. You may also need te restart Kodi."
152169
msgstr ""
153170

171+
msgctxt "#30341"
172+
msgid "May not work on all devices.\n"
173+
"When streams don't play, switch off to revert back to 720p HD."
174+
msgstr ""
175+
154176
msgctxt "#30401"
155177
msgid "You will be asked to enter your username and password after which the addon will try to sign in to "
156178
"your account. You will remain signed in until you sign out or sign in with another account."

plugin.video.viwx/resources/lib/cc_patch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ----------------------------------------------------------------------------------------------------------------------
2-
# Copyright (c) 2022-2023 Dimitri Kroon.
2+
# Copyright (c) 2022-2025 Dimitri Kroon.
33
# This file is part of plugin.video.viwx.
44
# SPDX-License-Identifier: GPL-2.0-or-later
55
# See LICENSE.txt
@@ -53,4 +53,4 @@ def label_setter(self, label):
5353
self.params.setdefault("_title_", unformatted_label)
5454
self.info.setdefault("title", unformatted_label)
5555

56-
Listitem.label = Listitem.label.setter(label_setter)
56+
Listitem.label = Listitem.label.setter(label_setter) # type: ignore

plugin.video.viwx/resources/lib/fetch.py

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# See LICENSE.txt
66
# ----------------------------------------------------------------------------------------------------------------------
77

8+
from __future__ import annotations
89
import os
910
import logging
1011
import requests
@@ -74,7 +75,7 @@ class CustomHttpAdapter(HTTPAdapter):
7475
def init_poolmanager(self, *args, **kwargs):
7576
import urllib3
7677
import ssl
77-
logger.info('Urllib3 version %s', urllib3.__version__)
78+
logger.info('Urllib3 version %s', urllib3.__version__) # type: ignore
7879
logger.info(ssl.OPENSSL_VERSION)
7980

8081
ctx = ssl.create_default_context()
@@ -123,27 +124,10 @@ def request(
123124
hooks=hooks, stream=stream, verify=verify, cert=cert, json=json)
124125

125126
# noinspection PyUnresolvedReferences
126-
self.cookies.save()
127+
self.cookies.save() # type: ignore
127128
return resp
128129

129130

130-
def convert_consent(cookiejar):
131-
"""Replace Cassie consent cookies for Syrenis.
132-
133-
"""
134-
# RequestCookieJar's items() returns a list of tuples
135-
try:
136-
for name, value in cookiejar.items():
137-
if name.startswith("Cassie"):
138-
del cookiejar[name]
139-
140-
set_default_cookies(cookiejar)
141-
cookiejar.cassie_converted = True
142-
cookiejar.save()
143-
except:
144-
logger.error("Error converting consent cookies:\n", exc_info=True)
145-
146-
147131
def _create_cookiejar():
148132
"""Restore a cookiejar from file. If the file does not exist create new one and
149133
apply the default cookies.
@@ -159,17 +143,14 @@ def _create_cookiejar():
159143
# if the file has been copied from another system.
160144
cj.filename = cookie_file
161145
logger.info("Restored cookies from file")
162-
if not getattr(cj, "cassie_converted", None):
163-
convert_consent(cj)
164-
165146
except (FileNotFoundError, pickle.UnpicklingError):
166-
cj = set_default_cookies(PersistentCookieJar(cookie_file))
167-
cj.cassie_converted = True
147+
cj = PersistentCookieJar(cookie_file)
148+
set_default_cookies(cj)
168149
logger.info("Created new cookiejar")
169150
return cj
170151

171152

172-
def set_default_cookies(cookiejar: RequestsCookieJar = None):
153+
def set_default_cookies(cookiejar: RequestsCookieJar | None = None):
173154
"""Post a cookie consent form rejecting all cookies.
174155
175156
On success, set the required consent and other cookies.
@@ -232,7 +213,10 @@ def set_default_cookies(cookiejar: RequestsCookieJar = None):
232213
# Set consent cookies to reject all.
233214
jar.set('SyrenisGuid_213aea86-31e5-43f3-8d6b-e01ba0d420c7', my_guid, **std_cookie_args)
234215
jar.set('SyrenisCookieFormConsent_213aea86-31e5-43f3-8d6b-e01ba0d420c7',
235-
'[{"FieldID":"s122_c113","IsChecked":0},{"FieldID":"s135_c126","IsChecked":0},{"FieldID":"s134_c125","IsChecked":0},{"FieldID":"s138_c129","IsChecked":0},{"FieldID":"s157_c147","IsChecked":0},{"FieldID":"s136_c127","IsChecked":0},{"FieldID":"s137_c128","IsChecked":0}]',
216+
'[{"FieldID":"s122_c113","IsChecked":0},{"FieldID":"s135_c126","IsChecked":0},'
217+
'{"FieldID":"s134_c125","IsChecked":0},{"FieldID":"s138_c129","IsChecked":0},'
218+
'{"FieldID":"s157_c147","IsChecked":0},{"FieldID":"s136_c127","IsChecked":0},'
219+
'{"FieldID":"s137_c128","IsChecked":0}]',
236220
**std_cookie_args)
237221
jar.set('SyrenisCookiePrivacyLink_213aea86-31e5-43f3-8d6b-e01ba0d420c7', '1', **std_cookie_args)
238222
jar.set('SyrenisCookieConsentDate_213aea86-31e5-43f3-8d6b-e01ba0d420c7',
@@ -260,6 +244,7 @@ def web_request(method, url, headers=None, data=None, **kwargs):
260244
resp.raise_for_status()
261245
return resp
262246
except requests.HTTPError as e:
247+
resp = e.response
263248
# noinspection PyUnboundLocalVariable
264249
logger.info("HTTP error %s for url %s: '%s'",
265250
e.response.status_code,

plugin.video.viwx/resources/lib/iptvmanager.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,29 @@
1616
# Logo URLs from now/next.
1717
CHANNELS = {
1818
'ITV1': {'id': 'viwx.itv1',
19-
'name': 'ITV1',
20-
'logo': 'https://images.ctfassets.net/bd5zurrrnk1g/54OefyIkbiHPMJUYApbuUX/7dfe2176762fd8ec10f77cd61a318b07/itv1.png?w=512',
21-
'preset': 1},
19+
'name': 'ITV1',
20+
'logo': 'https://images.ctfassets.net/bd5zurrrnk1g/'
21+
'54OefyIkbiHPMJUYApbuUX/7dfe2176762fd8ec10f77cd61a318b07/itv1.png?w=512',
22+
'preset': 1},
2223
'ITV2': {'id': 'viwx.itv2',
2324
'name': 'ITV2',
24-
'logo': 'https://images.ctfassets.net/bd5zurrrnk1g/aV9MOsYOMEXHx3iw0p4tk/57b35173231c4290ff199ef8573367ad/itv2.png?w=512',
25+
'logo': 'https://images.ctfassets.net/bd5zurrrnk1g/'
26+
'aV9MOsYOMEXHx3iw0p4tk/57b35173231c4290ff199ef8573367ad/itv2.png?w=512',
2527
'preset': 2},
2628
'ITVBe': {'id': 'viwx.itvbe',
2729
'name': 'ITVBe',
28-
'logo': 'https://images.ctfassets.net/bd5zurrrnk1g/6Mul5JVrb06pRu8bNDgIAe/b5309fa32322cc3db398d25e523e2b2e/itvBe.png?w=512',
30+
'logo': 'https://images.ctfassets.net/bd5zurrrnk1g/'
31+
'6Mul5JVrb06pRu8bNDgIAe/b5309fa32322cc3db398d25e523e2b2e/itvBe.png?w=512',
2932
'preset': 3},
3033
'ITV3': {'id': 'viwx.itv3',
3134
'name': 'ITV3',
32-
'logo': 'https://images.ctfassets.net/bd5zurrrnk1g/39fJAu9LbUJptatyAs8HkL/80ac6eb141104854b209da946ae7a02f/itv3.png?w=512',
35+
'logo': 'https://images.ctfassets.net/bd5zurrrnk1g/'
36+
'39fJAu9LbUJptatyAs8HkL/80ac6eb141104854b209da946ae7a02f/itv3.png?w=512',
3337
'preset': 4},
3438
'ITV4': {'id': 'viwx.itv4',
3539
'name': 'ITV4',
36-
'logo': 'https://images.ctfassets.net/bd5zurrrnk1g/6Dv76O9mtWd6m7DzIavtsf/b3d491289679b8030eae7b4a7db58f2d/itv4.png?w=512',
40+
'logo': 'https://images.ctfassets.net/bd5zurrrnk1g/'
41+
'6Dv76O9mtWd6m7DzIavtsf/b3d491289679b8030eae7b4a7db58f2d/itv4.png?w=512',
3742
'preset': 5}
3843
}
3944

@@ -80,8 +85,8 @@ def send_epg(self):
8085
from resources.lib.itvx import get_full_schedule
8186

8287
schedules = get_full_schedule()
83-
epg = {CHANNELS[k]['id']: v for k, v in schedules.items()}
84-
return dict(version=1, epg=epg)
88+
epg_data = {CHANNELS[k]['id']: v for k, v in schedules.items()}
89+
return dict(version=1, epg=epg_data)
8590

8691

8792
@Script.register
@@ -96,7 +101,7 @@ def channels(_, port):
96101
@Script.register
97102
def epg(_, port):
98103
try:
99-
IPTVManager(int(port)).send_epg()
104+
IPTVManager(int(port)).send_epg()
100105
except Exception as err:
101106
# Catch all errors to prevent codequick showing an error message
102107
xbmc.log("[viwX] Error in iptvmanager.epg: {!r}.".format(err))

0 commit comments

Comments
 (0)