Fix Canali Live
This commit is contained in:
@@ -142,7 +142,12 @@ def episodios(item):
|
|||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
def play(item):
|
def play(item):
|
||||||
if item.filter: item.id = liveDict()[item.filter]['id']
|
if item.filter:
|
||||||
|
item.id = liveDict()[item.filter]['id']
|
||||||
|
item.fulltitle = item.filter
|
||||||
|
item.forcethumb = True
|
||||||
|
item.no_return = True
|
||||||
|
support.thumb(item, live=True)
|
||||||
if item.contentType == 'episode': data = session.get('{}/playback/v2/videoPlaybackInfo/{}?usePreAuth=true'.format(api, item.id), headers=headers).json().get('data',{}).get('attributes',{})
|
if item.contentType == 'episode': data = session.get('{}/playback/v2/videoPlaybackInfo/{}?usePreAuth=true'.format(api, item.id), headers=headers).json().get('data',{}).get('attributes',{})
|
||||||
else: data = session.get('{}/playback/v2/channelPlaybackInfo/{}?usePreAuth=true'.format(api, item.id), headers=headers).json().get('data',{}).get('attributes',{})
|
else: data = session.get('{}/playback/v2/channelPlaybackInfo/{}?usePreAuth=true'.format(api, item.id), headers=headers).json().get('data',{}).get('attributes',{})
|
||||||
if data['protection'].get('drm_enabled',True):
|
if data['protection'].get('drm_enabled',True):
|
||||||
|
|||||||
@@ -118,6 +118,11 @@ def episodios(item):
|
|||||||
|
|
||||||
def play(item):
|
def play(item):
|
||||||
support.info()
|
support.info()
|
||||||
|
if item.filter:
|
||||||
|
for it in live(item):
|
||||||
|
if it.fulltitle == item.filter:
|
||||||
|
item = it
|
||||||
|
break
|
||||||
data = support.match(item).data
|
data = support.match(item).data
|
||||||
match = support.match(data, patron='/content/entry/data/(.*?).mp4').match
|
match = support.match(data, patron='/content/entry/data/(.*?).mp4').match
|
||||||
if match:
|
if match:
|
||||||
|
|||||||
+38
-18
@@ -10,6 +10,7 @@ if sys.version_info[0] >= 3: from urllib.parse import urlencode, quote
|
|||||||
else: from urllib import urlencode, quote
|
else: from urllib import urlencode, quote
|
||||||
if sys.version_info[0] >= 3: from concurrent import futures
|
if sys.version_info[0] >= 3: from concurrent import futures
|
||||||
else: from concurrent_py2 import futures
|
else: from concurrent_py2 import futures
|
||||||
|
from collections import OrderedDict
|
||||||
|
|
||||||
host = ''
|
host = ''
|
||||||
DRM = 'com.widevine.alpha'
|
DRM = 'com.widevine.alpha'
|
||||||
@@ -120,10 +121,9 @@ def menu(item):
|
|||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def live(item):
|
def liveDict():
|
||||||
support.info()
|
livedict = OrderedDict({})
|
||||||
itemlist = []
|
json = current_session.get('https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-all-stations?sort=ShortTitle').json()['entries']
|
||||||
json = current_session.get(item.url).json()['entries']
|
|
||||||
for it in json:
|
for it in json:
|
||||||
urls = []
|
urls = []
|
||||||
if it['tuningInstruction'] and not it['mediasetstation$digitalOnly']:
|
if it['tuningInstruction'] and not it['mediasetstation$digitalOnly']:
|
||||||
@@ -133,18 +133,25 @@ def live(item):
|
|||||||
else:
|
else:
|
||||||
for key in it['tuningInstruction']['urn:theplatform:tv:location:any']:
|
for key in it['tuningInstruction']['urn:theplatform:tv:location:any']:
|
||||||
urls += key['publicUrls']
|
urls += key['publicUrls']
|
||||||
plot = support.typo(guide['currentListing']['mediasetlisting$epgTitle'],'bold') + '\n' + guide['currentListing']['mediasetlisting$shortDescription'] + '\n' + guide['currentListing']['description'] + '\n\n' + support.typo('A Seguire:' + guide['nextListing']['mediasetlisting$epgTitle'], 'bold')
|
title = it['title']
|
||||||
|
livedict[title] = {}
|
||||||
|
livedict[title]['urls'] = urls
|
||||||
|
livedict[title]['plot'] = support.typo(guide['currentListing']['mediasetlisting$epgTitle'],'bold') + '\n' + guide['currentListing']['mediasetlisting$shortDescription'] + '\n' + guide['currentListing']['description'] + '\n\n' + support.typo('A Seguire:' + guide['nextListing']['mediasetlisting$epgTitle'], 'bold')
|
||||||
|
return livedict
|
||||||
|
|
||||||
itemlist.append(item.clone(title=support.typo(it['title'], 'bold'),
|
def live(item):
|
||||||
fulltitle=it['title'],
|
support.info()
|
||||||
show=it['title'],
|
itemlist = []
|
||||||
contentTitle=it['title'],
|
for key, value in liveDict().items():
|
||||||
thumbnail=it['thumbnails']['channel_logo-100x100']['url'],
|
itemlist.append(item.clone(title=support.typo(key, 'bold'),
|
||||||
forcethumb=True,
|
fulltitle=key,
|
||||||
urls=urls,
|
show=key,
|
||||||
plot=plot,
|
contentTitle=key,
|
||||||
action='play',
|
forcethumb=True,
|
||||||
no_return=True))
|
urls=value['urls'],
|
||||||
|
plot=value['plot'],
|
||||||
|
action='play',
|
||||||
|
no_return=True))
|
||||||
return support.thumb(itemlist, live=True)
|
return support.thumb(itemlist, live=True)
|
||||||
|
|
||||||
|
|
||||||
@@ -204,7 +211,9 @@ def peliculas(item):
|
|||||||
plot=it['longDescription'] if 'longDescription' in it else it['description'] if 'description' in it else '',
|
plot=it['longDescription'] if 'longDescription' in it else it['description'] if 'description' in it else '',
|
||||||
urls=urls,
|
urls=urls,
|
||||||
seriesid = it.get('seriesId',''),
|
seriesid = it.get('seriesId',''),
|
||||||
url=it['mediasetprogram$pageUrl']))
|
url=it['mediasetprogram$pageUrl'],
|
||||||
|
forcethumb=True,
|
||||||
|
no_return=True))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@@ -258,7 +267,9 @@ def episodios(item):
|
|||||||
fanart=it['thumbnails']['image_keyframe_poster-1280x720']['url'] if 'image_keyframe_poster-1280x720' in it['thumbnails'] else '',
|
fanart=it['thumbnails']['image_keyframe_poster-1280x720']['url'] if 'image_keyframe_poster-1280x720' in it['thumbnails'] else '',
|
||||||
plot=it['longDescription'] if 'longDescription' in it else it['description'],
|
plot=it['longDescription'] if 'longDescription' in it else it['description'],
|
||||||
urls=urls,
|
urls=urls,
|
||||||
url=it['mediasetprogram$pageUrl']))
|
url=it['mediasetprogram$pageUrl'],
|
||||||
|
forcethumb=True,
|
||||||
|
no_return=True))
|
||||||
if episode:
|
if episode:
|
||||||
itemlist = sorted(itemlist, key=lambda it: it.title)
|
itemlist = sorted(itemlist, key=lambda it: it.title)
|
||||||
support.videolibrary(itemlist, item)
|
support.videolibrary(itemlist, item)
|
||||||
@@ -267,12 +278,17 @@ def episodios(item):
|
|||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
support.info()
|
support.info()
|
||||||
itemlist = [support.Item(server='directo', title='Direct', url=item.urls, action='play')]
|
itemlist = [support.Item(server='directo', title='Mediaset Play', url=item.urls, action='play')]
|
||||||
return support.server(item, itemlist=itemlist, Download=False)
|
return support.server(item, itemlist=itemlist, Download=False)
|
||||||
|
|
||||||
|
|
||||||
def play(item):
|
def play(item):
|
||||||
support.info()
|
support.info()
|
||||||
|
if item.filter:
|
||||||
|
d = liveDict()[item.filter]
|
||||||
|
# support.dbg()
|
||||||
|
item = item.clone(title=support.typo(item.filter, 'bold'), fulltitle=item.filter, urls=d['urls'], plot=d['plot'], action='play', forcethumb=True, no_return=True)
|
||||||
|
support.thumb(item, live=True)
|
||||||
if not item.urls: urls = item.url
|
if not item.urls: urls = item.url
|
||||||
else: urls = item.urls
|
else: urls = item.urls
|
||||||
data = ''
|
data = ''
|
||||||
@@ -285,6 +301,10 @@ def play(item):
|
|||||||
item.drm = DRM
|
item.drm = DRM
|
||||||
item.license = lic_url % support.match(sec_data, patron=r'pid=([^|]+)').match
|
item.license = lic_url % support.match(sec_data, patron=r'pid=([^|]+)').match
|
||||||
data = support.match(sec_data, patron=r'<video src="([^"]+)').match
|
data = support.match(sec_data, patron=r'<video src="([^"]+)').match
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
support.dbg()
|
||||||
|
data = url
|
||||||
|
|
||||||
return support.servertools.find_video_items(item, data=data)
|
return support.servertools.find_video_items(item, data=data)
|
||||||
|
|
||||||
|
|||||||
+21
-9
@@ -5,6 +5,7 @@
|
|||||||
import inspect
|
import inspect
|
||||||
from core import support, jsontools
|
from core import support, jsontools
|
||||||
from platformcode import autorenumber, logger
|
from platformcode import autorenumber, logger
|
||||||
|
from collections import OrderedDict
|
||||||
|
|
||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
headers = [['Referer', host]]
|
headers = [['Referer', host]]
|
||||||
@@ -39,24 +40,31 @@ def search(item, text):
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def live(item):
|
def liveDict():
|
||||||
logger.debug()
|
livedict = OrderedDict({})
|
||||||
itemlist=[]
|
|
||||||
urls=[]
|
urls=[]
|
||||||
matches = support.match(host, patron=r'(/diretta-tv/[^"]+)"[^>]+>([^ ]+)').matches
|
matches = support.match(host, patron=r'(/diretta-tv/[^"]+)"[^>]+>([^ ]+)').matches
|
||||||
from datetime import date
|
from datetime import date
|
||||||
today = date.today()
|
today = date.today()
|
||||||
channels = jsontools.load(support.match(host + '/api/more/tvschedule/' + str(today.year) + str(today.month) + str(today.day)).data)['channels']
|
channels = jsontools.load(support.match(host + '/api/more/tvschedule/' + str(today.year) + str(today.month) + str(today.day)).data)['channels']
|
||||||
ch_dict = {}
|
|
||||||
for channel in channels:
|
for channel in channels:
|
||||||
ch_dict[channel['label']] = channel['channelId']
|
title = channel['label']
|
||||||
|
livedict[title] = {}
|
||||||
|
livedict[title]['id'] = channel['channelId']
|
||||||
for url, title in matches:
|
for url, title in matches:
|
||||||
if url not in urls:
|
if url not in urls:
|
||||||
urls.append(url)
|
urls.append(url)
|
||||||
info = jsontools.load(support.match(host +'/api/on-air?channelId=' + ch_dict[title]).data)
|
livedict[title]['url'] = host + url
|
||||||
support.info(info)
|
info = jsontools.load(support.match(host +'/api/on-air?channelId=' + livedict[title]['id']).data)
|
||||||
plot= '[B]' + info['seriesTitle'] +'[/B]\n' + info['description'] if 'seriesTitle' in info else ''
|
livedict[title]['plot']= '[B]' + info['seriesTitle'] +'[/B]\n' + info['description'] if 'seriesTitle' in info else ''
|
||||||
itemlist.append(item.clone(title=support.typo(title,'bold'), contentTitle=title, fulltitle=title, show=title, url=host+url, plot=plot, action='play', forcethumb=True, no_return=True))
|
return livedict
|
||||||
|
|
||||||
|
def live(item):
|
||||||
|
logger.debug()
|
||||||
|
itemlist=[]
|
||||||
|
for key, value in liveDict().items():
|
||||||
|
itemlist.append(item.clone(title=support.typo(key,'bold'), contentTitle=key, fulltitle=key, show=key, url=value['url'], plot=value['plot'], action='play', forcethumb=True, no_return=True))
|
||||||
return support.thumb(itemlist, live=True)
|
return support.thumb(itemlist, live=True)
|
||||||
|
|
||||||
|
|
||||||
@@ -154,4 +162,8 @@ def findvideos(item):
|
|||||||
|
|
||||||
def play(item):
|
def play(item):
|
||||||
logger.debug()
|
logger.debug()
|
||||||
|
if item.filter:
|
||||||
|
d = liveDict()[item.filter]
|
||||||
|
item = item.clone(title=support.typo(item.filter, 'bold'), fulltitle=item.filter, url=d['url'], plot=d['plot'], action='play', forcethumb=True, no_return=True)
|
||||||
|
support.thumb(item, live=True)
|
||||||
return support.servertools.find_video_items(item, data=item.url)
|
return support.servertools.find_video_items(item, data=item.url)
|
||||||
Reference in New Issue
Block a user