Skip to content

Commit

Permalink
[script.module.srgssr@matrix] 2.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
goggle committed Feb 10, 2025
1 parent 0728849 commit c99ce98
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion script.module.srgssr/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="script.module.srgssr" name="SRG SSR" version="2.2.4" provider-name="Alexander Seiler">
<addon id="script.module.srgssr" name="SRG SSR" version="2.2.5" provider-name="Alexander Seiler">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="script.module.inputstreamhelper" version="0.5.10"/>
Expand Down
23 changes: 12 additions & 11 deletions script.module.srgssr/lib/srgssr.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

# Copyright (C) 2018 Alexander Seiler
#
#
Expand Down Expand Up @@ -87,7 +85,7 @@ def __init__(self, plugin_handle, bu='srf', addon_id=ADDON_ID):
self.playtv_url = f'{self.host_url}/play/tv'
self.apiv3_url = f'{self.host_url}/play/v3/api/{bu}/production/'
self.data_regex = \
r'<script>window.__SSR_VIDEO_DATA__\s*=\s*(.+?)</script>'
r'window.__remixContext\s*=\s*(.+?);\s*</script>'
self.data_uri = f'special://home/addons/{self.addon_id}/resources/data'
self.media_uri = \
f'special://home/addons/{self.addon_id}/resources/media'
Expand Down Expand Up @@ -191,6 +189,7 @@ def open_url(self, url, use_cache=True):
xbmcgui.Dialog().notification(
ADDON_NAME, LANGUAGE(30100), ICON, 4000)
return ''
response.encoding = 'UTF-8'
self.cache.set(
f'{ADDON_NAME}.open_url, url = {url}',
response.text,
Expand Down Expand Up @@ -424,7 +423,7 @@ def build_all_shows_menu(self, favids=None):
shows.
Keyword arguments:
favids -- A list of show ids (strings) respresenting the favourite
favids -- A list of show ids (strings) representing the favourite
shows. If such a list is provided, only the folders for
the shows on that list will be build. (default: None)
"""
Expand Down Expand Up @@ -471,8 +470,9 @@ def build_homepage_menu(self):
"""
Builds the homepage menu.
"""
self.build_menu_from_page(self.playtv_url, (
'initialData', 'pacPageConfigs', 'landingPage', 'sections'))
self.build_menu_from_page(
self.playtv_url, ('state', 'loaderData', 'play-now', 'initialData',
'pacPageConfigs', 'landingPage', 'sections'))

def build_menu_from_page(self, url, path):
"""
Expand Down Expand Up @@ -728,9 +728,10 @@ def build_menu_by_urn(self, urn):
elif 'video' in urn:
self.build_episode_menu(id)
elif 'topic' in urn:
self.build_menu_from_page(self.playtv_url, (
'initialData', 'pacPageConfigs', 'topicPages',
urn, 'sections'))
self.build_menu_from_page(
self.playtv_url, ('state', 'loaderData', 'play-now',
'initialData', 'pacPageConfigs',
'topicPages', urn, 'sections'))

def build_entry(self, json_entry, is_folder=False, audio=False,
fanart=None, urn=None, show_image_url=None,
Expand Down Expand Up @@ -1074,7 +1075,7 @@ def get_auth_url(self, url, segment_data=None):
spl = urlps(url).path.split('/')
token = json.loads(
self.open_url(
f'http://tp.srgssr.ch/akahd/token?acl=/{spl[1]}/{spl[2]}/*',
f'https://tp.srgssr.ch/akahd/token?acl=/{spl[1]}/{spl[2]}/*',
use_cache=False)) or {}
auth_params = token.get('token', {}).get('authparams')
if auth_params:
Expand Down Expand Up @@ -1272,7 +1273,7 @@ def get_subtitles(self, url, name):

cap_comps = caption.split(':')
lang = '.' + cap_comps[1] if len(cap_comps) > 1 else ''
sub_url = ('http://' + webvttbaseurl + '/' + cap_comps[0])
sub_url = ('https://' + webvttbaseurl + '/' + cap_comps[0])
self.log('subtitle url: ' + sub_url)
if not sub_url.endswith('.m3u8'):
return [sub_url]
Expand Down
4 changes: 1 addition & 3 deletions script.module.srgssr/lib/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

# Copyright (C) 2018 Alexander Seiler
#
#
Expand Down Expand Up @@ -84,7 +82,7 @@ def str_or_none(inp, default=None):

def get_duration(duration_string):
"""
Converts a duration string into an integer respresenting the
Converts a duration string into an integer representing the
total duration in seconds. There are three possible input string
forms possible, either
<hours>:<minutes>:<seconds>
Expand Down

0 comments on commit c99ce98

Please # to comment.