Version 0.9.9

This commit is contained in:
Paco8 committed 2024-09-16 13:18:12 +02:00
1 parent dd9e4b7929
commit cb01797826
3 files changed
+19 -15

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.9.8" version="0.9.9"
provider-name="Paco8"> provider-name="Paco8">
<requires> <requires>
<!--- <import addon="xbmc.python" version="2.25.0"/> --> <!--- <import addon="xbmc.python" version="2.25.0"/> -->
+15 -11
View File
@@ -210,22 +210,24 @@ class Movistar(object):
data = {"accountNumber": self.account['id'], data = {"accountNumber": self.account['id'],
"userProfile": self.account['profile_id'], "userProfile": self.account['profile_id'],
"streamMiscellanea":"HTTPS", "streamMiscellanea":"HTTPS",
"deviceType":"WP_OTT", #"deviceType":"WP_OTT",
"deviceManufacturerProduct":"Firefox", #"deviceManufacturerProduct":"Firefox",
"deviceType":"SMARTTV_OTT",
"deviceManufacturerProduct":"LG",
"streamDRM":"Widevine", "streamDRM":"Widevine",
"streamFormat":"DASH", "streamFormat":"DASH",
} }
headers = self.net.headers.copy() headers = self.net.headers.copy()
headers['Content-Type'] = 'application/json' headers['Content-Type'] = 'application/json'
headers['X-Movistarplus-Ui'] = '2.36.30' #headers['X-Movistarplus-Ui'] = '2.36.30'
headers['X-Movistarplus-Os'] = 'Linux88' #headers['X-Movistarplus-Os'] = 'Linux88'
headers['X-Movistarplus-Deviceid'] = self.account['device_id'] headers['X-Movistarplus-Deviceid'] = self.account['device_id']
headers['Authorization'] = 'Bearer ' + self.account['access_token'] headers['Authorization'] = 'Bearer ' + self.account['access_token']
#print_json(data) #print_json(data)
#print_json(headers) #print_json(headers)
url = self.endpoints['initdata'].format(deviceType='webplayer', DEVICEID=self.account['device_id']) url = self.endpoints['initdata'].format(deviceType=self.dplayer, DEVICEID=self.account['device_id'])
response = self.net.session.post(url, data=json.dumps(data), headers=headers) response = self.net.session.post(url, data=json.dumps(data), headers=headers)
content = response.content.decode('utf-8') content = response.content.decode('utf-8')
#LOG('get_token response: {}'.format(content)) #LOG('get_token response: {}'.format(content))
@@ -239,7 +241,7 @@ class Movistar(object):
headers = self.net.headers.copy() headers = self.net.headers.copy()
headers['Access-Control-Request-Method'] = 'POST' headers['Access-Control-Request-Method'] = 'POST'
headers['Access-Control-Request-Headers'] = 'content-type,x-hzid' headers['Access-Control-Request-Headers'] = 'content-type,x-hzid'
url = self.endpoints['setUpStream'].format(PID=self.account['pid'], deviceCode='WP_OTT', PLAYREADYID=self.account['device_id']) url = self.endpoints['setUpStream'].format(PID=self.account['pid'], deviceCode='SMARTTV_OTT', PLAYREADYID=self.account['device_id'])
response = self.net.session.options(url, headers=headers) response = self.net.session.options(url, headers=headers)
content = response.content.decode('utf-8') content = response.content.decode('utf-8')
return content return content
@@ -250,7 +252,7 @@ class Movistar(object):
headers = self.net.headers.copy() headers = self.net.headers.copy()
headers['Content-Type'] = 'application/json' headers['Content-Type'] = 'application/json'
headers['X-Hzid'] = session_token headers['X-Hzid'] = session_token
url = self.endpoints['setUpStream'].format(PID=self.account['pid'], deviceCode='WP_OTT', PLAYREADYID=self.account['device_id']) url = self.endpoints['setUpStream'].format(PID=self.account['pid'], deviceCode='SMARTTV_OTT', PLAYREADYID=self.account['device_id'])
if session_id != None: if session_id != None:
url += '/' + session_id url += '/' + session_id
#LOG('open_session: url: {}'.format(url)) #LOG('open_session: url: {}'.format(url))
@@ -405,7 +407,7 @@ class Movistar(object):
headers = self.net.headers.copy() headers = self.net.headers.copy()
headers['Content-Type'] = 'text/plain;charset=UTF-8' headers['Content-Type'] = 'text/plain;charset=UTF-8'
data = '{"X-HZId":"' + session_token +'","X-Content-Type":"application/json","X-Operation":"DELETE"}' data = '{"X-HZId":"' + session_token +'","X-Content-Type":"application/json","X-Operation":"DELETE"}'
url = self.endpoints['tearDownStream'].format(PID=self.account['pid'], deviceCode='WP_OTT', PLAYREADYID=self.account['device_id'], SessionID=id) url = self.endpoints['tearDownStream'].format(PID=self.account['pid'], deviceCode='SMARTTV_OTT', PLAYREADYID=self.account['device_id'], SessionID=id)
response = self.net.session.post(url, headers=headers, data=data) response = self.net.session.post(url, headers=headers, data=data)
content = response.content.decode('utf-8') content = response.content.decode('utf-8')
return content return content
@@ -441,15 +443,17 @@ class Movistar(object):
data = {"accountNumber": self.account['id'], data = {"accountNumber": self.account['id'],
"sessionUserProfile": self.account['profile_id'], "sessionUserProfile": self.account['profile_id'],
"streamMiscellanea":"HTTPS", "streamMiscellanea":"HTTPS",
"deviceType":"WP_OTT", #"deviceType":"WP_OTT",
"deviceManufacturerProduct":"Firefox", #"deviceManufacturerProduct":"Firefox",
"deviceType":"SMARTTV_OTT",
"deviceManufacturerProduct":"LG",
"streamDRM":"Widevine", "streamDRM":"Widevine",
"streamFormat":"DASH", "streamFormat":"DASH",
} }
headers = self.net.headers.copy() headers = self.net.headers.copy()
headers['Content-Type'] = 'application/json' headers['Content-Type'] = 'application/json'
headers['Authorization'] = 'Bearer ' + self.account['access_token'] headers['Authorization'] = 'Bearer ' + self.account['access_token']
url = self.endpoints['renovacion_hztoken'].format(deviceType='webplayer', DEVICEID=self.account['device_id']) url = self.endpoints['renovacion_hztoken'].format(deviceType=self.dplayer, DEVICEID=self.account['device_id'])
data = self.net.post_data(url, json.dumps(data), headers) data = self.net.post_data(url, json.dumps(data), headers)
return data.get('homeZoneID') return data.get('homeZoneID')
+3 -3
View File
@@ -628,9 +628,9 @@ def select_account(id, name):
m.switch_account(id) m.switch_account(id)
open_folder(name) open_folder(name)
add_menu_option(addon.getLocalizedString(30183), get_url(action='login')) # Login with username add_menu_option(addon.getLocalizedString(30183), get_url(action='login')) # Login with username
add_menu_option(addon.getLocalizedString(30181), get_url(action='login_with_key')) # Login with key #add_menu_option(addon.getLocalizedString(30181), get_url(action='login_with_key')) # Login with key
if os.path.exists(os.path.join(m.cache.config_directory, 'auth.key')): #if os.path.exists(os.path.join(m.cache.config_directory, 'auth.key')):
add_menu_option(addon.getLocalizedString(30184), get_url(action='export_key')) # Export key # add_menu_option(addon.getLocalizedString(30184), get_url(action='export_key')) # Export key
add_menu_option(addon.getLocalizedString(30150), get_url(action='logout')) # Close session add_menu_option(addon.getLocalizedString(30150), get_url(action='logout')) # Close session
close_folder() close_folder()