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
+1
View File
@@ -18,6 +18,7 @@ jobs:
- name: Update domains - name: Update domains
run: | run: |
pip install sakee
python tools/updateDomains.py python tools/updateDomains.py
- name: Commit & Push changes - name: Commit & Push changes
-1
View File
@@ -18,7 +18,6 @@
"dreamsub": "https://dreamsub.stream", "dreamsub": "https://dreamsub.stream",
"dsda": "https://www.dsda.press", "dsda": "https://www.dsda.press",
"eurostreaming": "https://eurostreaming.chat", "eurostreaming": "https://eurostreaming.chat",
"fastsubita": "https://fastsubita.xyz",
"filmgratis": "https://www.filmaltadefinizione.me", "filmgratis": "https://www.filmaltadefinizione.me",
"filmigratis": "https://filmigratis.org", "filmigratis": "https://filmigratis.org",
"filmsenzalimiticc": "https://www.filmsenzalimiti01.fun", "filmsenzalimiticc": "https://www.filmsenzalimiti01.fun",
-1
View File
@@ -6,7 +6,6 @@ import sys
# Appends the main plugin dir to the PYTHONPATH if an internal package cannot be imported. # 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.*" # Examples: In Plex Media Server all modules are under "Code.*" package, and in Enigma2 under "Plugins.Extensions.*"
try: try:
# from core import logger
import core import core
except: except:
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
+4 -2
View File
@@ -7,7 +7,6 @@
# export KOD_TST_CH=channel # export KOD_TST_CH=channel
# python tests/test_generic.py # python tests/test_generic.py
import html import html
import json
import os import os
import sys import sys
import unittest import unittest
@@ -49,10 +48,13 @@ sys.path.insert(0, librerias)
from core.support import typo from core.support import typo
from core.item import Item from core.item import Item
from core.httptools import downloadpage from core.httptools import downloadpage
from core import servertools from core import servertools, httptools
import channelselector import channelselector
import re import re
httptools.HTTPTOOLS_DEFAULT_DOWNLOAD_TIMEOUT = 60
outDir = os.path.join(os.getcwd(), 'reports') outDir = os.path.join(os.getcwd(), 'reports')
validUrlRegex = re.compile( validUrlRegex = re.compile(
r'^(?:http|ftp)s?://' # http:// or https:// r'^(?:http|ftp)s?://' # http:// or https://
+12
View File
@@ -61,6 +61,18 @@ if __name__ == '__main__':
if rslt['redirect'].endswith('/'): if rslt['redirect'].endswith('/'):
rslt['redirect'] = rslt['redirect'][:-1] rslt['redirect'] = rslt['redirect'][:-1]
result[chann] = rslt['redirect'] 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 # non-existent site
elif rslt['code'] == -2: elif rslt['code'] == -2:
print('Host Sconosciuto - '+ str(rslt['code']) +' - '+ host) print('Host Sconosciuto - '+ str(rslt['code']) +' - '+ host)