Skip to content

Commit e9fa9d0

Browse files
authored
Merge pull request #4698 from thomas-ernest/plugin.video.arteplussept@matrix
[plugin.video.arteplussept@matrix] 1.4.3
2 parents 5f13509 + 62afc81 commit e9fa9d0

File tree

6 files changed

+42
-30
lines changed

6 files changed

+42
-30
lines changed

plugin.video.arteplussept/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Changelog also available in file ./addon.xml xpath /addon/extension/news following Kodi guidelines https://kodi.wiki/view/Add-on_structure#changelog.txt
22

3+
v1.4.3 (2025-8-4)
4+
- Fix playing live stream (disabling HLS).
5+
36
v1.4.2 (2024-1-3)
47
- Rename quality parameter.
58
- Use https to get HBB TV Stream info.

plugin.video.arteplussept/addon.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,14 @@ def streams(program_id):
154154
return plugin.finish(view.build_video_streams(plugin, settings, program_id))
155155

156156

157-
@plugin.route('/play_live/<stream_url>', name='play_live')
158-
def play_live(stream_url):
159-
"""Play live content."""
160-
return plugin.set_resolved_url({'path': stream_url})
161-
162157
# Cannot read video new arte tv program API. Blocked by FFMPEG issue #10149
163158
# @plugin.route('/play_artetv/<program_id>', name='play_artetv')
159+
#
160+
# @plugin.route('/play_live/<stream_url>', name='play_live')
161+
# def play_live(stream_url):
162+
# """Play live content."""
163+
# return plugin.set_resolved_url({'path': stream_url})
164+
#
164165
# def play_artetv(program_id):
165166
# item = api.player_video(settings.language, program_id)
166167
# attr = item.get('attributes')

plugin.video.arteplussept/addon.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<addon id="plugin.video.arteplussept" name="Arte +7" version="1.4.2" provider-name="bmf, thomas-ernest">
2+
<addon id="plugin.video.arteplussept" name="Arte +7" version="1.4.3" provider-name="bmf, thomas-ernest">
33
<!-- https://kodi.wiki/view/Addon.xml -->
44
<requires>
55
<import addon="xbmc.python" version="3.0.0"/>
@@ -56,6 +56,8 @@ https://github.com/thomas-ernest/plugin.video.arteplussept
5656
<website>https://www.arte.tv/fr/</website>
5757
<source>https://github.com/thomas-ernest/plugin.video.arteplussept</source>
5858
<news>
59+
v1.4.3 (2025-8-4)
60+
- Fix playing live stream (disabling HLS).
5961
v1.4.2 (2024-1-3)
6062
- Rename quality parameter.
6163
- Use https to get HBB TV Stream info.

plugin.video.arteplussept/resources/lib/mapper/arteitem.py

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def _build_item(self, path, is_playable):
5959
return {
6060
'label': label,
6161
'path': path,
62-
'thumbnail': self._get_image_url(),
62+
'thumbnail': self._get_image_url('480x270', True),
6363
'is_playable': is_playable,
6464
'info_type': 'video',
6565
'info': {
@@ -70,7 +70,7 @@ def _build_item(self, path, is_playable):
7070
'aired': self._get_air_date()
7171
},
7272
'properties': {
73-
'fanart_image': self._get_image_url(),
73+
'fanart_image': self._get_image_url('1920x1080', False),
7474
'TotalTime': str(self._get_duration()),
7575
},
7676
'context_menu': [
@@ -109,7 +109,7 @@ def _get_air_date(self):
109109
"""
110110
return None
111111

112-
def _get_image_url(self):
112+
def _get_image_url(self, wished_res, wished_text):
113113
"""
114114
Abstract method to be implemented in child classes.
115115
Return url to image to display for the current item.
@@ -208,7 +208,7 @@ def build_item(self, path, is_playable):
208208
'playcount': '1' if progress >= 0.95 else '0',
209209
},
210210
'properties': {
211-
'fanart_image': self._get_image_url(),
211+
'fanart_image': self._get_image_url('1920x1080', False),
212212
# ResumeTime and TotalTime deprecated.
213213
# Use InfoTagVideo.setResumePoint() instead.
214214
'ResumeTime': str(self._get_time_offset()),
@@ -238,20 +238,27 @@ def _parse_date_artetv(self, datestr):
238238
date = None
239239
return date
240240

241-
def _get_image_url(self):
241+
def _get_image_url(self, wished_res, wished_text):
242242
item = self.json_dict
243243
image_url = None
244+
# extracting image from arte tv player endpoint
244245
if item.get('images') and item.get('images')[0] and item.get('images')[0].get('url'):
245-
# Remove query param type=TEXT to avoid title embeded in image
246-
image_url = item.get('images')[0].get('url').replace('?type=TEXT', '')
247-
# Set same image for fanart and thumbnail to spare network bandwidth
248-
# and business logic easier to maintain
249-
# if item.get('images')[0].get('alternateResolutions'):
250-
# smallerImage = item.get('images')[0].get('alternateResolutions')[3]
251-
# if smallerImage and smallerImage.get('url'):
252-
# thumbnailUrl = smallerImage.get('url').replace('?type=TEXT', '')
253-
if not image_url:
254-
image_url = item.get('mainImage').get('url').replace('__SIZE__', '1920x1080')
246+
image_url = item.get('images')[0].get('url')
247+
# extracting image from content data from arte tv home page or zone endpoint
248+
if item.get('mainImage') and item.get('mainImage').get('url'):
249+
image_url = item.get('mainImage').get('url')
250+
251+
# post processing
252+
if isinstance(image_url, str):
253+
if wished_text is False:
254+
# Remove query param type=TEXT to avoid title embeded in image
255+
image_url = image_url.replace('?type=TEXT', '')
256+
if isinstance(wished_res, str):
257+
# 940x530 is the most common size from player endpoint
258+
# __SIZE__ is the size from home page or zone endpoint
259+
for from_str in ['/940x530', '/__SIZE__']:
260+
image_url = image_url.replace(from_str, f"/{wished_res}")
261+
255262
return image_url
256263

257264
def _get_kind(self):
@@ -300,7 +307,7 @@ def build_item(self, path, is_playable):
300307
# year is not correctly used by kodi :(
301308
# the aired year will be used by kodi for production year :(
302309
# 'year': int(config.get('productionYear')),
303-
'country': [country.get('label') for country in \
310+
'country': [country.get('label') for country in
304311
item.get('productionCountries', [])],
305312
'director': item.get('director'),
306313
},
@@ -326,7 +333,8 @@ def _parse_date_hbbtv(self, datestr):
326333
level=xbmc.LOGWARNING)
327334
return date
328335

329-
def _get_image_url(self):
336+
def _get_image_url(self, wished_res, wished_text):
337+
# parameter are ignored in HBB TV, but needed for abstraction | inheritance
330338
return self.json_dict.get('imageUrl')
331339

332340
def _get_kind(self):

plugin.video.arteplussept/resources/lib/mapper/live.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import html
77
# the goal is to break/limit this dependency as much as possible
8-
from resources.lib.mapper import mapper
98
from resources.lib.mapper.arteitem import ArteTvVideoItem
109

1110

@@ -27,10 +26,11 @@ def format_title_and_subtitle(self):
2726
label += f" - {html.unescape(subtitle)}"
2827
return label
2928

30-
def build_item_live(self, quality, audio_slot):
29+
def build_item_live(self):
3130
"""Return menu entry to watch live content from Arte TV API"""
32-
# program_id = item.get('id')
3331
item = self.json_dict
32+
# Remove language at the end e.g. _fr, _de
33+
program_id = item.get('id')[:-3]
3434
attr = item.get('attributes')
3535
meta = attr.get('metadata')
3636

@@ -48,12 +48,10 @@ def build_item_live(self, quality, audio_slot):
4848
# smallerImage = item.get('images')[0].get('alternateResolutions')[3]
4949
# if smallerImage and smallerImage.get('url'):
5050
# thumbnailUrl = smallerImage.get('url').replace('?type=TEXT', '')
51-
stream_url = mapper.map_playable(
52-
attr.get('streams'), quality, audio_slot, mapper.match_artetv).get('path')
5351

5452
return {
5553
'label': self.format_title_and_subtitle(),
56-
'path': self.plugin.url_for('play_live', stream_url=stream_url),
54+
'path': self.plugin.url_for('play', kind='SHOW', program_id=program_id),
5755
# playing the stream from program id makes the live starts from the beginning
5856
# while it starts the video like the live tv, with the above
5957
# 'path': plugin.url_for('play', kind='SHOW', program_id=programId.replace('_fr', '')),

plugin.video.arteplussept/resources/lib/view.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def build_home_page(plugin, settings, cached_categories):
2020
try:
2121
addon_menu.append(
2222
ArteLiveItem(plugin, api.player_video(settings.language, 'LIVE'))
23-
.build_item_live(settings.quality, '1'))
23+
.build_item_live())
2424
# pylint: disable=broad-exception-caught
2525
# Could be improve. possible exceptions are limited to auth. errors
2626
except Exception as error:

0 commit comments

Comments
 (0)