Version 0.11.5

This commit is contained in:
Paco8 committed 2026-03-25 23:33:08 +01:00
1 parent bd0853e126
commit 6aab76c47d
3 files changed
+45 -11

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.movistarplus" <addon id="plugin.video.movistarplus"
name="Movistar+" name="Movistar+"
version="0.11.2" version="0.11.5"
provider-name="Paco8"> provider-name="Paco8">
<requires> <requires>
<!--- <import addon="xbmc.python" version="2.25.0"/> --> <!--- <import addon="xbmc.python" version="2.25.0"/> -->
+25
View File
@@ -1035,6 +1035,25 @@ class Movistar(object):
t['stream_type'] = 'u7d' t['stream_type'] = 'u7d'
t['session_request'] = '{"contentID":' + str(t['id']) + ', "streamType":"CUTV"}' t['session_request'] = '{"contentID":' + str(t['id']) + ', "streamType":"CUTV"}'
if 'ShowId' in video: t['show_id'] = video['ShowId'] if 'ShowId' in video: t['show_id'] = video['ShowId']
elif 'Pases' in d and len(d['Pases']) > 0:
video = d['Pases'][0]
t['subscribed'] = self.is_subscribed_vod(video.get('tvProducts', []))
if 'ShowId' in video: t['show_id'] = video['ShowId']
if 'Canal' in video and 'CasId' in video['Canal']:
t['cas_id'] = video['Canal']['CasId']
stype = None
if 'VODRU7D' in ed['Ficha']:
stype = 'catch-up'
t['stream_type'] = 'u7d'
t['session_request'] = '{"contentID":' + str(t['id']) + ', "streamType":"CUTV"}'
if 'UrlVideo' in video:
t['url'] = video['UrlVideo']
else:
if stype:
for l in video['links']:
if l['rel'] == stype:
t['url'] = l['href']
break
if 'DatosAccesoAnonimo' in d: if 'DatosAccesoAnonimo' in d:
da = d['DatosAccesoAnonimo'] da = d['DatosAccesoAnonimo']
t['video_format'] = da.get('FormatoVideo') t['video_format'] = da.get('FormatoVideo')
@@ -1549,6 +1568,12 @@ class Movistar(object):
os.makedirs(self.config_dir + name) os.makedirs(self.config_dir + name)
return name return name
def download_manifest(self, manifest_url):
headers = self.net.headers.copy()
headers['x-tcdn-token'] = self.get_cdntoken()
content = self.net.load_url(manifest_url, headers)
return content
@staticmethod @staticmethod
def load_file_if_exists(filename): def load_file_if_exists(filename):
content = None content = None
+19 -10
View File
@@ -147,20 +147,27 @@ def play(params):
'8huDxwWFd7OHMs3avGpr7RP7DUnTikXrh6X0') '8huDxwWFd7OHMs3avGpr7RP7DUnTikXrh6X0')
play_item = xbmcgui.ListItem(path= url) play_item = xbmcgui.ListItem(path= url)
play_item.setProperty('inputstream.adaptive.manifest_type', 'mpd') license_type = 'com.widevine.alpha'
#play_item.setProperty('inputstream.adaptive.manifest_type', 'hls') license_key = ''
if format(addon.getSetting('drm_type')) == 'Playready': if format(addon.getSetting('drm_type')) == 'Playready':
play_item.setProperty('inputstream.adaptive.license_type', 'com.microsoft.playready') license_type = 'com.microsoft.playready'
else:
play_item.setProperty('inputstream.adaptive.license_type', 'com.widevine.alpha')
if addon.getSettingBool('use_proxy_for_license') and proxy: if addon.getSettingBool('use_proxy_for_license') and proxy:
request_id = str(int(time.time()*1000)) request_id = str(int(time.time()*1000))
license_url = '{}/license?token={}&stype={}&session_request={}&request_id={}||R{{SSM}}|'.format(proxy, quote_plus(token), stype, quote_plus(params['session_request']), request_id) license_key = '{}/license?token={}&stype={}&session_request={}&request_id={}'.format(proxy, quote_plus(token), stype, quote_plus(params['session_request']), request_id)
LOG('license_url: {}'.format(license_url)) LOG('license_key: {}'.format(license_key))
play_item.setProperty('inputstream.adaptive.license_key', license_url)
else: else:
play_item.setProperty('inputstream.adaptive.license_key', '{}|{}&nv-authorizations={}|R{{SSM}}|'.format(license_url, headers, token)) license_key = license_url
headers += '&nv-authorizations={}'.format(token)
if kodi_version > 20:
play_item.setProperty('inputstream.adaptive.drm_legacy', '{}|{}|{}'.format(license_type, license_key, headers))
else:
play_item.setProperty('inputstream.adaptive.license_type', license_type)
play_item.setProperty('inputstream.adaptive.license_key', '{}|{}|R{{SSM}}|'.format(license_key, headers))
play_item.setProperty('inputstream.adaptive.manifest_type', 'mpd')
#play_item.setProperty('inputstream.adaptive.manifest_type', 'hls')
play_item.setProperty('inputstream.adaptive.stream_headers', manifest_headers) play_item.setProperty('inputstream.adaptive.stream_headers', manifest_headers)
play_item.setProperty('inputstream.adaptive.manifest_headers', manifest_headers) play_item.setProperty('inputstream.adaptive.manifest_headers', manifest_headers)
@@ -206,7 +213,9 @@ def play(params):
for sub in sublist: for sub in sublist:
filename = os.path.join(subfolder, sub['lang']) filename = os.path.join(subfolder, sub['lang'])
LOG('Converting {}'.format(sub['filename'])) LOG('Converting {}'.format(sub['filename']))
response = m.net.session.get(sub['url'], allow_redirects=True) subheaders = m.net.headers.copy()
subheaders['x-tcdn-token'] = cdn_token
response = m.net.session.get(sub['url'], allow_redirects=True, headers=subheaders)
content = response.content content = response.content
with io.open(filename + '.ttml', 'w', encoding='utf-8', newline='') as handle: with io.open(filename + '.ttml', 'w', encoding='utf-8', newline='') as handle:
handle.write(content.decode('utf-8')) handle.write(content.decode('utf-8'))