Fix TMDB, VVVVID, AccuRadio, Mediaset Play
This commit is contained in:
+19
-16
@@ -4,30 +4,33 @@
|
|||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
import random
|
import random
|
||||||
from core import httptools,support
|
from core import httptools, support
|
||||||
from platformcode import logger
|
from platformcode import logger
|
||||||
|
|
||||||
host = 'https://www.accuradio.com'
|
host = 'https://www.accuradio.com'
|
||||||
|
api_url = host + '/c/m/json/{}/'
|
||||||
headers = [['Referer', host]]
|
headers = [['Referer', host]]
|
||||||
|
|
||||||
@support.scrape
|
|
||||||
|
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
if item.data: data = item.data
|
itemlist = []
|
||||||
else: item.url = host
|
item.action = 'peliculas'
|
||||||
action = 'peliculas'
|
js = httptools.downloadpage(api_url.format('brands')).json
|
||||||
patronBlock = r'Genres(?P<block>.*?)</ul'
|
for it in js.get('features',[]):
|
||||||
patron = r'listOptionBrand">\s*<a href="(?P<url>[^"]+)"(?:[^>]+>){2}(?P<title>[^<]+)'
|
|
||||||
|
|
||||||
def itemHook(item):
|
|
||||||
item.thumbnail = support.thumb('music')
|
|
||||||
return item
|
|
||||||
|
|
||||||
def itemlistHook(itemlist):
|
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(title=support.typo('Cerca...', 'bold color kod'), action='search', thumbnail=support.thumb('search')))
|
item.clone(url= '{}/{}'.format(host,it.get('canonical_url','')),
|
||||||
|
title=support.typo(it['name'],'italic') + support.typo(it.get('channels',''),'_ [] color kod')
|
||||||
|
))
|
||||||
|
for it in js.get('brands',[]):
|
||||||
|
itemlist.append(
|
||||||
|
item.clone(url= '{}/{}'.format(host,it.get('canonical_url','')),
|
||||||
|
title=support.typo(it['name'],'bullet bold') + support.typo(it.get('channels',''),'_ [] color kod')
|
||||||
|
))
|
||||||
|
|
||||||
|
itemlist.append(item.clone(title=support.typo('Cerca...', 'bold color kod'), action='search', thumbnail=support.thumb('search')))
|
||||||
support.channel_config(item, itemlist)
|
support.channel_config(item, itemlist)
|
||||||
return itemlist
|
return itemlist
|
||||||
return locals()
|
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
@@ -50,7 +53,7 @@ def playradio(item):
|
|||||||
album = i['album']['title']
|
album = i['album']['title']
|
||||||
year = i['album']['year']
|
year = i['album']['year']
|
||||||
thumb = 'https://www.accuradio.com/static/images/covers300' + i['album']['cdcover']
|
thumb = 'https://www.accuradio.com/static/images/covers300' + i['album']['cdcover']
|
||||||
duration = i['duration']
|
duration = i.get('duration',0)
|
||||||
info = {'duration':duration,
|
info = {'duration':duration,
|
||||||
'album':album,
|
'album':album,
|
||||||
'artist':artist,
|
'artist':artist,
|
||||||
|
|||||||
+10
-16
@@ -129,9 +129,9 @@ def liveDict():
|
|||||||
urls = []
|
urls = []
|
||||||
if it['tuningInstruction'] and not it['mediasetstation$digitalOnly']:
|
if it['tuningInstruction'] and not it['mediasetstation$digitalOnly']:
|
||||||
guide=current_session.get('https://static3.mediasetplay.mediaset.it/apigw/nownext/' + it['callSign'] + '.json').json()['response']
|
guide=current_session.get('https://static3.mediasetplay.mediaset.it/apigw/nownext/' + it['callSign'] + '.json').json()['response']
|
||||||
if 'restartUrl' in guide['currentListing']:
|
# if 'restartUrl' in guide['currentListing']:
|
||||||
urls = [guide['currentListing']['restartUrl']]
|
# urls = [guide['currentListing']['restartUrl']]
|
||||||
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']
|
||||||
title = it['title']
|
title = it['title']
|
||||||
@@ -221,6 +221,7 @@ def peliculas(item):
|
|||||||
def epmenu(item):
|
def epmenu(item):
|
||||||
logger.debug()
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
# support.dbg()
|
||||||
if item.seriesid:
|
if item.seriesid:
|
||||||
seasons = current_session.get('https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-tv-seasons?bySeriesId=' + item.seriesid).json()['entries']
|
seasons = current_session.get('https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-tv-seasons?bySeriesId=' + item.seriesid).json()['entries']
|
||||||
for season in seasons:
|
for season in seasons:
|
||||||
@@ -284,33 +285,26 @@ def episodios(item):
|
|||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
logger.debug()
|
logger.debug()
|
||||||
itemlist = [support.Item(server='directo', title='Mediaset Play', url=item.urls, action='play')]
|
itemlist = [item.clone(server='directo', title='Mediaset Play', urls=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):
|
||||||
logger.debug()
|
logger.debug()
|
||||||
if item.livefilter:
|
for url in item.urls:
|
||||||
d = liveDict()[item.livefilter]
|
|
||||||
item = item.clone(title=support.typo(item.livefilter, 'bold'), fulltitle=item.livefilter, 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
|
|
||||||
else: urls = item.urls
|
|
||||||
data = ''
|
|
||||||
for url in urls:
|
|
||||||
new_url = support.httptools.downloadpage(url, allow_redirects=True).url
|
new_url = support.httptools.downloadpage(url, allow_redirects=True).url
|
||||||
if '.mpd' in new_url:
|
if '.mpd' in new_url:
|
||||||
data = new_url
|
|
||||||
sec_data = support.match(url + post_url).data
|
sec_data = support.match(url + post_url).data
|
||||||
|
item.url = support.match(sec_data, patron=r'<video src="([^"]+)').match
|
||||||
|
item.manifest = 'mpd'
|
||||||
if support.match(sec_data, patron=r'(security)').match:
|
if support.match(sec_data, patron=r'(security)').match:
|
||||||
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
|
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
data = url
|
item.url = new_url
|
||||||
|
|
||||||
return support.servertools.find_video_items(item, data=data)
|
return [item]
|
||||||
|
|
||||||
|
|
||||||
def subBrand(json):
|
def subBrand(json):
|
||||||
|
|||||||
+11
-11
@@ -150,7 +150,6 @@ def episodios(item):
|
|||||||
show_id = str(json_file[0]['show_id'])
|
show_id = str(json_file[0]['show_id'])
|
||||||
season_id = str(json_file[0]['season_id'])
|
season_id = str(json_file[0]['season_id'])
|
||||||
|
|
||||||
|
|
||||||
for episode in episodes:
|
for episode in episodes:
|
||||||
try:
|
try:
|
||||||
title = 'Episodio ' + episode['number'] + ' - ' + episode['title'].encode('utf8')
|
title = 'Episodio ' + episode['number'] + ' - ' + episode['title'].encode('utf8')
|
||||||
@@ -166,8 +165,7 @@ def episodios(item):
|
|||||||
|
|
||||||
if inspect.stack()[1][3] not in ['find_episodes']:
|
if inspect.stack()[1][3] not in ['find_episodes']:
|
||||||
autorenumber.start(itemlist, item)
|
autorenumber.start(itemlist, item)
|
||||||
if autorenumber.check(item) == True \
|
|
||||||
or support.match(itemlist[0].title, patron=r"(\d+x\d+)").match:
|
|
||||||
support.videolibrary(itemlist,item)
|
support.videolibrary(itemlist,item)
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
@@ -213,20 +211,22 @@ def make_itemlist(itemlist, item, data):
|
|||||||
infoLabels = {}
|
infoLabels = {}
|
||||||
for key in data['data']:
|
for key in data['data']:
|
||||||
if search.lower() in encode(key['title']).lower():
|
if search.lower() in encode(key['title']).lower():
|
||||||
infoLabels['year'] = key['date_published']
|
|
||||||
infoLabels['title'] = key['title']
|
|
||||||
if item.contentType != 'movie': infoLabels['tvshowtitle'] = key['title']
|
|
||||||
title = encode(key['title'])
|
title = encode(key['title'])
|
||||||
|
fulltitle=title.split('-')[0].strip()
|
||||||
|
infoLabels['year'] = key['date_published']
|
||||||
|
infoLabels['title'] = fulltitle
|
||||||
|
if item.contentType != 'movie': infoLabels['tvshowtitle'] = fulltitle
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(title = support.typo(title, 'bold'),
|
item.clone(title = support.typo(title, 'bold'),
|
||||||
fulltitle= title,
|
fulltitle= fulltitle,
|
||||||
show= title,
|
show= fulltitle,
|
||||||
url= host + str(key['show_id']) + '/seasons/',
|
url= host + str(key['show_id']) + '/seasons/',
|
||||||
action= 'findvideos' if item.contentType == 'movie' else 'episodios',
|
action= 'findvideos' if item.contentType == 'movie' else 'episodios',
|
||||||
contentType = item.contentType,
|
contentType = item.contentType,
|
||||||
contentSerieName= key['title'] if item.contentType != 'movie' else '',
|
contentSerieName= fulltitle if item.contentType != 'movie' else '',
|
||||||
contentTitle= title if item.contentType == 'movie' else '',
|
contentTitle= fulltitle if item.contentType == 'movie' else '',
|
||||||
infoLabels=infoLabels))
|
infoLabels=infoLabels,
|
||||||
|
videolibrary=False))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
def loadjs(url):
|
def loadjs(url):
|
||||||
|
|||||||
@@ -994,9 +994,6 @@ class Tmdb(object):
|
|||||||
'&include_adult=%s&page=%s' % (self.busqueda_tipo, text_quote, self.busqueda_idioma, True, page))
|
'&include_adult=%s&page=%s' % (self.busqueda_tipo, text_quote, self.busqueda_idioma, True, page))
|
||||||
|
|
||||||
if self.busqueda_year:
|
if self.busqueda_year:
|
||||||
if self.busqueda_tipo == 'tv':
|
|
||||||
url += '&first_air_date_year=%s' % self.busqueda_year
|
|
||||||
else:
|
|
||||||
url += '&year=%s' % self.busqueda_year
|
url += '&year=%s' % self.busqueda_year
|
||||||
|
|
||||||
buscando = self.busqueda_texto.capitalize()
|
buscando = self.busqueda_texto.capitalize()
|
||||||
|
|||||||
@@ -613,7 +613,7 @@ def set_context_commands(item, item_url, parent_item, **kwargs):
|
|||||||
|
|
||||||
context_commands.append( (config.get_localized_string(70561), "Container.Update (%s?%s&%s)" % (sys.argv[0], item_url, 'channel=search&action=from_context&search_type=list&page=1&list_type=%s/%s/similar' % (mediatype, item.infoLabels['tmdb_id']))))
|
context_commands.append( (config.get_localized_string(70561), "Container.Update (%s?%s&%s)" % (sys.argv[0], item_url, 'channel=search&action=from_context&search_type=list&page=1&list_type=%s/%s/similar' % (mediatype, item.infoLabels['tmdb_id']))))
|
||||||
|
|
||||||
if item.channel != "videolibrary":
|
if item.channel != "videolibrary" and item.videolibrary != False:
|
||||||
# Add Series to the video library
|
# Add Series to the video library
|
||||||
if item.action in ["episodios", "get_episodios", "get_seasons"] and item.contentSerieName:
|
if item.action in ["episodios", "get_episodios", "get_seasons"] and item.contentSerieName:
|
||||||
context_commands.append((config.get_localized_string(60352), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'action=add_serie_to_library&from_action=' + item.action)))
|
context_commands.append((config.get_localized_string(60352), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'action=add_serie_to_library&from_action=' + item.action)))
|
||||||
|
|||||||
Reference in New Issue
Block a user