Modifiche ad Alpha

This commit is contained in:
Alhaziel01
2021-08-24 17:38:44 +02:00
parent 2764c48805
commit dfeec60fe3
27 changed files with 1945 additions and 67 deletions

View File

@@ -562,12 +562,12 @@ def scrape(func):
prevthumb=item.prevthumb if item.prevthumb else item.thumbnail))
if inspect.stack()[1][3] not in ['find_episodes', 'add_tvshow']:
if addVideolibrary and (item.infoLabels["title"] or item.fulltitle):
# item.fulltitle = item.infoLabels["title"]
videolibrary(itemlist, item, function=function)
if downloadEnabled and function == 'episodios' or function == 'findvideos':
download(itemlist, item, function=function)
# if inspect.stack()[1][3] not in ['find_episodes', 'add_tvshow']:
# if addVideolibrary and (item.infoLabels["title"] or item.fulltitle):
# # item.fulltitle = item.infoLabels["title"]
# videolibrary(itemlist, item, function=function)
# if downloadEnabled and function == 'episodios' or function == 'findvideos':
# download(itemlist, item, function=function)
if 'patronGenreMenu' in args and itemlist:
itemlist = thumb(itemlist, genre=True)
@@ -1043,7 +1043,7 @@ def download(itemlist, item, typography='', function_level=1, function=''):
from_action=from_action,
contentTitle=contentTitle,
path=item.path,
thumbnail=thumb('downloads'),
thumbnail=thumb('download'),
downloadItemlist=downloadItemlist
))
if from_action == 'episodios':
@@ -1060,7 +1060,7 @@ def download(itemlist, item, typography='', function_level=1, function=''):
from_action=from_action,
contentTitle=contentTitle,
download='season',
thumbnail=thumb('downloads'),
thumbnail=thumb('download'),
downloadItemlist=downloadItemlist
))
@@ -1193,7 +1193,7 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru
info(videoitem, 'Non supportato')
return
videoitem.server = findS[2]
videoitem.title= findS[0]
videoitem.serverName= findS[0]
videoitem.url = findS[1]
srv_param = servertools.get_server_parameters(videoitem.server.lower())
else:
@@ -1201,9 +1201,10 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru
if videoitem.video_urls or srv_param.get('active', False):
quality = videoitem.quality if videoitem.quality else item.quality if item.quality else ''
# videoitem = item.clone(url=videoitem.url, serverName=videoitem.serverName, server=videoitem.server, action='play')
videoitem.contentLanguage = videoitem.contentLanguage if videoitem.contentLanguage else item.contentLanguage if item.contentLanguage else 'ITA'
videoitem.serverName = videoitem.title if videoitem.server == 'directo' else servertools.get_server_parameters(videoitem.server).get('name', videoitem.server.capitalize())
videoitem.title = item.contentTitle.strip() if item.contentType == 'movie' and item.contentTitle or (config.get_localized_string(30161) in item.fulltitle) else item.fulltitle
# videoitem.title = item.contentTitle.strip() if item.contentType == 'movie' and item.contentTitle or (config.get_localized_string(30161) in item.fulltitle) else item.fulltitle
videoitem.plot = typo(videoitem.title, 'bold') + (typo(quality, '_ [] bold') if quality else '')
videoitem.channel = item.channel
videoitem.fulltitle = item.fulltitle
@@ -1362,7 +1363,6 @@ def addQualityTag(item, itemlist, data, patron):
def get_jwplayer_mediaurl(data, srvName, onlyHttp=False, dataIsBlock=False):
from core import jsontools
video_urls = []
block = scrapertools.find_single_match(data, r'sources:\s*([^\]]+\])') if not dataIsBlock else data
if block:

View File

@@ -17,7 +17,7 @@ from future.builtins import object
import ast, copy, re, time
from core import filetools, httptools, jsontools, scrapertools
from core import filetools, httptools, jsontools, scrapertools, support
from core.item import InfoLabels
from platformcode import config, logger, platformtools
import threading
@@ -965,13 +965,8 @@ class Tmdb(object):
result = result["tv_results"][0]
else:
result = result['tv_episode_results'][0]
if result.get('id'):
Mpaaurl = '{}/{}/{}/{}?api_key={}'.format(host, self.search_type, result['id'], 'release_dates' if self.search_type == 'movie' else 'content_ratings', api)
Mpaas = self.get_json(Mpaaurl).get('results',[])
for m in Mpaas:
if m.get('iso_3166_1','').lower() == 'us':
result['mpaa'] = m.get('rating', m.get('release_dates', [{}])[0].get('certification'))
break
result = self.get_mpaa(result)
self.results = [result]
self.total_results = 1
@@ -1041,6 +1036,8 @@ class Tmdb(object):
self.total_results = total_results
self.total_pages = total_pages
self.result = ResultDictDefault(self.results[index_results])
if not config.get_setting('tmdb_plus_info'):
self.result = self.get_mpaa(self.result)
return len(self.results)
else:
@@ -1785,6 +1782,16 @@ class Tmdb(object):
return ret_infoLabels
def get_mpaa(self, result):
if result.get('id'):
Mpaaurl = '{}/{}/{}/{}?api_key={}'.format(host, self.search_type, result['id'], 'release_dates' if self.search_type == 'movie' else 'content_ratings', api)
Mpaas = self.get_json(Mpaaurl).get('results',[])
for m in Mpaas:
if m.get('iso_3166_1','').lower() == 'us':
result['mpaa'] = m.get('rating', m.get('release_dates', [{}])[0].get('certification'))
break
return result
def get_season_dic(season):
ret_dic = dict()
@@ -1800,7 +1807,7 @@ def get_season_dic(season):
seasonCredits = season.get('credits', {})
seasonPosters = season.get('images',{}).get('posters',{})
seasonFanarts = season.get('images',{}).get('backdrops',{})
seasonTrailers = season.get('videos',[]).get('results',[])
seasonTrailers = season.get('videos',{}).get('results',[])
ret_dic["season_title"] = seasonTitle
ret_dic["season_plot"] = seasonPlot

View File

@@ -802,8 +802,9 @@ def add_tvshow(item, channel=None, itemlist=[]):
itemlist = getattr(channel, it.action)(it)
item.host = channel.host
if itemlist:
# support.dbg()
from platformcode.autorenumber import start, check
if not check(item):
if not check(item, itemlist):
action = item.action
item.setrenumber = True
start(item)
@@ -877,7 +878,8 @@ def get_fanart_tv(item, set='', ret={}):
d[k['season']] = o
return d
_id = item.infoLabels.get('tvdb_id', item.infoLabels.get('tmdb_id'))
_id = item.infoLabels.get('tmdb_id')
# support.dbg()
if _id:
_type = item.contentType.replace('show','').replace('movie','movies')