Skip to content
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
24 changes: 5 additions & 19 deletions plugin.video.viwx/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="plugin.video.viwx" name="viwX" version="1.7.2" provider-name="Dimitri Kroon">
<addon id="plugin.video.viwx" name="viwX" version="1.7.4" provider-name="Dimitri Kroon">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="inputstream.adaptive" version="19.0.5"/>
Expand All @@ -8,7 +8,7 @@
<import addon="script.module.tzdata" version="0.2.1"/>
<import addon="script.module.tzlocal" version="5.0.1"/>
<import addon="script.module.codequick" version="1.0.3"/>
<import addon="script.module.inputstreamhelper" version="0.6.1"/>
<import addon="script.module.inputstreamhelper" version="0.8.3"/>
</requires>
<extension point="xbmc.python.pluginsource" library="addon.py">
<provides>video</provides>
Expand All @@ -31,23 +31,9 @@
<fanart>resources/fanart.png</fanart>
</assets>
<news>
[B]v1.7.2[/B]
[B]Fixes:[/B]
- In some cases, Kodi continued to run the previous version for a while after the add-on was updated.
- Short news clips fail to play in category News.
- Support live items without start and end time.

[B]v 1.7.1[/B]
[B]Fixes:[/B]
- Short sport clips fail to play with error 'Not Found'

[B]v 1.7.0[/B]
[B]New Features:[/B]
- Optional full HD streams - must be enabled in settings, off by default.

[B]Fixes:[/B]
- Search with live items in the results failed.
- Some episode listings failed.
[B]v 1.7.4[/B]
- Fixed collection list was empty due to changes at ITVX.
- Re-enabled inputstream helper.
</news>
<reuselanguageinvoker>true</reuselanguageinvoker>
</extension>
Expand Down
11 changes: 11 additions & 0 deletions plugin.video.viwx/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
v 1.7.4
Fixes:
- Collection list was empty, due to changes at ITVX.

Changes:
- Re-enabled inputstream helper (undoing changes of 1.7.3 now that inputstreamhelper has been fixed).

v 1.7.3
Hotfix:
- Videos fail to play with the message: "Could not make the request. Your internet may be down."

v 1.7.2
Fixes:
- In some cases, Kodi continued to run the previous version for a while after the add-on was updated.
Expand Down
17 changes: 6 additions & 11 deletions plugin.video.viwx/resources/lib/itvx.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright (c) 2022-2025 Dimitri Kroon.
# This file is part of plugin.video.viwx.
# SPDX-License-Identifier: GPL-2.0-or-later
# See LICENSE.txt
# See LICENSE.txt or https://www.gnu.org/licenses/gpl-2.0.txt
# ----------------------------------------------------------------------------------------------------------------------

import time
Expand Down Expand Up @@ -223,21 +223,16 @@ def collection_content(url=None, slider=None, hide_paid=False):
return

else:
# `slider` is the name of an editorialSlider.
# On the main page editorialSliders is a dict, on collection pages it is a list.
# Although a dict on the main page, the names of the sliders are not exactly the
# same as the keys of the dict.
# `slider` is the id of an editorialSlider.
# Until now all editorial sliders on the main page have a 'view all' button, so
# the contents of the slider itself should never be used, but better allow it
# now in case it ever changes.
if is_main_page:
sliders_list = page_data['editorialSliders'].values()
else:
sliders_list = page_data['editorialSliders']
sliders_list = page_data['editorialSliders']
items_list = None
for slider_item in sliders_list:
if slider_item['collection']['sliderName'] == slider:
items_list = slider_item['collection']['shows']
if slider_item['id'] == slider:
# Try to get the items form the main page or from a collections page.
items_list = slider_item.get('items') or slider_item['collection']['shows']
break
if items_list is None:
logger.error("Failed to parse collection content: Unknown slider '%s'", slider)
Expand Down
4 changes: 2 additions & 2 deletions plugin.video.viwx/resources/lib/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) 2022-2025 Dimitri Kroon.
# This file is part of plugin.video.viwx.
# SPDX-License-Identifier: GPL-2.0-or-later
# See LICENSE.txt
# See LICENSE.txt or https://www.gnu.org/licenses/gpl-2.0.txt
# ----------------------------------------------------------------------------------------------------------------------

import logging
Expand Down Expand Up @@ -330,7 +330,7 @@ def list_collections(_):
if item:
yield Listitem.from_dict(list_collection_content, **item['show'])

for slider in main_page['editorialSliders'].values():
for slider in main_page['editorialSliders']:
item = parsex.parse_editorial_slider(url, slider)
if item:
yield Listitem.from_dict(list_collection_content, **item['show'])
Expand Down
61 changes: 39 additions & 22 deletions plugin.video.viwx/resources/lib/parsex.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright (c) 2022-2025 Dimitri Kroon.
# This file is part of plugin.video.viwx.
# SPDX-License-Identifier: GPL-2.0-or-later
# See LICENSE.txt
# See LICENSE.txt or https://www.gnu.org/licenses/gpl-2.0.txt
# ----------------------------------------------------------------------------------------------------------------------

import json
Expand Down Expand Up @@ -293,25 +293,34 @@ def parse_editorial_slider(url, slider_data):
"""Parse editorialSliders from the main page or from a collection."""
# noinspection PyBroadException
try:
coll_data = slider_data['collection']
if not coll_data.get('shows'):
# Has happened. Items without field `shows` have an invalid headingLink
return None
page_link = coll_data.get('headingLink')
base_url = 'https://www.itv.com/watch'
if page_link:
# Link to the collection's page if available
params = {'url': base_url + page_link['href']}
header = slider_data.get('header')
if header:
# slider from the main page
params = {'url': 'https://www.itv.com' + header['linkHref']}
title = header['title']

else:
# Provide the slider name when the collection contents are the
# items in the slider on the original page.
slider_name = slider_data['collection']['sliderName']
params = {'url': url, 'slider': slider_name}
# slider from a collection page
coll_data = slider_data['collection']
if not coll_data.get('shows'):
# Has happened. Items without a field `shows` have an invalid headingLink
return None
title = coll_data['headingTitle']
page_link = coll_data.get('headingLink')
base_url = 'https://www.itv.com/watch'
if page_link:
# Link to the collection's page if available
params = {'url': base_url + page_link['href']}
else:
# Provide the slider id when the collection contents are the
# items in the slider on the original page.
params = {'url': url, 'slider': slider_data['id']}

return {'type': 'collection',
'show': {'label': coll_data['headingTitle'],
'show': {'label': title,
'params': params,
'info': {'sorttitle': sort_title(coll_data['headingTitle'])}}}
'info': {'sorttitle': sort_title(title),
}}}
except:
logger.error("Unexpected error parsing editorialSlider from %s", url, exc_info=True)
return None
Expand Down Expand Up @@ -499,19 +508,27 @@ def parse_item_type_collection(item_data):
Only items from heroContent seem to have a field `ctaLabel`.

"""
url = '/'.join(('https://www.itv.com/watch/collections',
item_data.get('titleSlug', ''),
item_data.get('collectionId') or item_data['pageId']))
if 'href' in item_data:
# This is a new format found in the main page's editorial rails
url = 'https://www.itv.com' + item_data['href']
else:
# A format still found on collection pages and hero rail.
url = '/'.join(('https://www.itv.com/watch/collections',
item_data.get('titleSlug', ''),
item_data.get('collectionId') or item_data['pageId']))
if item_data['contentType'] == 'page':
# This querystring is required for page items
url += '?ind'

title = item_data['title']
descr = '\n\n'.join(txt for txt in (item_data.get('ctaLabel', 'Collection'), item_data.get('description')) if txt)
descr = '\n\n'.join(txt for txt in (item_data.get('ctaLabel', 'Collection'),
item_data.get('description'),
item_data.get('subtitle')) if txt)
img_template = item_data.get('imageTemplate') or item_data['partnershipTileImageTemplate']
item = {
'label': title,
'art': {'thumb': item_data['imageTemplate'].format(**IMG_PROPS_THUMB),
'fanart': item_data['imageTemplate'].format(**IMG_PROPS_FANART)},
'art': {'thumb': img_template.format(**IMG_PROPS_THUMB),
'fanart': img_template.format(**IMG_PROPS_FANART)},
'info': {'title': '[B]{}[/B]'.format(title),
'plot': descr,
'sorttitle': sort_title(title)},
Expand Down