fix findhost popcornstream e try except nella ricerca

This commit is contained in:
marco
2020-05-13 14:34:05 +02:00
parent a5b0ce0974
commit 886940f46d
3 changed files with 19 additions and 30 deletions
-1
View File
@@ -37,7 +37,6 @@
"serietvonline": "https://serietvonline.host", "serietvonline": "https://serietvonline.host",
"serietvsubita": "http://serietvsubita.xyz", "serietvsubita": "http://serietvsubita.xyz",
"serietvu": "https://www.serietvu.link", "serietvu": "https://www.serietvu.link",
"streamingaltadefinizione": "https://www.popcornstream.press",
"streamtime": "https://t.me/s/StreamTime", "streamtime": "https://t.me/s/StreamTime",
"tantifilm": "https://www.tantifilm.pizza", "tantifilm": "https://www.tantifilm.pizza",
"toonitalia": "https://toonitalia.org", "toonitalia": "https://toonitalia.org",
+3 -9
View File
@@ -12,16 +12,10 @@ list_servers = ['verystream', 'openload', 'wstream']
list_quality = ['1080p', 'HD', 'DVDRIP', 'SD', 'CAM'] list_quality = ['1080p', 'HD', 'DVDRIP', 'SD', 'CAM']
def findhost(): def findhost():
permUrl = httptools.downloadpage('https://www.popcornstream.info', follow_redirects=False, only_headers=True).headers data = httptools.downloadpage('https://www.popcornstream-nuovo-indirizzo.online/').data
if 'google' in permUrl['location']: return support.scrapertools.find_single_match(data, '<a href="([^"]+)')
host = permUrl['location'].replace('https://www.google.it/search?q=site:', '')
if host[:4] != 'http':
host = 'https://'+permUrl['location'].replace('https://www.google.it/search?q=site:', '')
else:
host = permUrl['location']
return host
host = config.get_channel_url() host = config.get_channel_url(findhost)
headers = [['Referer', host]] headers = [['Referer', host]]
@support.menu @support.menu
+16 -20
View File
@@ -298,34 +298,30 @@ def channel_search(item):
def get_channel_results(ch, item): def get_channel_results(ch, item):
max_results = 10 max_results = 10
results = list() results = list()
try:
ch_params = channeltools.get_channel_parameters(ch)
ch_params = channeltools.get_channel_parameters(ch) module = __import__('channels.%s' % ch_params["channel"], fromlist=["channels.%s" % ch_params["channel"]])
mainlist = getattr(module, 'mainlist')(Item(channel=ch_params["channel"]))
search_action = [elem for elem in mainlist if elem.action == "search" and (item.mode == 'all' or elem.contentType == item.mode)]
module = __import__('channels.%s' % ch_params["channel"], fromlist=["channels.%s" % ch_params["channel"]]) if search_action:
mainlist = getattr(module, 'mainlist')(Item(channel=ch_params["channel"])) for search_ in search_action:
search_action = [elem for elem in mainlist if elem.action == "search" and (item.mode == 'all' or elem.contentType == item.mode)]
if search_action:
for search_ in search_action:
try:
results.extend(module.search(search_, item.text)) results.extend(module.search(search_, item.text))
except: else:
pass
else:
try:
results.extend(module.search(item, item.text)) results.extend(module.search(item, item.text))
except:
pass
if len(results) < 0 and len(results) < max_results and item.mode != 'all': if len(results) < 0 and len(results) < max_results and item.mode != 'all':
if len(results) == 1: if len(results) == 1:
if not results[0].action or config.get_localized_string(30992).lower() in results[0].title.lower(): if not results[0].action or config.get_localized_string(30992).lower() in results[0].title.lower():
return [ch, []] return [ch, []]
results = get_info(results) results = get_info(results)
return [ch, results] return [ch, results]
except:
return [ch, results]
def get_info(itemlist): def get_info(itemlist):