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
3 changes: 3 additions & 0 deletions plugin.video.vrt.nu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ leave a message at [our Facebook page](https://facebook.com/kodivrtnu/).
</table>

## Releases
### v2.5.37 (2025-04-04)
- Fix DRM streams (@mediaminister)

### v2.5.36 (2025-03-03)
- Fix program listings (@malc0mn)

Expand Down
5 changes: 4 additions & 1 deletion plugin.video.vrt.nu/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.vrt.nu" name="VRT MAX" version="2.5.36+matrix.1" provider-name="Martijn Moreel, dagwieers, mediaminister">
<addon id="plugin.video.vrt.nu" name="VRT MAX" version="2.5.37+matrix.1" provider-name="Martijn Moreel, dagwieers, mediaminister">
<requires>
<import addon="resource.images.studios.white" version="0.0.22"/>
<import addon="script.module.beautifulsoup4" version="4.6.2"/>
Expand Down Expand Up @@ -42,6 +42,9 @@
<website>https://github.com/add-ons/plugin.video.vrt.nu/wiki</website>
<source>https://github.com/add-ons/plugin.video.vrt.nu</source>
<news>
v2.5.37 (2025-04-04)
- Fix DRM streams

v2.5.36 (2025-03-03)
- Fix program listings

Expand Down
21 changes: 3 additions & 18 deletions plugin.video.vrt.nu/resources/lib/streamservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
class StreamService:
"""Collect and prepare stream info for Kodi Player"""

_VUPLAY_API_URL = 'https://api.vuplay.co.uk'
_VUALTO_API_URL = 'https://media-services-public.vrt.be/media-aggregator/v2'
_CLIENT = 'vrtnu-web@PROD'
_VUALTO_LICENSE_URL = 'https://widevine-proxy.drm.technology/proxy'
_UPLYNK_LICENSE_URL = 'https://content.uplynk.com/wv'
_INVALID_LOCATION = 'INVALID_LOCATION'
_INCOMPLETE_ROAMING_CONFIG = 'INCOMPLETE_ROAMING_CONFIG'
Expand All @@ -34,20 +34,6 @@ def __init__(self, _tokenresolver):
self._create_settings_dir()
self._can_play_drm = can_play_drm()

def _get_vualto_license_url(self):
"""Get Widevine license URL from Vualto API"""
# Try cache
data = get_cache('vualto_license_url.json')
if data:
return data.get('la_url')

vualto_license_url = get_url_json(url=self._VUPLAY_API_URL, fail={}).get('drm_providers', {}).get('widevine', {})
if vualto_license_url:
from json import dumps
vualto_license_url.update(expirationDate=generate_expiration_date(hours=168))
update_cache('vualto_license_url.json', dumps(vualto_license_url))
return vualto_license_url.get('la_url')

@staticmethod
def _create_settings_dir():
"""Create settings directory"""
Expand Down Expand Up @@ -111,7 +97,7 @@ def _get_stream_json(self, api_data, roaming=False):
from json import dumps
# Warning: Currently, the drmExpired key in the stream_json cannot be used because it provides a wrong 6 hour ttl for the VUDRM tokens.
# After investigation these tokens seem to have an expiration time of only two hours, so we set the expirationDate value accordingly.
stream_json.update(expirationDate=generate_expiration_date(hours=2), vualto_license_url=self._get_vualto_license_url())
stream_json.update(expirationDate=generate_expiration_date(hours=2))
cache_file = api_data.video_id + '.json'
update_cache(cache_file, dumps(stream_json))
return stream_json
Expand Down Expand Up @@ -172,7 +158,6 @@ def get_stream(self, video, roaming=False, api_data=None):
uplynk = 'uplynk.com' in stream_json.get('targetUrls')[0].get('url')

vudrm_token = stream_json.get('drm')
vualto_license_url = stream_json.get('vualto_license_url') or self._get_vualto_license_url()
drm_stream = (vudrm_token or uplynk)

# Select streaming protocol
Expand Down Expand Up @@ -222,7 +207,7 @@ def get_stream(self, video, roaming=False, api_data=None):
if vudrm_token:
stream = StreamURLS(
manifest_url,
license_url=vualto_license_url,
license_url=self._VUALTO_LICENSE_URL,
license_headers={'X-VUDRM-TOKEN': vudrm_token},
use_inputstream_adaptive=True
)
Expand Down