Merge branch 'master' of https://github.com/kodiondemand/addon into master
This commit is contained in:
+1
-1
@@ -29,7 +29,7 @@
|
|||||||
"guardaserieicu": "https://guardaserie.shop",
|
"guardaserieicu": "https://guardaserie.shop",
|
||||||
"hd4me": "https://hd4me.net",
|
"hd4me": "https://hd4me.net",
|
||||||
"ilcorsaronero": "https://ilcorsaronero.link",
|
"ilcorsaronero": "https://ilcorsaronero.link",
|
||||||
"ilgeniodellostreaming": "https://ilgeniodellostreaming.cat",
|
"ilgeniodellostreaming": "https://ilgeniodellostreaming.dev",
|
||||||
"ilgeniodellostreaming_cam": "https://ilgeniodellostreaming.gold",
|
"ilgeniodellostreaming_cam": "https://ilgeniodellostreaming.gold",
|
||||||
"italiaserie": "https://italiaserie.top",
|
"italiaserie": "https://italiaserie.top",
|
||||||
"mediasetplay": "https://www.mediasetplay.mediaset.it",
|
"mediasetplay": "https://www.mediasetplay.mediaset.it",
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ from platformcode import config
|
|||||||
|
|
||||||
def findhost(url):
|
def findhost(url):
|
||||||
data = support.httptools.downloadpage(url).data
|
data = support.httptools.downloadpage(url).data
|
||||||
host = support.scrapertools.find_single_match(data, '<div class="elementor-button-wrapper"> <a href="([^"]+)"')
|
host = support.scrapertools.find_single_match(data, '<div class="elementor-button-wrapper">\s*<a href="([^"]+)"')
|
||||||
return host
|
return host
|
||||||
|
|
||||||
host = config.get_channel_url(findhost)
|
host = config.get_channel_url(findhost)
|
||||||
|
|||||||
+1
-1
@@ -418,7 +418,7 @@ def downloadpage(url, **opt):
|
|||||||
response['data'] = response['data'].decode('ISO-8859-1')
|
response['data'] = response['data'].decode('ISO-8859-1')
|
||||||
|
|
||||||
if req.headers.get('Server', '').startswith('cloudflare') and response_code in [429, 503, 403]\
|
if req.headers.get('Server', '').startswith('cloudflare') and response_code in [429, 503, 403]\
|
||||||
and not opt.get('CF', False) and 'Ray ID' in response['data']:
|
and not opt.get('CF', False) and 'Ray ID' in response['data'] and not opt.get('post', None):
|
||||||
logger.debug("CF retry... for domain: %s" % domain)
|
logger.debug("CF retry... for domain: %s" % domain)
|
||||||
from lib import proxytranslate
|
from lib import proxytranslate
|
||||||
gResp = proxytranslate.process_request_proxy(url)
|
gResp = proxytranslate.process_request_proxy(url)
|
||||||
|
|||||||
@@ -21,9 +21,11 @@ HEADERS = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MAX_CONECTION_THREAD = 10
|
MAX_CONECTION_THREAD = 10
|
||||||
|
SL = 'en'
|
||||||
|
TL = 'it'
|
||||||
|
|
||||||
BASE_URL_PROXY = 'https://translate.googleusercontent.com'
|
BASE_URL_PROXY = 'https://translate.googleusercontent.com'
|
||||||
BASE_URL_TRANSLATE = 'https://translate.google.com/translate?hl=it&sl=en&tl=it&u=[TARGET_URL]&sandbox=0' # noqa: E501
|
BASE_URL_TRANSLATE = 'https://translate.google.com/translate?hl=it&sl=' + SL + '&tl=' + TL + '&u=[TARGET_URL]&sandbox=0' # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
def checker_url(html, url):
|
def checker_url(html, url):
|
||||||
@@ -52,7 +54,7 @@ def process_request_proxy(url):
|
|||||||
|
|
||||||
url_request = checker_url(
|
url_request = checker_url(
|
||||||
return_html.text,
|
return_html.text,
|
||||||
BASE_URL_PROXY + '/translate_p?hl=it&sl=en&tl=it&u='
|
BASE_URL_PROXY + '/translate_p?hl=it&sl=' + SL + '&tl=' + TL + '&u='
|
||||||
)
|
)
|
||||||
|
|
||||||
logger.debug(url_request)
|
logger.debug(url_request)
|
||||||
@@ -85,7 +87,9 @@ def process_request_proxy(url):
|
|||||||
data = re.sub('\s(\w+)=(?!")([^<>\s]+)', r' \1="\2"', data)
|
data = re.sub('\s(\w+)=(?!")([^<>\s]+)', r' \1="\2"', data)
|
||||||
data = re.sub('https://translate\.googleusercontent\.com/.*?u=(.*?)&usg=[A-Za-z0-9_-]+', '\\1', 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=', '')
|
||||||
|
|
||||||
return {'url': url.strip(), 'result': result, 'data': data.replace('&', '&')}
|
return {'url': url.strip(), 'result': result, 'data': data}
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(e)
|
logger.error(e)
|
||||||
|
|||||||
@@ -180,8 +180,6 @@ for chItem in channel_list:
|
|||||||
|
|
||||||
itemlist = getattr(module, it.action)(it)
|
itemlist = getattr(module, it.action)(it)
|
||||||
menuItemlist[it.title] = itemlist
|
menuItemlist[it.title] = itemlist
|
||||||
logMenu[it.title] = logger.recordedLog
|
|
||||||
logger.recordedLog = ''
|
|
||||||
|
|
||||||
# some sites might have no link inside, but if all results are without servers, there's something wrong
|
# some sites might have no link inside, but if all results are without servers, there's something wrong
|
||||||
for resIt in itemlist:
|
for resIt in itemlist:
|
||||||
@@ -207,8 +205,9 @@ for chItem in channel_list:
|
|||||||
except:
|
except:
|
||||||
import traceback
|
import traceback
|
||||||
logger.error(traceback.format_exc())
|
logger.error(traceback.format_exc())
|
||||||
logMenu[it.title] = logger.recordedLog
|
|
||||||
logger.recordedLog = ''
|
logMenu[it.title] = logger.recordedLog
|
||||||
|
logger.recordedLog = ''
|
||||||
|
|
||||||
results.append(
|
results.append(
|
||||||
{'ch': ch, 'hasChannelConfig': hasChannelConfig, 'mainlist': [it.title for it in mainlist],
|
{'ch': ch, 'hasChannelConfig': hasChannelConfig, 'mainlist': [it.title for it in mainlist],
|
||||||
|
|||||||
Reference in New Issue
Block a user