Version 0.11.8

This commit is contained in:
Paco8 committed 2026-07-02 10:01:50 +02:00
1 parent 930b238204
commit 0739cca0a9
5 files changed
+65 -24

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.6" version="0.11.8"
provider-name="Paco8"> provider-name="Paco8">
<requires> <requires>
<!--- <import addon="xbmc.python" version="2.25.0"/> --> <!--- <import addon="xbmc.python" version="2.25.0"/> -->
+2 -1
View File
@@ -32,5 +32,6 @@ endpoints = {
"setUpStream": "https://alkasvaspub.imagenio.telefonica.net/asvas/ccs/{PID}/{deviceCode}/{PLAYREADYID}/Session", "setUpStream": "https://alkasvaspub.imagenio.telefonica.net/asvas/ccs/{PID}/{deviceCode}/{PLAYREADYID}/Session",
"tearDownStream": "https://alkasvaspub.imagenio.telefonica.net/asvas/ccs/{PID}/{deviceCode}/{PLAYREADYID}/Session/{SessionID}", "tearDownStream": "https://alkasvaspub.imagenio.telefonica.net/asvas/ccs/{PID}/{deviceCode}/{PLAYREADYID}/Session/{SessionID}",
"token": "https://auth.dof6.com/auth/oauth2/token?deviceClass={deviceType}", "token": "https://auth.dof6.com/auth/oauth2/token?deviceClass={deviceType}",
"ultimasreproducciones": "https://perso.dof6.com/movistarplus/{deviceType}/users/{DIGITALPLUSUSERIDC}/viewings?profile={PROFILE}&container=trackedseries&mediaType=FOTOH&idsOnly={idsOnly}&accountNumber={ACCOUNTNUMBER}&version=8&start={start}&end={end}&mdrm={mdrm}&tlsstream=true&demarcation={demarcation}" "ultimasreproducciones": "https://perso.dof6.com/movistarplus/{deviceType}/users/{DIGITALPLUSUSERIDC}/viewings?profile={PROFILE}&container=trackedseries&mediaType=FOTOH&idsOnly={idsOnly}&accountNumber={ACCOUNTNUMBER}&version=8&start={start}&end={end}&mdrm={mdrm}&tlsstream=true&demarcation={demarcation}",
"watermarks": "https://ottcache.dof6.com/movistarplus/{deviceType}/channels/{uid}/watermarks?profile={profile}&mdrm=true"
} }
+26 -3
View File
@@ -661,6 +661,11 @@ class Movistar(object):
t['session_request'] = '{"contentID":"'+ t['id'] +'", "streamType":"CHN"}' t['session_request'] = '{"contentID":"'+ t['id'] +'", "streamType":"CHN"}'
t['subscribed'] = self.is_subscribed_channel(c.get('tvProducts', [])) t['subscribed'] = self.is_subscribed_channel(c.get('tvProducts', []))
t['info']['playcount'] = 1 # Set as watched t['info']['playcount'] = 1 # Set as watched
t['uid'] = c.get('Uid')
if False and 'links' in c:
for l in c['links']:
if l['rel'] == 'watermarks':
t['watermark_url'] = l['href']
# epg # epg
#if add_epg_info: #if add_epg_info:
# program = c['Pases'][0] # program = c['Pases'][0]
@@ -1378,8 +1383,8 @@ class Movistar(object):
if only_subscribed and not t['subscribed']: continue if only_subscribed and not t['subscribed']: continue
url = t['stream'] url = t['stream']
if 'cas_id' in t: url += '&cas_id=' + t['cas_id'] if 'cas_id' in t: url += '&cas_id=' + t['cas_id']
item = '#EXTINF:-1 tvg-name="{name}" tvg-id="{id}" tvg-logo="{logo}" tvg-chno="{preset}" group-title="Movistar+",{name}\n{stream}\n\n'.format( item = '#EXTINF:-1 tvg-name="{name}" tvg-id="{id}" tvg-logo="{logo}" tvg-chno="{preset}" {catchup} group-title="Movistar+",{name}\n{stream}\n\n'.format(
name=t['name'], id=t['id'], logo=t['logo'], preset=t['preset'], stream=url) name=t['name'], id=t['id'], logo=t['logo'], preset=t['preset'], stream=url, catchup='catchup="default" catchup-source="{catchup-id}" catchup-days="7"')
items.append(item) items.append(item)
res = '#EXTM3U\n## Movistar+\n{}'.format(''.join(items)) res = '#EXTM3U\n## Movistar+\n{}'.format(''.join(items))
with io.open(filename, 'w', encoding='utf-8', newline='') as handle: with io.open(filename, 'w', encoding='utf-8', newline='') as handle:
@@ -1479,7 +1484,7 @@ class Movistar(object):
if url: if url:
url = url.replace('&', '&amp;') url = url.replace('&', '&amp;')
res.append('<programme start="{}" stop="{}" channel="{}"'.format(start, stop, ch['id']) + res.append('<programme start="{}" stop="{}" channel="{}"'.format(start, stop, ch['id']) +
#(' catchup-id="{}"'.format(url) if url else "") + (' catchup-id="{}"'.format(url) if url else "") +
'>\n' + '>\n' +
' <title>{}</title>\n'.format(html_escape(e['title'])) + ' <title>{}</title>\n'.format(html_escape(e['title'])) +
' <sub-title>{}</sub-title>\n'.format(html_escape(e['subtitle']))) ' <sub-title>{}</sub-title>\n'.format(html_escape(e['subtitle'])))
@@ -1589,3 +1594,21 @@ class Movistar(object):
content = unicode(content, 'utf-8') content = unicode(content, 'utf-8')
with io.open(filename, 'w', encoding='utf-8') as handle: with io.open(filename, 'w', encoding='utf-8') as handle:
handle.write(content) handle.write(content)
def get_watermarks(self, uid, test=False):
if test:
now = datetime.utcnow()
watermarks = []
start = now + timedelta(seconds=20)
for i in range(5):
stop = start + timedelta(seconds=18)
watermarks.append({
'start': start.strftime('%Y-%m-%dT%H:%M:%SZ'),
'stop': stop.strftime('%Y-%m-%dT%H:%M:%SZ')
})
start = start + timedelta(minutes=1)
return watermarks
else:
url = self.endpoints['watermarks'].format(deviceType='webplayer', uid=uid, profile='OTT')
data = self.net.load_data(url)
return data.get('watermarks', [])
+34 -19
View File
@@ -8,6 +8,8 @@ import sys
import json import json
import io import io
import os.path import os.path
from datetime import datetime, timedelta
from .timeconv import isodate2date
import xbmc import xbmc
import xbmcgui import xbmcgui
@@ -96,13 +98,12 @@ def play(params):
# url = url.replace('DASH_WPC_WIDEVINE', 'DASH_TV_WIDEVINE') # url = url.replace('DASH_WPC_WIDEVINE', 'DASH_TV_WIDEVINE')
# U7D from start and end times # U7D from start and end times
if stype == 'tv' and all(param in params for param in ['cas_id', 'start_time', 'end_time']): #if stype == 'tv' and all(param in params for param in ['cas_id', 'start_time', 'end_time']):
from datetime import datetime # start = datetime.utcfromtimestamp(int(params['start_time']))
start = datetime.utcfromtimestamp(int(params['start_time'])) # end = datetime.utcfromtimestamp(int(params['end_time']))
end = datetime.utcfromtimestamp(int(params['end_time'])) # catchup_url = 'https://stover-wp0.cdn.telefonica.com/{cas_id}/vxfmt=dp/Manifest.mpd?device_profile=DASH_TV_WIDEVINE&start_time={start_time}&end_time={end_time}'
catchup_url = 'https://stover-wp0.cdn.telefonica.com/{cas_id}/vxfmt=dp/Manifest.mpd?device_profile=DASH_TV_WIDEVINE&start_time={start_time}&end_time={end_time}' # url = catchup_url.format(cas_id=params['cas_id'], start_time=start.strftime('%Y-%m-%dT%H:%M:%SZ'), end_time=end.strftime('%Y-%m-%dT%H:%M:%SZ'))
url = catchup_url.format(cas_id=params['cas_id'], start_time=start.strftime('%Y-%m-%dT%H:%M:%SZ'), end_time=end.strftime('%Y-%m-%dT%H:%M:%SZ')) # LOG('url from capchup: {}'.format(url))
LOG('url from capchup: {}'.format(url))
# Read the proxy address # Read the proxy address
@@ -126,7 +127,14 @@ def play(params):
cdn_token = m.cache.load('cdn.conf', 60) cdn_token = m.cache.load('cdn.conf', 60)
if not cdn_token: if not cdn_token:
cdn_token = m.get_cdntoken() cdn_token = m.get_cdntoken()
if not cdn_token:
time.sleep(2)
cdn_token = m.get_cdntoken()
if cdn_token:
m.cache.save_file('cdn.conf', cdn_token) m.cache.save_file('cdn.conf', cdn_token)
else:
show_notification('Ha pasado algo')
return
#LOG('cdn_token: {}'.format(cdn_token)) #LOG('cdn_token: {}'.format(cdn_token))
manifest_headers += '&x-tcdn-token=' + cdn_token manifest_headers += '&x-tcdn-token=' + cdn_token
@@ -239,10 +247,12 @@ def play(params):
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))
is_sport_channel = (stype == 'tv' and channel_id in ['MLIGA', 'DAZNLI', 'MLIG1', 'CHAPIO', 'CHAP1', 'CHAP2', 'MLIGUH', 'CHAUHD', 'CHUHD1']) watermarks = []
if session_opened or is_sport_channel: if stype == 'tv' and 'uid' in params:
if is_sport_channel: watermarks = m.get_watermarks(params['uid'])
last_time = 0 #time.time() LOG('watermarks: {}'.format(watermarks))
if session_opened or watermarks:
window = xbmcgui.Window(12005) window = xbmcgui.Window(12005)
label = xbmcgui.ControlLabel(0, 0, 400, 20, m.account['id'], textColor='0xFFFFFFFF', alignment=6) label = xbmcgui.ControlLabel(0, 0, 400, 20, m.account['id'], textColor='0xFFFFFFFF', alignment=6)
from .player import MyPlayer from .player import MyPlayer
@@ -251,10 +261,15 @@ def play(params):
while not monitor.abortRequested() and player.running: while not monitor.abortRequested() and player.running:
monitor.waitForAbort(10) monitor.waitForAbort(10)
#LOG('**** waiting') #LOG('**** waiting')
if is_sport_channel and player.isPlaying(): if player.isPlaying() and watermarks:
now = time.time() now = isodate2date(datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ'))
if now - last_time >= 15*60: for wm in list(watermarks):
last_time = now start = isodate2date(wm['start'])
stop = isodate2date(wm['stop'])
if now >= start:
watermarks.remove(wm)
if now < stop:
duration = (stop - start).total_seconds()
#show_notification(m.account['id'], xbmcgui.NOTIFICATION_INFO) #show_notification(m.account['id'], xbmcgui.NOTIFICATION_INFO)
w = window.getWidth() w = window.getWidth()
h = window.getHeight() h = window.getHeight()
@@ -263,7 +278,7 @@ def play(params):
pos_y = h-200 pos_y = h-200
label.setPosition(pos_x, pos_y) label.setPosition(pos_x, pos_y)
window.addControl(label) window.addControl(label)
time.sleep(20) time.sleep(duration)
window.removeControl(label) window.removeControl(label)
if session_opened: if session_opened:
d = m.delete_session() d = m.delete_session()
@@ -383,6 +398,7 @@ def add_videos(category, ctype, videos, ref=None, url_next=None, url_prev=None,
url = get_url(action='play', id=t['id'], url=t['url'], session_request=t['session_request'], stype=t['stream_type']) url = get_url(action='play', id=t['id'], url=t['url'], session_request=t['session_request'], stype=t['stream_type'])
if 'show_id' in t: url += '&show_id={}'.format(t['show_id']) if 'show_id' in t: url += '&show_id={}'.format(t['show_id'])
if 'uid' in t: url += '&uid={}'.format(t['uid'])
xbmcplugin.addDirectoryItem(_handle, url, list_item, False) xbmcplugin.addDirectoryItem(_handle, url, list_item, False)
elif t['type'] == 'series': elif t['type'] == 'series':
list_item = xbmcgui.ListItem(label = title_name) list_item = xbmcgui.ListItem(label = title_name)
@@ -480,7 +496,6 @@ def list_profiles(params):
def list_epg(params): def list_epg(params):
LOG('list_epg: {}'.format(params)) LOG('list_epg: {}'.format(params))
from datetime import datetime, timedelta
from .timeconv import my_strftime from .timeconv import my_strftime
if 'id' in params: if 'id' in params:
if not 'date' in params: if not 'date' in params:
@@ -725,7 +740,7 @@ def create_iptv_settings():
show_notification(addon.getLocalizedString(30319), xbmcgui.NOTIFICATION_INFO) show_notification(addon.getLocalizedString(30319), xbmcgui.NOTIFICATION_INFO)
output_file = 'instance-settings-91.xml' if kodi_version > 19 else 'settings.xml' output_file = 'instance-settings-91.xml' if kodi_version > 19 else 'settings.xml'
epg_url = None epg_url = None
if addon.getSettingBool('use_external_epg'): if False: #addon.getSettingBool('use_external_epg'):
epg_url = addon.getSetting('epg_url') epg_url = addon.getSetting('epg_url')
try: try:
pvr_addon = xbmcaddon.Addon('pvr.iptvsimple') pvr_addon = xbmcaddon.Addon('pvr.iptvsimple')
@@ -752,7 +767,7 @@ def export_epg_now():
show_notification(addon.getLocalizedString(30310), xbmcgui.NOTIFICATION_INFO) show_notification(addon.getLocalizedString(30310), xbmcgui.NOTIFICATION_INFO)
m.export_channels_to_m3u8(channels_filename, only_subscribed) m.export_channels_to_m3u8(channels_filename, only_subscribed)
if not addon.getSettingBool('use_external_epg'): if True: #not addon.getSettingBool('use_external_epg'):
show_notification(addon.getLocalizedString(30311), xbmcgui.NOTIFICATION_INFO) show_notification(addon.getLocalizedString(30311), xbmcgui.NOTIFICATION_INFO)
m.export_epg_to_xml(epg_filename, addon.getSettingInt('export_days'), report_progress, only_subscribed) m.export_epg_to_xml(epg_filename, addon.getSettingInt('export_days'), report_progress, only_subscribed)
+2
View File
@@ -50,9 +50,11 @@
<setting label="30316" type="action" id="create_iptv_settings" action="RunPlugin(plugin://plugin.video.movistarplus/?action=create_iptv_settings)" option="close"/> <setting label="30316" type="action" id="create_iptv_settings" action="RunPlugin(plugin://plugin.video.movistarplus/?action=create_iptv_settings)" option="close"/>
<setting type="sep"/> <setting type="sep"/>
<!--
<setting label="30317" type="bool" id="use_external_epg" default="true"/> <setting label="30317" type="bool" id="use_external_epg" default="true"/>
<setting label="30318" id="epg_url" type="text" default="https://raw.githubusercontent.com/davidmuma/EPG_dobleM/master/guiafanart_color.xml.gz" enable="eq(-1,true)"/> <setting label="30318" id="epg_url" type="text" default="https://raw.githubusercontent.com/davidmuma/EPG_dobleM/master/guiafanart_color.xml.gz" enable="eq(-1,true)"/>
<setting type="sep"/> <setting type="sep"/>
-->
<setting label="30305" type="bool" id="export_epg" default="false"/> <setting label="30305" type="bool" id="export_epg" default="false"/>
<setting label="30315" type="number" id="export_days" default="2" enable="eq(-1,true)"/> <setting label="30315" type="number" id="export_days" default="2" enable="eq(-1,true)"/>