Risposta server come Dict e modifiche varie
This commit is contained in:
@@ -9,13 +9,6 @@ __channel__ = "autoplay"
|
||||
|
||||
PLAYED = False
|
||||
|
||||
quality_list = ['4k', '2160p', '2160', '4k2160p', '4k2160', '4k 2160p', '4k 2160', '2k',
|
||||
'fullhd', 'fullhd 1080', 'fullhd 1080p', 'full hd', 'full hd 1080', 'full hd 1080p', 'hd1080', 'hd1080p', 'hd 1080', 'hd 1080p', '1080', '1080p',
|
||||
'hd', 'hd720', 'hd720p', 'hd 720', 'hd 720p', '720', '720p', 'hdtv',
|
||||
'sd', '480p', '480', '360p', '360', '240p', '240',
|
||||
'default']
|
||||
|
||||
|
||||
def start(itemlist, item):
|
||||
'''
|
||||
Main method from which the links are automatically reproduced
|
||||
|
||||
+6
-4
@@ -254,7 +254,7 @@ def resolve_video_urls_for_playing(server, url, video_password="", muestra_dialo
|
||||
if isinstance(video_password, list):
|
||||
return video_password, len(video_password) > 0, "<br/>".join(error_messages)
|
||||
logger.info("Server: %s, url is good" % server)
|
||||
video_urls.append(["%s [%s]" % (urlparse.urlparse(url)[2][-4:], config.get_localized_string(30137)), url])
|
||||
video_urls.append({'type':urlparse.urlparse(url)[2].split('.')[-1], 'url':url})
|
||||
|
||||
# Find out the video URL
|
||||
else:
|
||||
@@ -270,7 +270,7 @@ def resolve_video_urls_for_playing(server, url, video_password="", muestra_dialo
|
||||
|
||||
# Count the available options, to calculate the percentage
|
||||
|
||||
orden = [
|
||||
order = [
|
||||
["free"] + [server] + [premium for premium in server_parameters["premium"] if not premium == server],
|
||||
[server] + [premium for premium in server_parameters["premium"] if not premium == server] + ["free"],
|
||||
[premium for premium in server_parameters["premium"] if not premium == server] + [server] + ["free"]
|
||||
@@ -282,7 +282,7 @@ def resolve_video_urls_for_playing(server, url, video_password="", muestra_dialo
|
||||
[premium for premium in server_parameters["premium"] if config.get_setting("premium", server=premium)])
|
||||
|
||||
priority = int(config.get_setting("resolve_priority"))
|
||||
opciones = sorted(opciones, key=lambda x: orden[priority].index(x))
|
||||
opciones = sorted(opciones, key=lambda x: order[priority].index(x))
|
||||
|
||||
logger.info("Available options: %s | %s" % (len(opciones), opciones))
|
||||
else:
|
||||
@@ -685,6 +685,7 @@ def sort_servers(servers_list):
|
||||
blacklisted_servers = config.get_setting("black_list", server='servers', default=[])
|
||||
favorite_servers = config.get_setting('favorites_servers_list', server='servers', default=[])
|
||||
favorite_servers = [s for s in favorite_servers if s not in blacklisted_servers]
|
||||
|
||||
if isinstance(servers_list[0], str):
|
||||
servers_list = sorted(servers_list, key=lambda x: favorite_servers.index(x) if x in favorite_servers else 999)
|
||||
return servers_list
|
||||
@@ -720,8 +721,9 @@ def sort_servers(servers_list):
|
||||
continue
|
||||
|
||||
element["index_server"] = index(favorite_servers, item.server.lower())
|
||||
element["index_quality"] = platformtools.calcResolution(item.quality)
|
||||
element["index_quality"] = index(favorite_quality, item.quality.lower())
|
||||
element['index_language'] = 0 if item.contentLanguage == 'ITA' else 1
|
||||
|
||||
element['videoitem'] = item
|
||||
sorted_list.append(element)
|
||||
|
||||
|
||||
+2
-2
@@ -1445,9 +1445,9 @@ def get_jwplayer_mediaurl(data, srvName, onlyHttp=False, dataIsBlock=False):
|
||||
for url, quality in sources:
|
||||
quality = 'auto' if not quality else quality
|
||||
if url.split('.')[-1] != 'mpd':
|
||||
video_urls.append(['.' + url.split('.')[-1].split('?')[0] + ' [' + quality + '] [' + srvName + ']', url.replace(' ', '%20') if not onlyHttp else url.replace('https://', 'http://')])
|
||||
video_urls.append({'type':url.split('.')[-1], 'res':quality, 'url':url if not onlyHttp else url.replace('https://', 'http://')})
|
||||
|
||||
video_urls.sort(key=lambda x: x[0].split()[1])
|
||||
# video_urls.sort(key=lambda x: x[0].split()[1])
|
||||
return video_urls
|
||||
|
||||
|
||||
|
||||
@@ -30,11 +30,6 @@ if not FOLDER_MOVIES or not FOLDER_TVSHOWS or not VIDEOLIBRARY_PATH or not filet
|
||||
|
||||
addon_name = "plugin://plugin.video.%s/" % config.PLUGIN_NAME
|
||||
|
||||
quality_order = ['4k', '2160p', '2160', '4k2160p', '4k2160', '4k 2160p', '4k 2160', '2k',
|
||||
'fullhd', 'fullhd 1080', 'fullhd 1080p', 'full hd', 'full hd 1080', 'full hd 1080p', 'hd1080', 'hd1080p', 'hd 1080', 'hd 1080p', '1080', '1080p',
|
||||
'hd', 'hd720', 'hd720p', 'hd 720', 'hd 720p', '720', '720p', 'hdtv',
|
||||
'sd', '480p', '480', '360p', '360', '240p', '240']
|
||||
|
||||
video_extensions = ['3g2', '3gp', '3gp2', 'asf', 'avi', 'divx', 'flv', 'iso', 'm4v', 'mk2', 'mk3d', 'mka', 'mkv', 'mov', 'mp4', 'mp4a', 'mpeg', 'mpg', 'ogg', 'ogm', 'ogv', 'qt', 'ra', 'ram', 'rm', 'ts', 'vob', 'wav', 'webm', 'wma', 'wmv']
|
||||
subtitle_extensions = ['srt', 'idx', 'sub', 'ssa', 'ass']
|
||||
image_extensions = ['.jpg', '.jpeg', '.png']
|
||||
|
||||
Reference in New Issue
Block a user