Version 0.8.3
This commit is contained in:
1 parent
ea39c149cd
commit
683ba9da45
6 files changed
+43
-12
No files matched your search
@@ -138,6 +138,16 @@ msgctxt "#30037"
|
||||
msgid "Enable HDCP"
|
||||
msgstr ""
|
||||
|
||||
# For SkyOTT only
|
||||
msgctxt "#30038"
|
||||
msgid "Include forced subtitles"
|
||||
msgstr ""
|
||||
|
||||
# For SkyOTT only
|
||||
msgctxt "#30039"
|
||||
msgid "Include non forced subtitles"
|
||||
msgstr ""
|
||||
|
||||
# For SkyOTT only
|
||||
msgctxt "#30040"
|
||||
msgid "Use for these languages (e.g.: es en pt):"
|
||||
|
||||
@@ -122,6 +122,16 @@ msgctxt "#30037"
|
||||
msgid "Enable HDCP"
|
||||
msgstr "Habilitar HDCP"
|
||||
|
||||
# For SkyOTT only
|
||||
msgctxt "#30038"
|
||||
msgid "Include forced subtitles"
|
||||
msgstr "Incluir subtítulos forzados"
|
||||
|
||||
# For SkyOTT only
|
||||
msgctxt "#30039"
|
||||
msgid "Include non forced subtitles"
|
||||
msgstr "Incluir subtítulos no forzados"
|
||||
|
||||
# For SkyOTT only
|
||||
msgctxt "#30040"
|
||||
msgid "Use for these languages (e.g.: es en pt):"
|
||||
|
||||
@@ -133,7 +133,7 @@ class Movistar(object):
|
||||
LOG('device_id: {}'. format(self.account['device_id']))
|
||||
|
||||
# Tokens
|
||||
content = self.cache.load('tokens.json', 60*24)
|
||||
content = self.cache.load('tokens.json', 3)
|
||||
if content:
|
||||
data = json.loads(content)
|
||||
else:
|
||||
@@ -296,7 +296,7 @@ class Movistar(object):
|
||||
self.cache.remove_file('tokens.json')
|
||||
|
||||
def get_devices(self, use_cache=True):
|
||||
content = self.cache.load('devices.json', 60)
|
||||
content = self.cache.load('devices.json', 3)
|
||||
if use_cache and content:
|
||||
data = json.loads(content)
|
||||
else:
|
||||
@@ -436,9 +436,12 @@ class Movistar(object):
|
||||
if self.quality == 'UHD': url += '&filterQuality=UHD'
|
||||
#print(url)
|
||||
data = self.net.load_data(url)
|
||||
self.cache.save_file(cache_filename, json.dumps(data, ensure_ascii=False))
|
||||
if not 'error' in data:
|
||||
self.cache.save_file(cache_filename, json.dumps(data, ensure_ascii=False))
|
||||
|
||||
epg = {}
|
||||
if 'error' in data: return epg
|
||||
|
||||
for ch in data:
|
||||
id = ch[0]['Canal']['CodCadenaTv']
|
||||
if not id in epg: epg[id] = []
|
||||
@@ -557,9 +560,12 @@ class Movistar(object):
|
||||
url = self.endpoints['canales'].format(deviceType='webplayer', profile=self.account['platform'], mdrm='true', demarcation=demarcation)
|
||||
if self.quality == 'UHD': url += '&filterQuality=UHD'
|
||||
data = self.net.load_data(url)
|
||||
self.cache.save_file(cache_filename, json.dumps(data, ensure_ascii=False))
|
||||
if not 'error' in data:
|
||||
self.cache.save_file(cache_filename, json.dumps(data, ensure_ascii=False))
|
||||
|
||||
res = []
|
||||
if 'error' in data: return res
|
||||
|
||||
for c in data:
|
||||
t = {}
|
||||
t['info'] = {}
|
||||
|
||||
@@ -78,7 +78,7 @@ def play(params):
|
||||
if 'resultData' in d and 'cToken' in d['resultData']:
|
||||
token = d['resultData']['cToken']
|
||||
|
||||
if not addon.getSettingBool('open_session'):
|
||||
if stype == 'vod':
|
||||
d = m.delete_session()
|
||||
session_opened = False
|
||||
LOG('Delete session: d: {}'.format(d))
|
||||
|
||||
+11
-6
@@ -50,7 +50,7 @@ ttml = Ttml2SsaAddon()
|
||||
|
||||
session = requests.Session()
|
||||
session.headers.update({'user-agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0'})
|
||||
previous_token = ''
|
||||
previous_tokens = []
|
||||
|
||||
reregister_needed = False
|
||||
|
||||
@@ -170,20 +170,24 @@ class RequestHandler(BaseHTTPRequestHandler):
|
||||
token = params['token']
|
||||
LOG('token: {}'.format(token))
|
||||
|
||||
global previous_token, reregister_needed
|
||||
global previous_tokens, reregister_needed
|
||||
while True:
|
||||
LOG('reregister_needed: {}'.format(reregister_needed))
|
||||
if reregister_needed and xbmcaddon.Addon().getSettingBool('reregister'):
|
||||
mvs().unregister_device()
|
||||
mvs().register_device()
|
||||
|
||||
if previous_token == token and params['stype'] == 'vod':
|
||||
if token in previous_tokens and params['stype'] == 'vod':
|
||||
LOG('duplicated token')
|
||||
LOG('previous_tokens: {}'.format(previous_tokens))
|
||||
d = mvs().open_session(params['session_request'], params['session_token'])
|
||||
LOG('open_session: d: {}'.format(d))
|
||||
LOG('Open session (proxy): d: {}'.format(d))
|
||||
if 'resultData' in d and 'cToken' in d['resultData']:
|
||||
token = d['resultData']['cToken']
|
||||
LOG('new token: {}'.format(token))
|
||||
previous_token = token
|
||||
session_response = mvs().delete_session()
|
||||
LOG('Delete session (proxy): {}'.format(session_response))
|
||||
previous_tokens.append(token)
|
||||
|
||||
headers = {
|
||||
'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0',
|
||||
@@ -216,9 +220,10 @@ class RequestHandler(BaseHTTPRequestHandler):
|
||||
self.send_response(response.status_code)
|
||||
self.end_headers()
|
||||
self.wfile.write(license_data)
|
||||
except Exception:
|
||||
except Exception as e:
|
||||
self.send_response(500)
|
||||
self.end_headers()
|
||||
LOG('Exception error: {}'.format(str(e)))
|
||||
|
||||
|
||||
HOST = '127.0.0.1'
|
||||
|
||||
Reference in new issue
Block a user