This commit is contained in:
Alhaziel01
2021-04-26 15:42:59 +02:00
7 changed files with 60 additions and 50 deletions
+3 -3
View File
@@ -12,7 +12,7 @@
"casacinema": "https://www.casacinema.page",
"cb01anime": "https://www.cineblog01.red",
"cineblog01": "https://cb01.uno",
"cinemalibero": "https://cinemalibero.work",
"cinemalibero": "https://cinemalibero.shop",
"cinetecadibologna": "http://cinestore.cinetecadibologna.it",
"discoveryplus": "https://www.discoveryplus.com",
"dreamsub": "https://dreamsub.stream",
@@ -21,14 +21,14 @@
"filmigratis": "https://filmigratis.org",
"guardaseriecam": "https://guardaserie.cam",
"guardaserieclick": "https://www.guardaserie.review",
"guardaserieicu": "https://guardaserie.download",
"guardaserieicu": "https://guardaserie.win",
"hd4me": "https://hd4me.net",
"ilcorsaronero": "https://ilcorsaronero.link",
"ilgeniodellostreaming": "https://ilgeniodellostreaming.vet",
"ilgeniodellostreaming_cam": "https://ilgeniodellostreaming.bond",
"italiaserie": "https://italiaserie.pw",
"mediasetplay": "https://www.mediasetplay.mediaset.it",
"mondoserietv": "https://mondoserietv.fun",
"mondoserietv": "https://mondoserietv.club",
"paramount": "https://www.paramountnetwork.it",
"piratestreaming": "https://www.piratestreaming.review",
"polpotv": "https://roma.polpo.tv",
+2 -2
View File
@@ -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'<div id="blockvids">\s*<ul>\s*<li>\s*<a href="(?P<url>[^"]+)"[^>]+><img[^>]+src="(?P<thumb>[^"]+)"[^>]*>(?:[^>]+>){4}(?P<title>[^\[]+)\[(?P<lang>[^\]]+)\]'
else:
patron = r'<div class="span4">\s*<a href="(?P<url>[^"]+)"><img src="(?P<thumb>[^"]+)"[^>]+><\/a>(?:[^>]+>){7}\s*<h1>(?P<title>[^<\[]+)(?:\[(?P<lang>[^\]]+)\])?</h1></a>.*?-->(?:.*?<br />)?\s*(?P<plot>[^<]+)'
patron = r'<div class="span4">\s*<a href="(?P<url>[^"]+)"><img src="(?P<thumb>[^"]+)"[^>]+><\/a>(?:[^>]+>){7}\s*<h1>(?P<title>[^<\[]+)(?:\[(?P<lang>[^\]]+)\])?</h1></a>.*?-->(?:.*?<br(?: /)?>)?\s*(?P<plot>[^<]+)'
patronNext = r'<link rel="next" href="([^"]+)"'
action = 'check'
return locals()
+1 -1
View File
@@ -36,7 +36,7 @@ def search(item, text):
else:
action = 'episodios'
item.args = 'search'
item.url = host + "/?s=" + text
item.url = host + "?a=b&s=" + text
try:
return peliculas(item)
# Continua la ricerca in caso di errore .
+2 -2
View File
@@ -27,7 +27,7 @@ def search(item, text):
support.info(text)
# item.args='search'
item.text = text
item.url = item.url + '/?%73=' + text.replace(' ', '+')
item.url = item.url + '/?a=b&s=' + text.replace(' ', '+')
try:
return peliculas(item)
@@ -69,7 +69,7 @@ def peliculas(item):
#patronBlock = '"lcp_catlist"[^>]+>(?P<block>.*)</ul>'
patronBlock = '<main[^>]+>(?P<block>.*?)</ma'
#patron = r'href="(?P<url>[^"]+)" title="(?P<title>[^"]+)"'
patron = r'<a href="(?P<url>[^"]+)"[^>]*>(?P<title>[^<]+)<[^>]+>[^>]+><div'
patron = r'<a href="(?P<url>[^"]+)"[^>]*>(?P<title>[^<]+)<[^>]+>[^>]+>\s*<div'
elif item.args == 'last':
patronBlock = 'Aggiornamenti</h2>(?P<block>.*)</ul>'
patron = r'<a href="(?P<url>[^"]+)">\s*<img[^>]+src[set]{0,3}="(?P<thumbnail>[^ ]+)[^>]+>\s*<span[^>]+>(?P<title>[^<]+)'
+6 -6
View File
@@ -86,15 +86,15 @@ def encode(path, _samba=False):
@rtype: str
@return path encoded in system character set or utf-8 if samba
"""
# from core.support import dbg;dbg()
if not isinstance(path, unicode):
path = unicode(path, "utf-8", "ignore")
if scrapertools.find_single_match(path, r'(^\w+:\/\/)') or _samba and not PY3:
path = path.encode("utf-8", "ignore")
else:
if fs_encoding and not PY3:
path = path.encode(fs_encoding, "ignore")
if not PY3:
if scrapertools.find_single_match(path, r'(^\w+:\/\/)') or _samba:
path = path.encode("utf-8", "ignore")
else:
if fs_encoding:
path = path.encode(fs_encoding, "ignore")
# if PY3 and isinstance(path, bytes):
# if fs_encoding:
+5 -5
View File
@@ -88,20 +88,20 @@ def process_request_proxy(url):
time.sleep(0.5)
result = requests.get(
url_request_proxy,
timeout=20,
headers={'User-Agent': 'android'}
timeout=20
# headers={'User-Agent': 'android'}
)
data = result.content.decode('utf-8', 'ignore')
if not PY3:
data = data.encode('utf-8')
if logger:
logger.debug()
logger.debug(url_request_proxy)
data = re.sub('\s(\w+)=(?!")([^<>\s]+)', r' \1="\2"', data)
data = re.sub('https://translate\.googleusercontent\.com/.*?u=(.*?)&amp;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('&amp;', '&').replace('https://translate.google.com/website?sl=' + SL + '&tl=' + TL + '&u=', '')
data = data.replace('&amp;', '&').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:
+41 -31
View File
@@ -72,7 +72,7 @@ EPISODESLIST = 200
SERVERLIST = 300
class SearchWindow(xbmcgui.WindowXML):
def start(self, item, moduleDict={}, searchActions=[]):
def start(self, item, moduleDict={}, searchActions=[], thActions=None):
logger.debug()
self.exit = False
self.item = item
@@ -89,12 +89,13 @@ class SearchWindow(xbmcgui.WindowXML):
self.selected = False
self.pos = 0
self.items = []
self.search_threads = []
if not searchActions:
self.thActions = Thread(target=self.getActions)
self.thActions.start()
else:
self.thActions = None
self.thActions = thActions
self.lastSearch()
if not self.item.text: return
@@ -292,7 +293,23 @@ class SearchWindow(xbmcgui.WindowXML):
def timer(self):
while self.searchActions:
self.COUNT.setText('%s/%s [%s"]' % (self.count, len(self.searchActions), int(time.time() - self.time) ))
percent = (float(self.count) / len(self.searchActions)) * 100
self.LOADING.setVisible(False)
self.PROGRESS.setPercent(percent)
self.COUNT.setText('%s/%s [%s"]' % (self.count, len(self.searchActions), int(time.time() - self.time)))
if percent == 100:
self.channels = []
self.moduleDict = {}
self.searchActions = []
# if no results
total = 0
for num in self.results.values():
total += num
if not total:
self.PROGRESS.setVisible(False)
self.NORESULTS.setVisible(True)
self.setFocusId(CLOSE)
time.sleep(1)
def search(self):
@@ -303,11 +320,21 @@ class SearchWindow(xbmcgui.WindowXML):
self.thActions.join()
Thread(target=self.timer).start()
with futures.ThreadPoolExecutor(max_workers=set_workers()) as executor:
for searchAction in self.searchActions:
if self.exit: return
executor.submit(self.get_channel_results, searchAction)
logger.debug('end search for:', searchAction.channel)
try:
with futures.ThreadPoolExecutor(max_workers=set_workers()) as executor:
for searchAction in self.searchActions:
if self.exit: return
self.search_threads.append(executor.submit(self.get_channel_results, searchAction))
for ch in futures.as_completed(self.search_threads):
if self.exit: return
if ch.result():
self.count += 1
channel, valid, other = ch.result()
self.update(channel, valid, other)
except:
import traceback
logger.error(traceback.format_exc())
self.count = len(self.searchActions)
def get_channel_results(self, searchAction):
def search(text):
@@ -348,13 +375,12 @@ class SearchWindow(xbmcgui.WindowXML):
if self.item.mode != 'all' and not valid and self.item.infoLabels.get('originaltitle'):
logger.debug('retring with original title on channel ' + channel)
dummy, valid, dummy = search(self.item.infoLabels.get('originaltitle'))
self.count += 1
return self.update(channel, valid, other if other else results)
except:
import traceback
logger.error(traceback.format_exc())
return channel, valid, other if other else results
def makeItem(self, url):
item = Item().fromurl(url)
channelParams = channeltools.get_channel_parameters(item.channel)
@@ -441,24 +467,6 @@ class SearchWindow(xbmcgui.WindowXML):
self.RESULTS.reset()
self.RESULTS.addItems(items)
percent = (float(self.count) / len(self.searchActions)) * 100
self.LOADING.setVisible(False)
self.PROGRESS.setPercent(percent)
self.COUNT.setText('%s/%s [%s"]' % (self.count, len(self.searchActions), int(time.time() - self.time) ))
if percent == 100:
self.channels = []
self.moduleDict = {}
self.searchActions = []
# if no results
total = 0
for num in self.results.values():
total += num
if not total:
self.PROGRESS.setVisible(False)
self.NORESULTS.setVisible(True)
self.setFocusId(CLOSE)
def onInit(self):
self.time = time.time()
@@ -596,7 +604,7 @@ class SearchWindow(xbmcgui.WindowXML):
self.actors()
elif search == 'persons':
item = self.item.clone(mode='person_', discovery=self.persons[pos])
Search(item, self.moduleDict, self.searchActions)
Search(item, self.moduleDict, self.searchActions, self.thActions)
if close_action:
self.close()
else:
@@ -604,7 +612,7 @@ class SearchWindow(xbmcgui.WindowXML):
if self.item.mode == 'movie': item.contentTitle = self.RESULTS.getSelectedItem().getLabel()
else: item.contentSerieName = self.RESULTS.getSelectedItem().getLabel()
Search(item, self.moduleDict, self.searchActions)
Search(item, self.moduleDict, self.searchActions, self.thActions)
if close_action:
self.close()
@@ -738,6 +746,8 @@ class SearchWindow(xbmcgui.WindowXML):
self.exit = True
if self.thread:
busy(True)
for th in self.search_threads:
th.cancel()
self.thread.join()
busy(False)
self.close()