Skip to content

Commit

Permalink
Version 0.9.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Paco8 committed Sep 26, 2024
1 parent 5ed25e7 commit 70702fd
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 14 deletions.
2 changes: 1 addition & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.movistarplus"
name="Movistar+"
version="0.9.10"
version="0.9.11"
provider-name="Paco8">
<requires>
<!--- <import addon="xbmc.python" version="2.25.0"/> -->
Expand Down
12 changes: 4 additions & 8 deletions resources/lib/iptv.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,13 @@ def save_iptv_settings(filename, name, addon_id, epg_url=None):
<setting id="timeshiftEnabledUdp" default="true">true</setting>
<setting id="timeshiftEnabledCustom" default="true">false</setting>'''

if epg_url:
content += '''
<setting id="catchupEnabled" default="true">false</setting>'''
else:
content += '''
<setting id="catchupEnabled">true</setting>'''
content += '''
<setting id="catchupEnabled">true</setting>
<setting id="catchupQueryFormat">&start_time={utc}&end_time={utcend}</setting>
<setting id="allChannelsCatchupMode">2</setting>'''

content += '''
<setting id="catchupQueryFormat" default="true" />
<setting id="catchupDays" default="true">5</setting>
<setting id="allChannelsCatchupMode" default="true">0</setting>
<setting id="catchupOverrideMode" default="true">0</setting>
<setting id="catchupCorrection" default="true">0</setting>
<setting id="catchupPlayEpgAsLive" default="true">false</setting>
Expand Down
13 changes: 10 additions & 3 deletions resources/lib/movistar.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,10 @@ def get_title(self, data):
t['id'] = ed['Id']
t['info']['title'] = ed['Titulo']
t['art']['poster'] = ed.get('Imagen', '').replace('ywcatalogov', 'dispficha')
if 'Imagenes' in ed:
for i in ed['Imagenes']:
if i['id'] == 'detail':
t['art']['poster'] = i['uri']
t['art']['thumb'] = t['art']['poster']
t['info']['genre'] = ed['GeneroComAntena']
if ed.get('TipoComercial') == 'Impulsivo': return None # Alquiler
Expand Down Expand Up @@ -1312,6 +1316,7 @@ def export_channels(self):
t['preset'] = c['dial']
args = urlencode({'action': 'play', 'stype': 'tv', 'id': c['id'], 'url': c['url'], 'session_request': c['session_request']})
t['stream'] = 'plugin://plugin.video.movistarplus/?' + args
if 'cas_id' in c: t['cas_id'] = c['cas_id']
res.append(t)
return res

Expand All @@ -1320,8 +1325,10 @@ def export_channels_to_m3u8(self, filename, only_subscribed=False):
items = []
for t in channels:
if only_subscribed and not t['subscribed']: continue
item = '#EXTINF:-1 tvg-name="{name}" tvg-id="{id}" tvg-logo="{logo}" tvg-chno="{preset}" group-title="Movistar+" catchup="vod",{name}\n{stream}\n\n'.format(
name=t['name'], id=t['id'], logo=t['logo'], preset=t['preset'], stream=t['stream'])
url = t['stream']
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(
name=t['name'], id=t['id'], logo=t['logo'], preset=t['preset'], stream=url)
items.append(item)
res = '#EXTM3U\n## Movistar+\n{}'.format(''.join(items))
with io.open(filename, 'w', encoding='utf-8', newline='') as handle:
Expand Down Expand Up @@ -1421,7 +1428,7 @@ def export_epg_to_xml(self, filename, ndays=3, report_func=None, only_subscribed
if url:
url = url.replace('&', '&amp;')
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' +
' <title>{}</title>\n'.format(html_escape(e['title'])) +
' <sub-title>{}</sub-title>\n'.format(html_escape(e['subtitle'])))
Expand Down
14 changes: 12 additions & 2 deletions resources/lib/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@ def play(params):
else:
url = d['url']

# U7D from start and end times
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']))
end = datetime.utcfromtimestamp(int(params['end_time']))
catchup_url = 'https://stover-wp21.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'))
LOG('url from capchup: {}'.format(url))


# Read the proxy address
proxy = Movistar.load_file_if_exists(os.path.join(profile_dir, 'proxy.txt'))
LOG('proxy address: {}'.format(proxy))
Expand Down Expand Up @@ -372,7 +382,7 @@ def add_videos(category, ctype, videos, ref=None, url_next=None, url_prev=None,

if url_next:
list_item = xbmcgui.ListItem(label = addon.getLocalizedString(30109)) # Next page
xbmcplugin.addDirectoryItem(_handle, get_url(action=ref, url=url_next, name=category), list_item, True)
xbmcplugin.addDirectoryItem(_handle, get_url(action=ref, url=url_next, from_wishlist=from_wishlist, name=category), list_item, True)

xbmcplugin.endOfDirectory(_handle)

Expand Down Expand Up @@ -781,7 +791,7 @@ def router(paramstring):
elif params['action'] == 'listing':
listing(params['name'], params['url'])
elif params['action'] == 'listing_hz':
listing_hz(params['name'], params['url'])
listing_hz(params['name'], params['url'], params.get('from_wishlist'))
elif params['action'] == 'series':
add_videos(params['name'], 'seasons', m.get_seasons(params['id']))
elif params['action'] == 'season':
Expand Down

0 comments on commit 70702fd

Please sign in to comment.