Version 0.6.5
This commit is contained in:
1 parent
f8892a15e0
commit
9908271e9d
8 files changed
+158
-39
No files matched your search
+25
-12
@@ -1021,13 +1021,13 @@ class Movistar(object):
|
||||
from urllib.parse import urlencode
|
||||
else:
|
||||
from urllib import urlencode
|
||||
now = time.time()*1000
|
||||
#now = time.time()*1000
|
||||
res = {}
|
||||
epg = self.get_epg()
|
||||
channels = self.get_channels(False)
|
||||
for channel in channels:
|
||||
if not channel['subscribed']: continue
|
||||
id = channel['id']
|
||||
if not channel['subscribed'] or not id in epg: continue
|
||||
res[id] = []
|
||||
for e in epg[id]:
|
||||
t = {}
|
||||
@@ -1036,8 +1036,9 @@ class Movistar(object):
|
||||
t['start'] = datetime.utcfromtimestamp(e['start']/1000).strftime('%Y-%m-%dT%H:%M:%SZ')
|
||||
t['stop'] = datetime.utcfromtimestamp(e['end']/1000).strftime('%Y-%m-%dT%H:%M:%SZ')
|
||||
|
||||
aired = (e['end'] <= now)
|
||||
if aired:
|
||||
#aired = (e['end'] <= now)
|
||||
#if aired:
|
||||
if True:
|
||||
program_id = str(e['show_id'])
|
||||
url = 'https://grmovistar.imagenio.telefonica.net/asfe/rest/tvMediaURLs?tvProgram.id='+ program_id +'&svc=startover'
|
||||
session_request = '{"contentID":' + program_id +',"streamType":"CUTV"}'
|
||||
@@ -1076,19 +1077,31 @@ class Movistar(object):
|
||||
|
||||
epg = self.export_epg()
|
||||
for ch in channels:
|
||||
if not ch['id'] in epg: continue
|
||||
for e in epg[ch['id']]:
|
||||
start = datetime.strptime(e['start'], "%Y-%m-%dT%H:%M:%SZ").strftime("%Y%m%d%H%M%S +0000")
|
||||
stop = datetime.strptime(e['stop'], "%Y-%m-%dT%H:%M:%SZ").strftime("%Y%m%d%H%M%S +0000")
|
||||
url = e.get('stream', None)
|
||||
if url:
|
||||
url = url.replace('&', '&')
|
||||
res.append('<programme start="{}" stop="{}" channel="{}"'.format(start, stop, ch['id']) +
|
||||
(' catchup-id="{}"'.format(url) if url else "") +
|
||||
'>\n' +
|
||||
' <title>{}</title>\n'.format(e['title']) +
|
||||
' <sub-title>{}</sub-title>'.format(e['subtitle']) +
|
||||
'</programme>\n')
|
||||
|
||||
url = url.replace('&', '&')
|
||||
res.append('<programme start="{}" stop="{}" channel="{}"'.format(start, stop, ch['id']) +
|
||||
(' catchup-id="{}"'.format(url) if url else "") +
|
||||
'>\n' +
|
||||
' <title>{}</title>\n'.format(e['title']) +
|
||||
' <sub-title>{}</sub-title>\n'.format(e['subtitle']))
|
||||
if 'image' in e:
|
||||
res.append(' <icon src="{}"/>\n'.format(e['image']))
|
||||
if 'description' in e:
|
||||
res.append(' <desc>{}</desc>\n'.format(e['description']))
|
||||
if 'credits' in e and len(e['credits']) > 0:
|
||||
res.append(' <credits>\n');
|
||||
for c in e['credits']:
|
||||
if c['type'] == 'director':
|
||||
res.append(' <director>{}</director>\n'.format(c['name']))
|
||||
elif c['type'] == 'actor':
|
||||
res.append(' <actor>{}</actor>\n'.format(c['name']))
|
||||
res.append(' </credits>\n');
|
||||
res.append('</programme>\n')
|
||||
res.append('</tv>\n')
|
||||
with io.open(filename, 'w', encoding='utf-8', newline='') as handle:
|
||||
handle.write(''.join(res))
|
||||
|
||||
@@ -237,8 +237,8 @@ def add_videos(category, ctype, videos, ref=None, url_next=None, url_prev=None):
|
||||
list_item.setInfo('video', t['info'])
|
||||
list_item.setArt(t['art'])
|
||||
|
||||
if t.get('stream_type') == 'u7d' and not t.get('aired', False):
|
||||
record_program_action = (addon.getLocalizedString(30171), "RunPlugin(" + get_url(action='add_recording', id=t['id']) + ")")
|
||||
if t.get('stream_type') == 'u7d' and 'show_id' in t and not t.get('aired', False):
|
||||
record_program_action = (addon.getLocalizedString(30171), "RunPlugin(" + get_url(action='add_recording', id=t['show_id']) + ")")
|
||||
list_item.addContextMenuItems([record_program_action])
|
||||
|
||||
if 'rec' in t:
|
||||
@@ -478,15 +478,16 @@ def list_users():
|
||||
def iptv(params):
|
||||
LOG('iptv: params: {}'.format(params))
|
||||
if m.logged:
|
||||
try:
|
||||
#try:
|
||||
if True:
|
||||
from .iptvmanager import IPTVManager
|
||||
port = int(params['port'])
|
||||
if params['action'] == 'iptv-channels':
|
||||
IPTVManager(port).send_channels(m)
|
||||
elif params['action'] == 'iptv-epg':
|
||||
IPTVManager(port).send_epg(m)
|
||||
except:
|
||||
pass
|
||||
#except:
|
||||
# pass
|
||||
|
||||
def router(paramstring):
|
||||
"""
|
||||
|
||||
Reference in new issue
Block a user