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

View File

@@ -37,7 +37,6 @@
"serietvonline": "https://serietvonline.host",
"serietvsubita": "http://serietvsubita.xyz",
"serietvu": "https://www.serietvu.link",
"streamingaltadefinizione": "https://www.popcornstream.press",
"streamtime": "https://t.me/s/StreamTime",
"tantifilm": "https://www.tantifilm.pizza",
"toonitalia": "https://toonitalia.org",

View File

@@ -12,16 +12,10 @@ list_servers = ['verystream', 'openload', 'wstream']
list_quality = ['1080p', 'HD', 'DVDRIP', 'SD', 'CAM']
def findhost():
permUrl = httptools.downloadpage('https://www.popcornstream.info', follow_redirects=False, only_headers=True).headers
if 'google' in permUrl['location']:
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
data = httptools.downloadpage('https://www.popcornstream-nuovo-indirizzo.online/').data
return support.scrapertools.find_single_match(data, '<a href="([^"]+)')
host = config.get_channel_url()
host = config.get_channel_url(findhost)
headers = [['Referer', host]]
@support.menu

View File

@@ -298,34 +298,30 @@ def channel_search(item):
def get_channel_results(ch, item):
max_results = 10
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"]])
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)]
if search_action:
for search_ in search_action:
try:
if search_action:
for search_ in search_action:
results.extend(module.search(search_, item.text))
except:
pass
else:
try:
else:
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 not results[0].action or config.get_localized_string(30992).lower() in results[0].title.lower():
return [ch, []]
if len(results) == 1:
if not results[0].action or config.get_localized_string(30992).lower() in results[0].title.lower():
return [ch, []]
results = get_info(results)
results = get_info(results)
return [ch, results]
return [ch, results]
except:
return [ch, results]
def get_info(itemlist):