Fix TMDB, VVVVID, Mediaset Play

This commit is contained in:
Alhaziel01
2021-03-26 15:57:43 +01:00
parent 883198f853
commit 3e83618baa
4 changed files with 34 additions and 44 deletions

View File

@@ -129,11 +129,11 @@ def liveDict():
urls = []
if it['tuningInstruction'] and not it['mediasetstation$digitalOnly']:
guide=current_session.get('https://static3.mediasetplay.mediaset.it/apigw/nownext/' + it['callSign'] + '.json').json()['response']
if 'restartUrl' in guide['currentListing']:
urls = [guide['currentListing']['restartUrl']]
else:
for key in it['tuningInstruction']['urn:theplatform:tv:location:any']:
urls += key['publicUrls']
# if 'restartUrl' in guide['currentListing']:
# urls = [guide['currentListing']['restartUrl']]
# else:
for key in it['tuningInstruction']['urn:theplatform:tv:location:any']:
urls += key['publicUrls']
title = it['title']
livedict[title] = {}
livedict[title]['urls'] = urls
@@ -221,6 +221,7 @@ def peliculas(item):
def epmenu(item):
logger.debug()
itemlist = []
# support.dbg()
if item.seriesid:
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:
@@ -284,33 +285,26 @@ def episodios(item):
def findvideos(item):
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)
def play(item):
logger.debug()
if item.livefilter:
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:
for url in item.urls:
new_url = support.httptools.downloadpage(url, allow_redirects=True).url
if '.mpd' in new_url:
data = new_url
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:
item.drm = DRM
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:
data = url
item.url = new_url
return support.servertools.find_video_items(item, data=data)
return [item]
def subBrand(json):

View File

@@ -23,8 +23,7 @@ except:
conn_id = ''
main_host = host
host += '/vvvvid/ondemand/'
main_host = host + '/vvvvid/ondemand/'
@support.menu
@@ -89,13 +88,13 @@ def newest(categoria):
item.args = 'channel/10007/last/'
if categoria == 'peliculas':
item.contentType = 'movie'
item.url = host + 'film/'
item.url = main_host + 'film/'
if categoria == 'series':
item.contentType = 'tvshow'
item.url = host + 'series/'
item.url = main_host + 'series/'
if categoria == 'anime':
item.contentType = 'tvshow'
item.url = host + 'anime/'
item.url = main_host + 'anime/'
return peliculas(item)
@@ -150,7 +149,6 @@ def episodios(item):
show_id = str(json_file[0]['show_id'])
season_id = str(json_file[0]['season_id'])
for episode in episodes:
try:
title = 'Episodio ' + episode['number'] + ' - ' + episode['title'].encode('utf8')
@@ -160,15 +158,14 @@ def episodios(item):
if type(title) == tuple: title = title[0]
itemlist.append(
item.clone(title = support.typo(title, 'bold'),
url= host + show_id + '/season/' + str(season_id),
url= main_host + show_id + '/season/' + str(season_id),
action= 'findvideos',
video_id= episode['video_id']))
if inspect.stack()[1][3] not in ['find_episodes']:
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
def findvideos(item):
@@ -176,7 +173,7 @@ def findvideos(item):
itemlist = []
if item.contentType == 'movie':
json_file = current_session.get(item.url, headers=headers, params=payload).json()
item.url = host + str(json_file['data'][0]['show_id']) + '/season/' + str(json_file['data'][0]['episodes'][0]['season_id']) + '/'
item.url = main_host + str(json_file['data'][0]['show_id']) + '/season/' + str(json_file['data'][0]['episodes'][0]['season_id']) + '/'
item.video_id = json_file['data'][0]['episodes'][0]['video_id']
logger.info('url=',item.url)
json_file = current_session.get(item.url, headers=headers, params=payload).json()
@@ -213,20 +210,22 @@ def make_itemlist(itemlist, item, data):
infoLabels = {}
for key in data['data']:
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'])
fulltitle=title.split('-')[0].strip()
infoLabels['year'] = key['date_published']
infoLabels['title'] = fulltitle
if item.contentType != 'movie': infoLabels['tvshowtitle'] = fulltitle
itemlist.append(
item.clone(title = support.typo(title, 'bold'),
fulltitle= title,
show= title,
url= host + str(key['show_id']) + '/seasons/',
fulltitle= fulltitle,
show= fulltitle,
url= main_host + str(key['show_id']) + '/seasons/',
action= 'findvideos' if item.contentType == 'movie' else 'episodios',
contentType = item.contentType,
contentSerieName= key['title'] if item.contentType != 'movie' else '',
contentTitle= title if item.contentType == 'movie' else '',
infoLabels=infoLabels))
contentSerieName= fulltitle if item.contentType != 'movie' else '',
contentTitle= fulltitle if item.contentType == 'movie' else '',
infoLabels=infoLabels,
videolibrary=False))
return itemlist
def loadjs(url):

View File

@@ -994,10 +994,7 @@ class Tmdb(object):
'&include_adult=%s&page=%s' % (self.busqueda_tipo, text_quote, self.busqueda_idioma, True, page))
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()
logger.debug("[Tmdb.py] Searching %s on page %s:\n%s" % (buscando, page, url))

View File

@@ -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']))))
if item.channel != "videolibrary":
if item.channel != "videolibrary" and item.videolibrary != False:
# Add Series to the video library
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)))