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",
"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",
+3 -9
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
+3 -7
View File
@@ -298,7 +298,7 @@ def channel_search(item):
def get_channel_results(ch, item):
max_results = 10
results = list()
try:
ch_params = channeltools.get_channel_parameters(ch)
module = __import__('channels.%s' % ch_params["channel"], fromlist=["channels.%s" % ch_params["channel"]])
@@ -307,15 +307,9 @@ def get_channel_results(ch, item):
if search_action:
for search_ in search_action:
try:
results.extend(module.search(search_, item.text))
except:
pass
else:
try:
results.extend(module.search(item, item.text))
except:
pass
if len(results) < 0 and len(results) < max_results and item.mode != 'all':
@@ -326,6 +320,8 @@ def get_channel_results(ch, item):
results = get_info(results)
return [ch, results]
except:
return [ch, results]
def get_info(itemlist):