Version 0.8.11
This commit is contained in:
1 parent
826791476b
commit
8a1fb36228
5 files changed
+42
-12
No files matched your search
@@ -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.8.9"
|
version="0.8.11"
|
||||||
provider-name="Paco8">
|
provider-name="Paco8">
|
||||||
<requires>
|
<requires>
|
||||||
<!--- <import addon="xbmc.python" version="2.25.0"/> -->
|
<!--- <import addon="xbmc.python" version="2.25.0"/> -->
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ from .log import LOG, print_json
|
|||||||
from .network import Network
|
from .network import Network
|
||||||
from .cache import Cache
|
from .cache import Cache
|
||||||
from .timeconv import *
|
from .timeconv import *
|
||||||
|
from .useragent import useragent
|
||||||
|
|
||||||
class Movistar(object):
|
class Movistar(object):
|
||||||
account = {'username': '', 'password': '',
|
account = {'username': '', 'password': '',
|
||||||
@@ -45,7 +46,7 @@ class Movistar(object):
|
|||||||
'Accept-Language': 'es-ES,es;q=0.9',
|
'Accept-Language': 'es-ES,es;q=0.9',
|
||||||
'Origin': 'https://ver.movistarplus.es',
|
'Origin': 'https://ver.movistarplus.es',
|
||||||
'Referer': 'https://ver.movistarplus.es/',
|
'Referer': 'https://ver.movistarplus.es/',
|
||||||
'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0'
|
'User-Agent': useragent
|
||||||
}
|
}
|
||||||
self.net = Network()
|
self.net = Network()
|
||||||
self.net.headers = headers
|
self.net.headers = headers
|
||||||
@@ -445,7 +446,24 @@ class Movistar(object):
|
|||||||
self.cache.save_file('profile_id.conf', self.account['profile_id'])
|
self.cache.save_file('profile_id.conf', self.account['profile_id'])
|
||||||
self.cache.remove_file('tokens.json')
|
self.cache.remove_file('tokens.json')
|
||||||
|
|
||||||
def get_epg(self):
|
def load_epg_data(self, date_str, duration=2, channels=''):
|
||||||
|
demarcation = self.account['demarcation']
|
||||||
|
url = self.endpoints['rejilla'].format(deviceType='webplayer', profile=self.account['platform'], UTCDATETIME=date_str, DURATION=duration, CHANNELS=channels, NETWORK='movistarplus', mdrm='true', demarcation=demarcation)
|
||||||
|
if self.quality == 'UHD': url += '&filterQuality=UHD'
|
||||||
|
#LOG(url)
|
||||||
|
data = self.net.load_data(url)
|
||||||
|
return data
|
||||||
|
|
||||||
|
def get_epg(self, date=None, duration=2, channels=None):
|
||||||
|
if channels:
|
||||||
|
if not date:
|
||||||
|
today = datetime.today()
|
||||||
|
date_str = today.strftime('%Y-%m-%dT00:00:00')
|
||||||
|
ch_data = self.load_epg_data(date_str, duration, channels)
|
||||||
|
if not ch_data: return []
|
||||||
|
data = []
|
||||||
|
data.append(ch_data)
|
||||||
|
else:
|
||||||
cache_filename = 'epg_{}.json'.format(self.quality)
|
cache_filename = 'epg_{}.json'.format(self.quality)
|
||||||
content = self.cache.load(cache_filename, 6*60)
|
content = self.cache.load(cache_filename, 6*60)
|
||||||
if content:
|
if content:
|
||||||
@@ -453,10 +471,7 @@ class Movistar(object):
|
|||||||
else:
|
else:
|
||||||
today = datetime.today()
|
today = datetime.today()
|
||||||
str_now = today.strftime('%Y-%m-%dT00:00:00')
|
str_now = today.strftime('%Y-%m-%dT00:00:00')
|
||||||
url = self.endpoints['rejilla'].format(deviceType='webplayer', profile=self.account['platform'], UTCDATETIME=str_now, DURATION=2, CHANNELS='', NETWORK='movistarplus', mdrm='true', demarcation=self.account['demarcation'])
|
data = self.load_epg_data(str_now)
|
||||||
if self.quality == 'UHD': url += '&filterQuality=UHD'
|
|
||||||
#print(url)
|
|
||||||
data = self.net.load_data(url)
|
|
||||||
if not 'error' in data:
|
if not 'error' in data:
|
||||||
self.cache.save_file(cache_filename, json.dumps(data, ensure_ascii=False))
|
self.cache.save_file(cache_filename, json.dumps(data, ensure_ascii=False))
|
||||||
|
|
||||||
@@ -1011,7 +1026,8 @@ class Movistar(object):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def epg_to_movies(self, channel_id):
|
def epg_to_movies(self, channel_id):
|
||||||
epg = self.get_epg()
|
LOG('epg_to_movies: {}'.format(channel_id))
|
||||||
|
epg = self.get_epg(channels=channel_id)
|
||||||
res = []
|
res = []
|
||||||
if not channel_id in epg: return res
|
if not channel_id in epg: return res
|
||||||
for p in epg[channel_id]:
|
for p in epg[channel_id]:
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ from .log import LOG
|
|||||||
from .movistar import *
|
from .movistar import *
|
||||||
from .addon import *
|
from .addon import *
|
||||||
from .gui import *
|
from .gui import *
|
||||||
|
from .useragent import useragent
|
||||||
|
|
||||||
kodi_version= int(xbmc.getInfoLabel('System.BuildVersion')[:2])
|
kodi_version= int(xbmc.getInfoLabel('System.BuildVersion')[:2])
|
||||||
|
|
||||||
@@ -99,12 +100,12 @@ def play(params):
|
|||||||
LOG("url: {}".format(url))
|
LOG("url: {}".format(url))
|
||||||
|
|
||||||
headers = 'Content-Type=application/octet-stream'
|
headers = 'Content-Type=application/octet-stream'
|
||||||
headers += '&User-Agent=Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0'
|
headers += '&User-Agent=' + useragent
|
||||||
headers += '&Accept=*/*&Accept-Language=es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3'
|
headers += '&Accept=*/*&Accept-Language=es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3'
|
||||||
headers += '&Referer=https://ver.movistarplus.es/'
|
headers += '&Referer=https://ver.movistarplus.es/'
|
||||||
headers += '&Origin=https://ver.movistarplus.es'
|
headers += '&Origin=https://ver.movistarplus.es'
|
||||||
#headers += '&Host=wv-ottlic-f3.imagenio.telefonica.net'
|
#headers += '&Host=wv-ottlic-f3.imagenio.telefonica.net'
|
||||||
manifest_headers = 'User-Agent=Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0'
|
manifest_headers = 'User-Agent=' + useragent
|
||||||
|
|
||||||
if stype == 'tv':
|
if stype == 'tv':
|
||||||
cdn_token = m.get_cdntoken()
|
cdn_token = m.get_cdntoken()
|
||||||
@@ -204,6 +205,10 @@ def play(params):
|
|||||||
subpaths.append(filename_srt)
|
subpaths.append(filename_srt)
|
||||||
play_item.setSubtitles(subpaths)
|
play_item.setSubtitles(subpaths)
|
||||||
|
|
||||||
|
if True:
|
||||||
|
m.unregister_device()
|
||||||
|
m.register_device()
|
||||||
|
|
||||||
xbmcplugin.setResolvedUrl(_handle, True, listitem=play_item)
|
xbmcplugin.setResolvedUrl(_handle, True, listitem=play_item)
|
||||||
|
|
||||||
LOG('**** session_opened: {}'.format(session_opened))
|
LOG('**** session_opened: {}'.format(session_opened))
|
||||||
|
|||||||
@@ -44,12 +44,13 @@ import xbmcaddon
|
|||||||
from .b64 import encode_base64
|
from .b64 import encode_base64
|
||||||
from .log import LOG
|
from .log import LOG
|
||||||
from .addon import profile_dir
|
from .addon import profile_dir
|
||||||
|
from .useragent import useragent
|
||||||
|
|
||||||
from ttml2ssa import Ttml2SsaAddon
|
from ttml2ssa import Ttml2SsaAddon
|
||||||
ttml = Ttml2SsaAddon()
|
ttml = Ttml2SsaAddon()
|
||||||
|
|
||||||
session = requests.Session()
|
session = requests.Session()
|
||||||
session.headers.update({'user-agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0'})
|
session.headers.update({'user-agent': useragent})
|
||||||
previous_tokens = []
|
previous_tokens = []
|
||||||
|
|
||||||
reregister_needed = False
|
reregister_needed = False
|
||||||
@@ -192,7 +193,7 @@ class RequestHandler(BaseHTTPRequestHandler):
|
|||||||
previous_tokens.append(token)
|
previous_tokens.append(token)
|
||||||
|
|
||||||
headers = {
|
headers = {
|
||||||
'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0',
|
'User-Agent': useragent,
|
||||||
'Accept': '*/*',
|
'Accept': '*/*',
|
||||||
'Accept-Language': 'es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3',
|
'Accept-Language': 'es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3',
|
||||||
'Referer': 'https://ver.movistarplus.es/',
|
'Referer': 'https://ver.movistarplus.es/',
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# encoding: utf-8
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||||
|
|
||||||
|
from __future__ import unicode_literals, absolute_import, division
|
||||||
|
|
||||||
|
useragent = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0'
|
||||||
Reference in new issue
Block a user