From feaf9fb826a5f8afb947c82c00acc073edd43706 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Sun, 31 Jan 2021 20:30:17 +0100 Subject: [PATCH] proxytranslate in updateDomains e timeout di 60 secondi nei test --- .github/workflows/updateDomains.yml | 1 + channels.json | 3 +-- core/__init__.py | 1 - tests/test_generic.py | 6 ++++-- tools/updateDomains.py | 12 ++++++++++++ 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/updateDomains.yml b/.github/workflows/updateDomains.yml index 6117241b..e756c4ae 100644 --- a/.github/workflows/updateDomains.yml +++ b/.github/workflows/updateDomains.yml @@ -18,6 +18,7 @@ jobs: - name: Update domains run: | + pip install sakee python tools/updateDomains.py - name: Commit & Push changes diff --git a/channels.json b/channels.json index 5f977d90..9527741b 100644 --- a/channels.json +++ b/channels.json @@ -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", diff --git a/core/__init__.py b/core/__init__.py index 45eea1c5..33193ae1 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -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__), ".."))) diff --git a/tests/test_generic.py b/tests/test_generic.py index 8718e158..e678e44c 100644 --- a/tests/test_generic.py +++ b/tests/test_generic.py @@ -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:// diff --git a/tools/updateDomains.py b/tools/updateDomains.py index 98d1b0b4..1e8b5560 100644 --- a/tools/updateDomains.py +++ b/tools/updateDomains.py @@ -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('