1919class StreamService :
2020 """Collect and prepare stream info for Kodi Player"""
2121
22- _VUPLAY_API_URL = 'https://api.vuplay.co.uk'
2322 _VUALTO_API_URL = 'https://media-services-public.vrt.be/media-aggregator/v2'
2423 _CLIENT = 'vrtnu-web@PROD'
24+ _VUALTO_LICENSE_URL = 'https://widevine-proxy.drm.technology/proxy'
2525 _UPLYNK_LICENSE_URL = 'https://content.uplynk.com/wv'
2626 _INVALID_LOCATION = 'INVALID_LOCATION'
2727 _INCOMPLETE_ROAMING_CONFIG = 'INCOMPLETE_ROAMING_CONFIG'
@@ -34,20 +34,6 @@ def __init__(self, _tokenresolver):
3434 self ._create_settings_dir ()
3535 self ._can_play_drm = can_play_drm ()
3636
37- def _get_vualto_license_url (self ):
38- """Get Widevine license URL from Vualto API"""
39- # Try cache
40- data = get_cache ('vualto_license_url.json' )
41- if data :
42- return data .get ('la_url' )
43-
44- vualto_license_url = get_url_json (url = self ._VUPLAY_API_URL , fail = {}).get ('drm_providers' , {}).get ('widevine' , {})
45- if vualto_license_url :
46- from json import dumps
47- vualto_license_url .update (expirationDate = generate_expiration_date (hours = 168 ))
48- update_cache ('vualto_license_url.json' , dumps (vualto_license_url ))
49- return vualto_license_url .get ('la_url' )
50-
5137 @staticmethod
5238 def _create_settings_dir ():
5339 """Create settings directory"""
@@ -111,7 +97,7 @@ def _get_stream_json(self, api_data, roaming=False):
11197 from json import dumps
11298 # Warning: Currently, the drmExpired key in the stream_json cannot be used because it provides a wrong 6 hour ttl for the VUDRM tokens.
11399 # After investigation these tokens seem to have an expiration time of only two hours, so we set the expirationDate value accordingly.
114- stream_json .update (expirationDate = generate_expiration_date (hours = 2 ), vualto_license_url = self . _get_vualto_license_url () )
100+ stream_json .update (expirationDate = generate_expiration_date (hours = 2 ))
115101 cache_file = api_data .video_id + '.json'
116102 update_cache (cache_file , dumps (stream_json ))
117103 return stream_json
@@ -172,7 +158,6 @@ def get_stream(self, video, roaming=False, api_data=None):
172158 uplynk = 'uplynk.com' in stream_json .get ('targetUrls' )[0 ].get ('url' )
173159
174160 vudrm_token = stream_json .get ('drm' )
175- vualto_license_url = stream_json .get ('vualto_license_url' ) or self ._get_vualto_license_url ()
176161 drm_stream = (vudrm_token or uplynk )
177162
178163 # Select streaming protocol
@@ -222,7 +207,7 @@ def get_stream(self, video, roaming=False, api_data=None):
222207 if vudrm_token :
223208 stream = StreamURLS (
224209 manifest_url ,
225- license_url = vualto_license_url ,
210+ license_url = self . _VUALTO_LICENSE_URL ,
226211 license_headers = {'X-VUDRM-TOKEN' : vudrm_token },
227212 use_inputstream_adaptive = True
228213 )
0 commit comments