proxytranslate in updateDomains e timeout di 60 secondi nei test

This commit is contained in:
mac12m99
2021-01-31 20:30:17 +01:00
parent e0fcc9c11c
commit feaf9fb826
5 changed files with 18 additions and 5 deletions

View File

@@ -18,6 +18,7 @@ jobs:
- name: Update domains
run: |
pip install sakee
python tools/updateDomains.py
- name: Commit & Push changes

View File

@@ -18,8 +18,7 @@
"dreamsub": "https://dreamsub.stream",
"dsda": "https://www.dsda.press",
"eurostreaming": "https://eurostreaming.chat",
"fastsubita": "https://fastsubita.xyz",
"filmgratis": "https://www.filmaltadefinizione.me",
"filmgratis": "https://www.filmaltadefinizione.me",
"filmigratis": "https://filmigratis.org",
"filmsenzalimiticc": "https://www.filmsenzalimiti01.fun",
"filmstreaming01": "https://filmstreaming01.com",

View File

@@ -6,7 +6,6 @@ import sys
# Appends the main plugin dir to the PYTHONPATH if an internal package cannot be imported.
# Examples: In Plex Media Server all modules are under "Code.*" package, and in Enigma2 under "Plugins.Extensions.*"
try:
# from core import logger
import core
except:
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))

View File

@@ -7,7 +7,6 @@
# export KOD_TST_CH=channel
# python tests/test_generic.py
import html
import json
import os
import sys
import unittest
@@ -49,10 +48,13 @@ sys.path.insert(0, librerias)
from core.support import typo
from core.item import Item
from core.httptools import downloadpage
from core import servertools
from core import servertools, httptools
import channelselector
import re
httptools.HTTPTOOLS_DEFAULT_DOWNLOAD_TIMEOUT = 60
outDir = os.path.join(os.getcwd(), 'reports')
validUrlRegex = re.compile(
r'^(?:http|ftp)s?://' # http:// or https://

View File

@@ -61,6 +61,18 @@ if __name__ == '__main__':
if rslt['redirect'].endswith('/'):
rslt['redirect'] = rslt['redirect'][:-1]
result[chann] = rslt['redirect']
# cloudflare...
elif rslt['code'] in [429, 503, 403]:
from lib import proxytranslate
import re
print('Cloudflare riconosciuto')
try:
data = proxytranslate.process_request_proxy(host).get('data', '')
result[chann] = re.search('<base href="([^"]+)', data).group(1)
except Exception as e:
import traceback
traceback.print_last()
# non-existent site
elif rslt['code'] == -2:
print('Host Sconosciuto - '+ str(rslt['code']) +' - '+ host)