Modifiche del 26/11/2021

This commit is contained in:
Alhaziel01
2021-11-26 18:55:51 +01:00
parent 48996688a6
commit 5257183fb7
221 changed files with 4565 additions and 4807 deletions
+2 -2
View File
@@ -46,10 +46,10 @@ def toStringCases(txt_result):
if "+(" in txt_result:
m3 = True
sum_base = "+" + find_single_match(txt_result, ".toString...(\d+).")
txt_pre_temp = find_multiple_matches(txt_result, "..(\d),(\d+).")
txt_pre_temp = findMultipleMatches(txt_result, "..(\d),(\d+).")
txt_temp = [(n, b) for b, n in txt_pre_temp]
else:
txt_temp = find_multiple_matches(txt_result, '(\d+)\.0.\w+.([^\)]+).')
txt_temp = findMultipleMatches(txt_result, '(\d+)\.0.\w+.([^\)]+).')
for numero, base in txt_temp:
code = toString(int(numero), eval(base + sum_base))
if m3:
+5 -5
View File
@@ -80,7 +80,7 @@ class ChromeOSImage:
"""Extracts the file from the image"""
self.progress = progress
self.progress.update(2, config.get_localized_string(70813))
self.progress.update(2, config.getLocalizedString(70813))
self.part_offset = self.chromeos_offset()
self.sb_dict = self.superblock()
self.blk_groups = self.block_groups()
@@ -88,7 +88,7 @@ class ChromeOSImage:
bin_filename = filename.encode('ascii')
chunksize = 4 * 1024**2
percent8 = 40
self.progress.update(int(percent8 / 8), config.get_localized_string(70814))
self.progress.update(int(percent8 / 8), config.getLocalizedString(70814))
chunk1 = self.read_stream(chunksize)
while True:
chunk2 = self.read_stream(chunksize)
@@ -107,7 +107,7 @@ class ChromeOSImage:
percent8 += 1
self.progress.update(int(percent8 / 8))
self.progress.update(32, config.get_localized_string(70815))
self.progress.update(32, config.getLocalizedString(70815))
blk_group_num = (dir_dict['inode'] - 1) // self.sb_dict['s_inodes_per_group']
blk_group = self.blk_groups[blk_group_num]
@@ -199,7 +199,7 @@ class ChromeOSImage:
@staticmethod
def dir_entry(chunk):
"""Returns the directory entry found in chunk"""
dir_names = ('inode', 'rec_len', 'name_len', 'file_type', 'name')
dir_names = ('inode', 'rec_len', 'name_len', 'fileType', 'name')
dir_fmt = '<IHBB' + str(len(chunk) - 8) + 's'
dir_dict = dict(zip(dir_names, unpack(dir_fmt, chunk)))
@@ -284,7 +284,7 @@ class ChromeOSImage:
block_dict = {}
for block_id in block_ids:
percent = int(35 + 60 * block_ids.index(block_id) / len(block_ids))
self.progress.update(percent, config.get_localized_string(70816))
self.progress.update(percent, config.getLocalizedString(70816))
seek_pos = self.part_offset + self.blocksize * block_id
self.seek_stream(seek_pos)
block_dict[block_id] = self.read_stream(self.blocksize)
+2 -2
View File
@@ -28,7 +28,7 @@ class Mailbox:
def waitForMail(self, timeout=50):
info = 'verifica tramite mail richiesta dal sito, sono in attesa di nuove mail sulla casella ' + self.address
# info += '\nTimeout tra ' + str(timeout) + ' secondi'
dialog = platformtools.dialog_progress(config.get_localized_string(20000), info)
dialog = platformtools.dialogProgress(config.getLocalizedString(20000), info)
secs = 0
while secs < timeout:
msg = self.readLast()
@@ -113,7 +113,7 @@ class Gmailnator(Mailbox):
if e.success and e.data:
return e.data
else:
platformtools.dialog_ok(config.get_localized_string(20000), 'Impossibile ottenere una mail temporanea')
platformtools.dialogOk(config.getLocalizedString(20000), 'Impossibile ottenere una mail temporanea')
def inbox(self):
#[{"content":"\n\t\t\t\t<a href=\"https:\/\/gmailnator.com\/jonathanmichaeltmp\/messageid\/#174f933a17b5f625\">\n\t\t\t\t\t<table class=\"message_container\">\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>dsds<\/td>\n\t\t\t\t\t\t\t\t<td>body<\/td>\n\t\t\t\t\t\t\t\t<td class=\"text-right\">one minute ago<\/td>\n\t\t\t\t\t\t\t<\/tr>\n\t\t\t\t\t\t<\/tbody>\n\t\t\t\t\t<\/table>\n\t\t\t\t<\/a>"}]
+36 -36
View File
@@ -153,7 +153,7 @@ def update_title(item):
item.channel = new_item.channel # Restoring the name of the channel, in case we had changed it
if item.tmdb_stat == True:
if new_item.contentSerieName: # If it's serial ...
filter_languages = config.get_setting("filter_languages", item.channel)
filter_languages = config.getSetting("filter_languages", item.channel)
if filter_languages and filter_languages >= 0:
item.title_from_channel = new_item.contentSerieName # I keep the initial title for Filtertools
item.contentSerieName = new_item.contentSerieName # I keep the initial title for Filtertools
@@ -223,7 +223,7 @@ def refresh_screen(item):
import xbmcgui
xlistitem = xbmcgui.ListItem(path=item.url) # We create xlistitem for compatibility with Kodi 18
if config.get_platform(True)['num_version'] >= 16.0:
if config.getXBMCPlatform(True)['num_version'] >= 16.0:
xlistitem.setArt({"thumb": item.contentThumbnail}) # We load the thumb
else:
xlistitem.setThumbnailImage(item.contentThumbnail)
@@ -234,7 +234,7 @@ def refresh_screen(item):
except:
logger.error(traceback.format_exc())
platformtools.itemlist_update(item) # we refresh the screen with the new Item
platformtools.itemlistUpdate(item) # we refresh the screen with the new Item
return xlistitem
@@ -328,7 +328,7 @@ def post_tmdb_listado(item, itemlist):
except:
logger.error(traceback.format_exc())
__modo_grafico__ = config.get_setting('modo_grafico', item.channel)
__modo_grafico__ = config.getSetting('modo_grafico', item.channel)
# If TMDB has not found the video we clean the year
if item_local.infoLabels['year'] == "-":
@@ -431,7 +431,7 @@ def post_tmdb_listado(item, itemlist):
title += title_add # Additional tags are added, if any
# Now we make up the titles a bit depending on whether smart titles have been selected or not
if not config.get_setting("unify"): # If Smart Titles NOT selected:
if not config.getSetting("unify"): # If Smart Titles NOT selected:
title = '%s [COLOR yellow][%s][/COLOR] [%s] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (title, str(item_local.infoLabels['year']), rating, item_local.quality, str(item_local.language))
else: # If Smart Titles YES selected:
@@ -512,7 +512,7 @@ def post_tmdb_seasons(item, itemlist):
itemlist_temporadas = []
itemlist_fo = []
if config.get_setting("no_pile_on_seasons", 'videolibrary') == 2: # If you do not want to show seasonally, we are leaving ...
if config.getSetting("no_pile_on_seasons", 'videolibrary') == 2: # If you do not want to show seasonally, we are leaving ...
if item.season_colapse: # We remove the indicator from the list by Seasons
del item.season_colapse
return (item, itemlist)
@@ -558,13 +558,13 @@ def post_tmdb_seasons(item, itemlist):
if rating and rating == 0.0:
rating = ''
if not config.get_setting("unify"): # If Smart Titles NOT selected:
if not config.getSetting("unify"): # If Smart Titles NOT selected:
title = '%s [COLOR yellow][%s][/COLOR] [%s] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (title, str(item_season.infoLabels['year']), rating, item_season.quality, str(item_season.language))
else: # We fixed it a bit for Unify
title = title.replace('[', '-').replace(']', '-').replace('.', ',').strip()
title = title.replace("--", "").replace("[]", "").replace("()", "").replace("(/)", "").replace("[/]", "").strip()
if config.get_setting("show_all_seasons", 'videolibrary'):
if config.getSetting("show_all_seasons", 'videolibrary'):
itemlist_temporadas.append(item_season.clone(title=title, from_title_season_colapse=item.title))
# We review all the episodes to detect the different seasons
@@ -577,7 +577,7 @@ def post_tmdb_seasons(item, itemlist):
itemlist_temporadas.append(item_season.clone(from_title_season_colapse=item.title))
# If there is more than one season it is followed, or it has been forced to list by seasons, if the original Itemlist is not returned
if len(itemlist_temporadas) > 2 or config.get_setting("no_pile_on_seasons", 'videolibrary') == 0:
if len(itemlist_temporadas) > 2 or config.getSetting("no_pile_on_seasons", 'videolibrary') == 0:
for item_local in itemlist_temporadas:
if "** Todas las Temporadas" in item_local.title: # If it's the title of ALL Seasons, we ignore it
continue
@@ -604,7 +604,7 @@ def post_tmdb_seasons(item, itemlist):
if item_local.infoLabels['temporada_num_episodes']: # No. of Temp Episodes
item_local.title += ' [%s epi]' % str(item_local.infoLabels['temporada_num_episodes'])
if not config.get_setting("unify"): # If Smart Titles NOT selected:
if not config.getSetting("unify"): # If Smart Titles NOT selected:
item_local.title = '%s [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (item_local.title, item_local.quality, str(item_local.language))
else: # We fixed it a bit for Unify
item_local.title = item_local.title.replace("[", "-").replace("]", "-").replace(".", ",").replace("GB", "G B").replace("Gb", "G b").replace("gb", "g b").replace("MB", "M B").replace("Mb", "M b").replace("mb", "m b")
@@ -667,11 +667,11 @@ def post_tmdb_episodes(item, itemlist):
# logger.debug(item)
modo_serie_temp = ''
if config.get_setting('seleccionar_serie_temporada', item.channel) >= 0:
modo_serie_temp = config.get_setting('seleccionar_serie_temporada', item.channel)
if config.getSetting('seleccionar_serie_temporada', item.channel) >= 0:
modo_serie_temp = config.getSetting('seleccionar_serie_temporada', item.channel)
modo_ultima_temp = ''
if config.get_setting('seleccionar_ult_temporadda_activa', item.channel) is True or config.get_setting('seleccionar_ult_temporadda_activa', item.channel) is False:
modo_ultima_temp = config.get_setting('seleccionar_ult_temporadda_activa', item.channel)
if config.getSetting('seleccionar_ult_temporadda_activa', item.channel) is True or config.getSetting('seleccionar_ult_temporadda_activa', item.channel) is False:
modo_ultima_temp = config.getSetting('seleccionar_ult_temporadda_activa', item.channel)
# Initiates variables to control the number of episodes per season
num_episodes = 1
@@ -1015,16 +1015,16 @@ def post_tmdb_findvideos(item, itemlist):
# logger.debug(item)
# Know if we are in a popup window launched from a bullet in the main menu,
# with the function "play_from_library"
# with the function "playFromLibrary"
item.unify = False
Window_IsMedia = False
try:
import xbmc
if xbmc.getCondVisibility('Window.IsMedia') == 1:
Window_IsMedia = True
item.unify = config.get_setting("unify")
item.unify = config.getSetting("unify")
except:
item.unify = config.get_setting("unify")
item.unify = config.getSetting("unify")
logger.error(traceback.format_exc())
if item.contentSeason_save: # We restore the num. seasonal
@@ -1097,7 +1097,7 @@ def post_tmdb_findvideos(item, itemlist):
tiempo = 0
if item.infoLabels['duration']:
try:
if config.get_platform(True)['num_version'] < 18 or not Window_IsMedia:
if config.getXBMCPlatform(True)['num_version'] < 18 or not Window_IsMedia:
tiempo = item.infoLabels['duration']
elif xbmc.getCondVisibility('Window.IsMedia') == 1:
item.quality = re.sub(r'\s?\[\d+:\d+\ h]', '', item.quality)
@@ -1176,7 +1176,7 @@ def post_tmdb_findvideos(item, itemlist):
if item.channel_alt:
title_gen = '[COLOR yellow]%s [/COLOR][ALT]: %s' % (item.category.capitalize(), title_gen)
# elif (config.get_setting("quit_channel_name", "videolibrary") == 1 or item.channel == channel_py) and item.contentChannel == "videolibrary":
# elif (config.getSetting("quit_channel_name", "videolibrary") == 1 or item.channel == channel_py) and item.contentChannel == "videolibrary":
else:
title_gen = '[COLOR white]%s: %s' % (item.category.capitalize(), title_gen)
@@ -1230,10 +1230,10 @@ def get_field_from_kodi_DB(item, from_fields='*', files='file'):
"""
FOLDER_MOVIES = config.get_setting("folder_movies")
FOLDER_TVSHOWS = config.get_setting("folder_tvshows")
VIDEOLIBRARY_PATH = config.get_videolibrary_config_path()
VIDEOLIBRARY_REAL_PATH = config.get_videolibrary_path()
FOLDER_MOVIES = config.getSetting("folder_movies")
FOLDER_TVSHOWS = config.getSetting("folder_tvshows")
VIDEOLIBRARY_PATH = config.getVideolibraryConfigPath()
VIDEOLIBRARY_REAL_PATH = config.getVideolibraryPath()
if item.contentType == 'movie': # I add the folder corresponding to the path of the Video Library
path = filetools.join(VIDEOLIBRARY_REAL_PATH, FOLDER_MOVIES)
@@ -1324,7 +1324,7 @@ def fail_over_newpct1(item, patron, patron2=None, timeout=None):
# logger.debug(item)
if timeout == None:
timeout = config.get_setting('clonenewpct1_timeout_downloadpage', channel_py) # Timeout downloadpage
timeout = config.getSetting('clonenewpct1_timeout_downloadpage', channel_py) # Timeout downloadpage
if timeout == 0: timeout = None
if item.action == "search" or item.action == "listado_busqueda": timeout = timeout * 2 # More time for searches
@@ -1563,9 +1563,9 @@ def web_intervenida(item, data, desactivar=True):
# We save the changes made in the .json
try:
if item.channel != channel_py:
disabled = config.set_setting('enabled', False, item.channel) # We deactivate the channel
disabled = config.set_setting('include_in_global_search', False, item.channel) # We get it out of global searches
channel_path = filetools.join(config.get_runtime_path(), "channels", item.channel + ".json")
disabled = config.setSetting('enabled', False, item.channel) # We deactivate the channel
disabled = config.setSetting('include_in_global_search', False, item.channel) # We get it out of global searches
channel_path = filetools.join(config.getRuntimePath(), "channels", item.channel + ".json")
with open(channel_path, 'w') as outfile: # We record the updated .json
json.dump(json_data, outfile, sort_keys = True, indent = 2, ensure_ascii = False)
except:
@@ -1590,20 +1590,20 @@ def regenerate_clones():
try:
# Find the paths where to leave the control .json file, and the Video Library
json_path = filetools.exists(filetools.join(config.get_runtime_path(), 'verify_cached_torrents.json'))
json_path = filetools.exists(filetools.join(config.getRuntimePath(), 'verify_cached_torrents.json'))
if json_path:
logger.debug('Previously repaired video library: WE ARE GOING')
return False
json_path = filetools.join(config.get_runtime_path(), 'verify_cached_torrents.json')
json_path = filetools.join(config.getRuntimePath(), 'verify_cached_torrents.json')
filetools.write(json_path, json.dumps({"CINE_verify": True})) # Prevents another simultaneous process from being launched
json_error_path = filetools.join(config.get_runtime_path(), 'error_cached_torrents.json')
json_error_path_BK = filetools.join(config.get_runtime_path(), 'error_cached_torrents_BK.json')
json_error_path = filetools.join(config.getRuntimePath(), 'error_cached_torrents.json')
json_error_path_BK = filetools.join(config.getRuntimePath(), 'error_cached_torrents_BK.json')
videolibrary_path = config.get_videolibrary_path() # We calculate the absolute path from the Video Library
movies = config.get_setting("folder_movies")
series = config.get_setting("folder_tvshows")
torrents_movies = filetools.join(videolibrary_path, config.get_setting("folder_movies")) # path of CINE
torrents_series = filetools.join(videolibrary_path, config.get_setting("folder_tvshows")) # path the SERIES
videolibrary_path = config.getVideolibraryPath() # We calculate the absolute path from the Video Library
movies = config.getSetting("folder_movies")
series = config.getSetting("folder_tvshows")
torrents_movies = filetools.join(videolibrary_path, config.getSetting("folder_movies")) # path of CINE
torrents_series = filetools.join(videolibrary_path, config.getSetting("folder_tvshows")) # path the SERIES
# We load in .json from Newpct1 to see the lists of values in settings
fail_over_list = channeltools.get_channel_json(channel_py)
+5 -5
View File
@@ -21,14 +21,14 @@ class Client(object):
'.m4v': 'video/mp4', '.mov': 'video/quicktime', '.mpg': 'video/mpeg','.ogv': 'video/ogg',
'.ogg': 'video/ogg', '.webm': 'video/webm', '.ts': 'video/mp2t', '.3gp': 'video/3gpp'}
def __init__(self, url, port=None, ip=None, auto_shutdown=True, wait_time=20, timeout=5, is_playing_fnc=None):
def __init__(self, url, port=None, ip=None, auto_shutdown=True, wait_time=20, timeout=5, isPlaying_fnc=None):
self.port = port if port else random.randint(8000,8099)
self.ip = ip if ip else "127.0.0.1"
self.connected = False
self.start_time = None
self.last_connect = None
self.is_playing_fnc = is_playing_fnc
self.isPlaying_fnc = isPlaying_fnc
self.auto_shutdown = auto_shutdown
self.wait_time = wait_time
self.timeout = timeout
@@ -55,12 +55,12 @@ class Client(object):
if self.file and self.file.cursor:
self.last_connect = time.time()
if self.is_playing_fnc and self.is_playing_fnc():
if self.isPlaying_fnc and self.isPlaying_fnc():
self.last_connect = time.time()
if self.auto_shutdown:
#shudown por haber cerrado el reproductor
if self.connected and self.last_connect and self.is_playing_fnc and not self.is_playing_fnc():
if self.connected and self.last_connect and self.isPlaying_fnc and not self.isPlaying_fnc():
if time.time() - self.last_connect - 1 > self.timeout:
self.stop()
@@ -70,7 +70,7 @@ class Client(object):
self.stop()
#shutdown tras la ultima conexion
if (not self.file or not self.file.cursor) and self.timeout and self.connected and self.last_connect and not self.is_playing_fnc:
if (not self.file or not self.file.cursor) and self.timeout and self.connected and self.last_connect and not self.isPlaying_fnc:
if time.time() - self.last_connect - 1 > self.timeout:
self.stop()
+4 -4
View File
@@ -218,22 +218,22 @@ class MultipartEncoder(object):
_fields = list(self.fields.items())
for k, v in _fields:
file_name = None
file_type = None
fileType = None
file_headers = None
if isinstance(v, (list, tuple)):
if len(v) == 2:
file_name, file_pointer = v
elif len(v) == 3:
file_name, file_pointer, file_type = v
file_name, file_pointer, fileType = v
else:
file_name, file_pointer, file_type, file_headers = v
file_name, file_pointer, fileType, file_headers = v
else:
file_pointer = v
field = fields.RequestField(name=k, data=file_pointer,
filename=file_name,
headers=file_headers)
field.make_multipart(content_type=file_type)
field.make_multipart(content_type=fileType)
yield field
def _prepare_parts(self):
+10 -10
View File
@@ -19,14 +19,14 @@ from lib.streamingcommunity.server import Server
class Client(object):
def __init__(self, url, port=None, ip=None, auto_shutdown=True, wait_time=20, timeout=5, is_playing_fnc=None, video_id=None):
def __init__(self, url, port=None, ip=None, auto_shutdown=True, wait_time=20, timeout=5, isPlaying_fnc=None, video_id=None):
self.port = port if port else random.randint(8000,8099)
self.ip = ip if ip else "127.0.0.1"
self.connected = False
self.start_time = None
self.last_connect = None
self.is_playing_fnc = is_playing_fnc
self.isPlaying_fnc = isPlaying_fnc
self.auto_shutdown = auto_shutdown
self.wait_time = wait_time
self.timeout = timeout
@@ -71,12 +71,12 @@ class Client(object):
if self.file and self.file.cursor:
self.last_connect = time.time()
if self.is_playing_fnc and self.is_playing_fnc():
if self.isPlaying_fnc and self.isPlaying_fnc():
self.last_connect = time.time()
if self.auto_shutdown:
#shudown por haber cerrado el reproductor
if self.connected and self.last_connect and self.is_playing_fnc and not self.is_playing_fnc():
if self.connected and self.last_connect and self.isPlaying_fnc and not self.isPlaying_fnc():
if time.time() - self.last_connect - 1 > self.timeout:
self.stop()
@@ -86,7 +86,7 @@ class Client(object):
self.stop()
#shutdown tras la ultima conexion
if (not self.file or not self.file.cursor) and self.timeout and self.connected and self.last_connect and not self.is_playing_fnc:
if (not self.file or not self.file.cursor) and self.timeout and self.connected and self.last_connect and not self.isPlaying_fnc:
if time.time() - self.last_connect - 1 > self.timeout:
self.stop()
@@ -124,11 +124,11 @@ class Client(object):
for match in r_video.finditer(m3u8_original):
line = match.groups()[0]
res = match.groups()[1]
video_url = "/video/" + res + ".m3u8"
videoUrl = "/video/" + res + ".m3u8"
# logger.info('replace', match.groups(), line, res, video_url)
# logger.info('replace', match.groups(), line, res, videoUrl)
m3u8_original = m3u8_original.replace( line, video_url )
m3u8_original = m3u8_original.replace( line, videoUrl )
for match in r_audio.finditer(m3u8_original):
@@ -146,10 +146,10 @@ class Client(object):
# m_audio = re.search(r'\.\/audio\/(\d+k)\/playlist.m3u8', m3u8_original)
# self._audio_res = m_audio.group(1)
# video_url = "/video/" + self._video_res + ".m3u8"
# videoUrl = "/video/" + self._video_res + ".m3u8"
# audio_url = "/audio/" + self._audio_res + ".m3u8"
# m3u8_original = m3u8_original.replace( m_video.group(0), video_url )
# m3u8_original = m3u8_original.replace( m_video.group(0), videoUrl )
# m3u8_original = m3u8_original.replace( m_audio.group(0), audio_url )
return m3u8_original
+1 -1
View File
@@ -427,7 +427,7 @@ class PyOpenSSLContext(object):
@options.setter
def options(self, value):
self._options = value
self._ctx.set_options(value)
self._ctx.setOptions(value)
@property
def verify_mode(self):