From ff5f40b9660d1c86f7d9a7ae62d008c53f8efd3a Mon Sep 17 00:00:00 2001
From: mac12m99 <10120390+mac12m99@users.noreply.github.com>
Date: Sun, 25 Apr 2021 11:47:16 +0200
Subject: [PATCH] Fix proxytranslate, migliorie varie
---
channels/cb01anime.py | 4 ++--
core/filetools.py | 12 ++++++------
lib/proxytranslate.py | 10 +++++-----
specials/globalsearch.py | 3 ++-
4 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/channels/cb01anime.py b/channels/cb01anime.py
index 9258bb02..7595a15a 100644
--- a/channels/cb01anime.py
+++ b/channels/cb01anime.py
@@ -36,7 +36,7 @@ def menu(item):
def search(item, texto):
support.info(texto)
- item.url = host + "/?s=" + texto
+ item.url = host + "/search/" + texto
try:
return peliculas(item)
except:
@@ -72,7 +72,7 @@ def peliculas(item):
if item.args == 'newest':
patron = r'
\s*
\s*- \s*]+>
]+src="(?P[^"]+)"[^>]*>(?:[^>]+>){4}(?P[^\[]+)\[(?P[^\]]+)\]'
else:
- patron = r'\s*
]+><\/a>(?:[^>]+>){7}\s*(?P[^<\[]+)(?:\[(?P[^\]]+)\])?
.*?-->(?:.*?
)?\s*(?P
[^<]+)'
+ patron = r'\s*
]+><\/a>(?:[^>]+>){7}\s*(?P[^<\[]+)(?:\[(?P[^\]]+)\])?
.*?-->(?:.*?
)?\s*(?P
[^<]+)'
patronNext = r'\s]+)', r' \1="\2"', data)
data = re.sub('https://translate\.googleusercontent\.com/.*?u=(.*?)&usg=[A-Za-z0-9_-]+', '\\1', data)
- data = re.sub('https?://[a-zA-Z0-9]+--' + domain.replace('.', '-') + '\.translate\.goog(/[a-zA-Z0-9#/-]+)', 'https://' + domain + '\\1', data)
+ data = re.sub('https?://[a-zA-Z0-9-]+' + domain.replace('.', '-') + '\.translate\.goog(/[a-zA-Z0-9#/-]+)', 'https://' + domain + '\\1', data)
data = re.sub('\s+<', '<', data)
- data = data.replace('&', '&').replace('https://translate.google.com/website?sl=' + SL + '&tl=' + TL + '&u=', '')
+ data = data.replace('&', '&').replace('https://translate.google.com/website?sl=' + SL + '&tl=' + TL + '&ajax=1&u=', '')
return {'url': url.strip(), 'result': result, 'data': data}
except Exception as e:
diff --git a/specials/globalsearch.py b/specials/globalsearch.py
index 2eef627f..45ce3842 100644
--- a/specials/globalsearch.py
+++ b/specials/globalsearch.py
@@ -349,7 +349,8 @@ class SearchWindow(xbmcgui.WindowXML):
logger.debug('retring with original title on channel ' + channel)
dummy, valid, dummy = search(self.item.infoLabels.get('originaltitle'))
except:
- pass
+ import traceback
+ logger.error(traceback.format_exc())
self.count += 1
return self.update(channel, valid, other if other else results)