alcuni fix per kodi 19

This commit is contained in:
marco
2020-08-16 12:55:12 +02:00
parent ae2a9d7c72
commit bfb80f6889
42 changed files with 6510 additions and 2735 deletions
+7 -7
View File
@@ -653,7 +653,7 @@ def download_from_server(item):
channel = __import__('channels.%s' % item.contentChannel, None, None, ['channels.%s' % item.contentChannel])
if hasattr(channel, "play") and not item.play_menu:
progreso.update(50, config.get_localized_string(70178) % item.server, config.get_localized_string(70180) % item.contentChannel)
progreso.update(50, config.get_localized_string(70178) % item.server + '\n' + config.get_localized_string(70180) % item.contentChannel)
try:
itemlist = getattr(channel, "play")(item.clone(channel=item.contentChannel, action=item.contentAction))
except:
@@ -732,7 +732,7 @@ def download_from_best_server(item):
else:
channel = __import__('channels.%s' % item.contentChannel, None, None, ['channels.%s' % item.contentChannel])
progreso.update(50, config.get_localized_string(70184), config.get_localized_string(70180) % item.contentChannel)
progreso.update(50, config.get_localized_string(70184) + '\n' + config.get_localized_string(70180) % item.contentChannel)
if hasattr(channel, item.contentAction):
play_items = getattr(channel, item.contentAction)(item.clone(action=item.contentAction, channel=item.contentChannel))
@@ -741,7 +741,7 @@ def download_from_best_server(item):
play_items = [x for x in play_items if x.action == "play" and not "trailer" in x.title.lower()]
progreso.update(100, config.get_localized_string(70183), config.get_localized_string(70181) % len(play_items))
progreso.update(100, config.get_localized_string(70183) + '\n' + config.get_localized_string(70181) % len(play_items))
# if config.get_setting("server_reorder", "downloads") == 1:
play_items.sort(key=sort_method)
@@ -784,7 +784,7 @@ def select_server(item):
channel = __import__('specials.%s' % item.contentChannel, None, None, ['specials.%s' % item.contentChannel])
else:
channel = __import__('channels.%s' % item.contentChannel, None, None, ['channels.%s' % item.contentChannel])
progreso.update(50, config.get_localized_string(70184), config.get_localized_string(70180) % item.contentChannel)
progreso.update(50, config.get_localized_string(70184) + '\n' + config.get_localized_string(70180) % item.contentChannel)
if hasattr(channel, item.contentAction):
play_items = getattr(channel, item.contentAction)(
@@ -793,7 +793,7 @@ def select_server(item):
play_items = servertools.find_video_items(item.clone(action=item.contentAction, channel=item.contentChannel))
play_items = [x for x in play_items if x.action == "play" and not "trailer" in x.title.lower()]
progreso.update(100, config.get_localized_string(70183), config.get_localized_string(70181) % len(play_items))
progreso.update(100, config.get_localized_string(70183) + '\n' + config.get_localized_string(70181) % len(play_items))
finally:
progreso.close()
@@ -1092,11 +1092,11 @@ def save_download_tvshow(item):
if config.get_setting("lowerize_title", "videolibrary"):
item.downloadFilename = item.downloadFilename.lower()
progreso.update(0, config.get_localized_string(70186), config.get_localized_string(70180) % item.contentChannel)
progreso.update(0, config.get_localized_string(70186) + '\n' + config.get_localized_string(70180) % item.contentChannel)
episodes = get_episodes(item)
progreso.update(0, config.get_localized_string(70190), " ")
progreso.update(0, config.get_localized_string(70190))
for x, i in enumerate(episodes):
progreso.update(old_div(x * 100, len(episodes)), "%dx%0.2d: %s" % (i.contentSeason, i.contentEpisodeNumber, i.contentTitle))
+1 -1
View File
@@ -757,7 +757,7 @@ def compartir_lista(item):
upload_url = scrapertools.find_single_match(data, 'form action="([^"]+)')
sessionid = scrapertools.find_single_match(upload_url, 'sid=(.+)')
progreso.update(10, config.get_localized_string(70645), config.get_localized_string(70646))
progreso.update(10, config.get_localized_string(70645) + '\n' + config.get_localized_string(70646))
# Sending the file to tinyupload using multipart / form-data
from future import standard_library
+3 -3
View File
@@ -279,7 +279,7 @@ def novedades(item):
t.start()
threads.append(t)
if mode == 'normal':
progreso.update(percentage, "", config.get_localized_string(60520) % channel_title)
progreso.update(percentage, config.get_localized_string(60520) % channel_title)
# Modo single Thread
else:
@@ -299,7 +299,7 @@ def novedades(item):
list_pendent_names = [a.getName() for a in pendent]
if mode == 'normal':
mensaje = config.get_localized_string(30994) % (", ".join(list_pendent_names))
progreso.update(percentage, config.get_localized_string(60521) % (len(threads) - len(pendent), len(threads)),
progreso.update(percentage, config.get_localized_string(60521) % (len(threads) - len(pendent), len(threads)) + '\n' +
mensaje)
logger.debug(mensaje)
@@ -311,7 +311,7 @@ def novedades(item):
pendent = [a for a in threads if a.isAlive()]
if mode == 'normal':
mensaje = config.get_localized_string(60522) % (len(list_newest), time.time() - start_time)
progreso.update(100, mensaje, " ", " ")
progreso.update(100, mensaje)
logger.info(mensaje)
start_time = time.time()
# logger.debug(start_time)
+18 -19
View File
@@ -1,10 +1,13 @@
# -*- coding: utf-8 -*-
import os
import ssl
try:
import urlparse
except:
import os, sys, ssl
PY3 = False
if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int
if PY3:
import urllib.parse as urlparse
import _ssl
DEFAULT_CIPHERS = _ssl._DEFAULT_CIPHERS
else:
DEFAULT_CIPHERS = ssl._DEFAULT_CIPHERS
from lib.requests_toolbelt.adapters import host_header_ssl
from lib import doh
@@ -25,24 +28,20 @@ elif 'PROTOCOL_SSLv23' in ssl.__dict__:
else:
protocol = ssl.PROTOCOL_SSLv3
class CustomSocket(ssl.SSLSocket):
def __init__(self, *args, **kwargs):
super(CustomSocket, self).__init__(*args, **kwargs)
class CustomContext(ssl.SSLContext):
def __init__(self, protocol, hostname, *args, **kwargs):
self.hostname = hostname
super(CustomContext, self).__init__(protocol)
if PY3:
super(CustomContext, self).__init__()
else:
super(CustomContext, self).__init__(protocol)
self.verify_mode = ssl.CERT_NONE
def wrap_socket(self, sock, server_side=False,
do_handshake_on_connect=True,
suppress_ragged_eofs=True,
server_hostname=None):
return CustomSocket(sock=sock, server_side=server_side,
do_handshake_on_connect=do_handshake_on_connect,
suppress_ragged_eofs=suppress_ragged_eofs,
server_hostname=self.hostname,
_context=self)
def wrap_socket(self, *args, **kwargs):
kwargs['server_hostname'] = self.hostname
self.verify_mode = ssl.CERT_NONE
return super(CustomContext, self).wrap_socket(*args, **kwargs)
class CipherSuiteAdapter(host_header_ssl.HostHeaderSSLAdapter):
@@ -52,7 +51,7 @@ class CipherSuiteAdapter(host_header_ssl.HostHeaderSSLAdapter):
self.cur = self.conn.cursor()
self.ssl_context = CustomContext(protocol, domain)
self.CF = CF # if cloudscrape is in action
self.cipherSuite = kwargs.pop('cipherSuite', ssl._DEFAULT_CIPHERS)
self.cipherSuite = kwargs.pop('cipherSuite', DEFAULT_CIPHERS)
super(CipherSuiteAdapter, self).__init__(**kwargs)
+2 -2
View File
@@ -249,7 +249,7 @@ def channel_search(item):
cnt += 1
searching_titles.remove(searching_titles[searching.index(channel)])
searching.remove(channel)
progress.update(old_div(((total_search_actions - len(search_action_list)) * 100), total_search_actions), config.get_localized_string(70744) % str(len(channel_list) - cnt), ', '.join(searching_titles))
progress.update(old_div(((total_search_actions - len(search_action_list)) * 100), total_search_actions), config.get_localized_string(70744) % str(len(channel_list) - cnt) + '\n' + ', '.join(searching_titles))
progress.close()
@@ -262,7 +262,7 @@ def channel_search(item):
ch_name = channel_titles[channel_list.index(key)]
grouped = list()
cnt += 1
progress.update(old_div((cnt * 100), len(ch_list)), config.get_localized_string(60295), config.get_localized_string(60293))
progress.update(old_div((cnt * 100), len(ch_list)), config.get_localized_string(60295) + '\n' + config.get_localized_string(60293))
if len(value) <= max_results and item.mode != 'all':
if len(value) == 1:
if not value[0].action or config.get_localized_string(70006).lower() in value[0].title.lower():
+2 -2
View File
@@ -212,7 +212,7 @@ def get_results(nfo_path, root, Type, local=False):
else:
update_text = config.get_localized_string(60023)
value = 1
item.title += " [B]" + u"\u2022".encode('utf-8') + "[/B]"
item.title += " [B]" + u"\u2022" + "[/B]"
# Context menu: Delete series / channel
channels_num = len(item.library_urls)
@@ -645,7 +645,7 @@ def move_videolibrary(current_path, new_path, current_movies_folder, new_movies_
return
config.verify_directories_created()
progress.update(10, config.get_localized_string(20000), config.get_localized_string(80012))
progress.update(10, config.get_localized_string(20000) + '\n' + config.get_localized_string(80012))
if current_movies_path != new_movies_path:
if filetools.listdir(current_movies_path):
dir_util.copy_tree(current_movies_path, new_movies_path)