-Nuova Ricerca Globale\n-Nuova Rinumerazione\n-Messaggi di Errore più chiari\n-Fix var\n
This commit is contained in:
marco
2020-12-01 20:19:07 +01:00
parent 97e06a8b84
commit 94eac40955
233 changed files with 4568 additions and 2245 deletions
+4 -4
View File
@@ -27,7 +27,7 @@ class ChromeOSImage:
"""
def __init__(self, imgpath):
logger.info('Image Path: ' + imgpath)
logger.debug('Image Path: ' + imgpath)
"""Prepares the image"""
self.imgpath = imgpath
self.bstream = self.get_bstream(imgpath)
@@ -59,7 +59,7 @@ class ChromeOSImage:
self.seek_stream(entries_start * lba_size)
if not calcsize(part_format) == entry_size:
logger.info('Partition table entries are not 128 bytes long')
logger.debug('Partition table entries are not 128 bytes long')
return 0
for index in range(1, entries_num + 1): # pylint: disable=unused-variable
@@ -71,7 +71,7 @@ class ChromeOSImage:
break
if not offset:
logger.info('Failed to calculate losetup offset.')
logger.debug('Failed to calculate losetup offset.')
return 0
return offset
@@ -93,7 +93,7 @@ class ChromeOSImage:
while True:
chunk2 = self.read_stream(chunksize)
if not chunk2:
logger.info('File %s not found in the ChromeOS image' % filename)
logger.debug('File %s not found in the ChromeOS image' % filename)
return False
chunk = chunk1 + chunk2
+1 -1
View File
@@ -47,7 +47,7 @@ def query(name, type='A', server=DOH_SERVER, path="/dns-query", fallback=True):
else:
retval = []
except Exception as ex:
logger.info("Exception occurred: '%s'" % ex)
logger.error("Exception occurred: '%s'" % ex)
if retval is None and fallback:
if type == 'A':
+17 -16
View File
@@ -25,7 +25,7 @@ intervenido_sucuri = 'Access Denied - Sucuri Website Firewall'
def update_title(item):
logger.info()
logger.debug()
from core import scraper,support
@@ -41,7 +41,7 @@ def update_title(item):
The channel must add a method to be able to receive the call from Kodi / Alfa, and be able to call this method:
def actualizar_titulos(item):
logger.info()
logger.debug()
itemlist = []
from lib import generictools
from platformcode import launcher
@@ -129,7 +129,8 @@ def update_title(item):
scraper_return = scraper.find_and_set_infoLabels(item)
if not scraper_return: # If the user has canceled, we restore the data to the initial situation and leave
item = new_item.clone()
return
# item = new_item.clone()
else:
# If the user has changed the data in "Complete Information" you must see the final title in TMDB
if not item.infoLabels['tmdb_id']:
@@ -205,7 +206,7 @@ def update_title(item):
def refresh_screen(item):
logger.info()
logger.debug()
"""
#### Kodi 18 compatibility ####
@@ -239,7 +240,7 @@ def refresh_screen(item):
def post_tmdb_listado(item, itemlist):
logger.info()
logger.debug()
itemlist_fo = []
"""
@@ -484,7 +485,7 @@ def post_tmdb_listado(item, itemlist):
def post_tmdb_seasons(item, itemlist):
logger.info()
logger.debug()
"""
@@ -644,7 +645,7 @@ def post_tmdb_seasons(item, itemlist):
def post_tmdb_episodios(item, itemlist):
logger.info()
logger.debug()
itemlist_fo = []
"""
@@ -995,7 +996,7 @@ def post_tmdb_episodios(item, itemlist):
def post_tmdb_findvideos(item, itemlist):
logger.info()
logger.debug()
"""
@@ -1215,7 +1216,7 @@ def post_tmdb_findvideos(item, itemlist):
def get_field_from_kodi_DB(item, from_fields='*', files='file'):
logger.info()
logger.debug()
"""
Call to read from the Kodi DB the input fields received (from_fields, by default "*") of the video indicated in Item
@@ -1293,7 +1294,7 @@ def get_field_from_kodi_DB(item, from_fields='*', files='file'):
def fail_over_newpct1(item, patron, patron2=None, timeout=None):
logger.info()
logger.debug()
import ast
"""
@@ -1494,7 +1495,7 @@ def fail_over_newpct1(item, patron, patron2=None, timeout=None):
def web_intervenida(item, data, desactivar=True):
logger.info()
logger.debug()
"""
@@ -1577,7 +1578,7 @@ def web_intervenida(item, data, desactivar=True):
def regenerate_clones():
logger.info()
logger.debug()
import json
from core import videolibrarytools
@@ -1591,7 +1592,7 @@ def regenerate_clones():
# 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'))
if json_path:
logger.info('Previously repaired video library: WE ARE GOING')
logger.debug('Previously repaired video library: WE ARE GOING')
return False
json_path = filetools.join(config.get_runtime_path(), 'verify_cached_torrents.json')
filetools.write(json_path, json.dumps({"CINE_verify": True})) # Prevents another simultaneous process from being launched
@@ -1631,7 +1632,7 @@ def regenerate_clones():
# Delete the Tvshow.nfo files and check if the .nfo has more than one channel and one is clone Newpct1
for file in files:
# logger.info('file - nfos: ' + file)
# logger.debug('file - nfos: ' + file)
if 'tvshow.nfo' in file:
file_path = filetools.join(root, 'tvshow.nfo')
filetools.remove(file_path)
@@ -1697,7 +1698,7 @@ def regenerate_clones():
for file in files:
file_path = filetools.join(root, file)
if '.json' in file:
logger.info('** file: ' + file)
logger.debug('** file: ' + file)
canal_json = scrapertools.find_single_match(file, r'\[(\w+)\].json')
if canal_json not in nfo.library_urls:
filetools.remove(file_path) # we delete the .json is a zombie
@@ -1740,7 +1741,7 @@ def regenerate_clones():
def dejuice(data):
logger.info()
logger.debug()
# Method to unobtrusive JuicyCodes data
import base64
+1 -1
View File
@@ -29,7 +29,7 @@ def website(config):
rebulk = rebulk.regex_defaults(flags=re.IGNORECASE).string_defaults(ignore_case=True)
rebulk.defaults(name="website")
with open(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'tlds-alpha-by-domain.txt')) as tld_file:
with open(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'tlds-alpha-by-domain.txt'), 'rb') as tld_file:
tlds = [
tld.strip().decode('utf-8')
for tld in tld_file.readlines()
+12 -10
View File
@@ -492,7 +492,6 @@ class UnshortenIt(object):
except Exception as e:
return uri, str(e)
def _unshorten_vcrypt(self, uri):
uri = uri.replace('.net', '.pw')
try:
@@ -508,15 +507,15 @@ class UnshortenIt(object):
from Crypto.Cipher import AES
str = str.replace("_ppl_", "+").replace("_eqq_", "=").replace("_sll_", "/")
iv = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
key = "naphajU2usWUswec"
iv = b"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
key = b"naphajU2usWUswec"
decoded = b64decode(str)
decoded = decoded + '\0' * (len(decoded) % 16)
decoded = decoded + b'\0' * (len(decoded) % 16)
crypt_object = AES.new(key, AES.MODE_CBC, iv)
decrypted = ''
decrypted = b''
for p in range(0, len(decoded), 16):
decrypted += crypt_object.decrypt(decoded[p:p + 16]).replace('\0', '')
return decrypted
decrypted += crypt_object.decrypt(decoded[p:p + 16]).replace(b'\0', b'')
return decrypted.decode('ascii')
if 'shield' in uri.split('/')[-2]:
uri = decrypt(uri.split('/')[-1])
else:
@@ -537,7 +536,7 @@ class UnshortenIt(object):
r = httptools.downloadpage(uri, timeout=self._timeout, headers=headers, follow_redirects=False)
if 'Wait 1 hour' in r.data:
uri = ''
logger.info('IP bannato da vcrypt, aspetta un ora')
logger.error('IP bannato da vcrypt, aspetta un ora')
else:
prev_uri = uri
uri = r.headers['location']
@@ -549,7 +548,11 @@ class UnshortenIt(object):
if 'out_generator' in uri:
uri = re.findall('url=(.*)$', uri)[0]
elif '/decode/' in uri:
uri = httptools.downloadpage(uri, follow_redirects=True).url
scheme, netloc, path, query, fragment = urlsplit(uri)
splitted = path.split('/')
splitted[1] = 'outlink'
uri = httptools.downloadpage(scheme + '://' + netloc + "/".join(splitted) + query + fragment, follow_redirects=False,
post={'url': splitted[2]}).headers['location']
# uri = decrypt(uri.split('/')[-1])
return uri, r.code if r else 200
@@ -557,7 +560,6 @@ class UnshortenIt(object):
logger.error(e)
return uri, 0
def _unshorten_linkup(self, uri):
try:
r = None
+3 -11
View File
@@ -1,5 +1,6 @@
import sys
import xbmc
if sys.version_info[0] > 2: from urllib.parse import unquote
else: from urllib2 import unquote
def dec_ei(h):
g = 'MNOPIJKL89+/4567UVWXQRSTEFGHABCDcdefYZabstuvopqr0123wxyzklmnghij'
@@ -7,23 +8,14 @@ def dec_ei(h):
for e in range(0,len(h)):
c.append(g.find(h[e]))
for e in range(len(c)*2-1,-1,-1):
#print 'e=' + str(e)
a = c[e % len(c)] ^ c[(e+1)%len(c)]
#print 'a='+str(a)
c[e%len(c)] = a
#print 'c['+str(e % len(c))+']='+ str(c[e % len(c)])
c = f(c)
d = ''
for e in range(0,len(c)):
d += '%'+ (('0'+ (str(format(c[e],'x'))))[-2:])
# if python 3
if sys.version_info[0] > 2:
import urllib
return urllib.parse.unquote(d)
else:
import urllib2
return urllib2.unquote(d)
return unquote(d)
def f(m):
l = list()