diff --git a/.gitignore b/.gitignore index 3797d201..e9de1c0e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ __pycache__/ .vscode/settings.json bin/ lib/abi +tests/home/ +reports/ \ No newline at end of file diff --git a/channels/1337x.json b/channels/1337x.json index 5d712a75..675af194 100644 --- a/channels/1337x.json +++ b/channels/1337x.json @@ -6,6 +6,7 @@ "thumbnail": "1337x.png", "banner": "1337x.png", "categories": ["movie", "tvshow", "torrent"], + "not_active": ["include_in_newest"], "settings": [ { "id": "itaSearch", diff --git a/channels/altadefinizione.json b/channels/altadefinizione.json index 8579ab00..087ed3e1 100644 --- a/channels/altadefinizione.json +++ b/channels/altadefinizione.json @@ -6,5 +6,6 @@ "thumbnail": "altadefinizione.png", "banner": "altadefinizione.png", "categories": ["movie", "tvshow", "vos"], - "settings": [] + "settings": [], + "not_active": ["include_in_newest"] } diff --git a/channels/eurostreaming.py b/channels/eurostreaming.py index 36cbb31b..bfa4f66a 100644 --- a/channels/eurostreaming.py +++ b/channels/eurostreaming.py @@ -84,7 +84,7 @@ def newest(categoria): item.contentType = 'tvshow' item.args = 'newest' try: - item.url = "%s/aggiornamento-nuovi-episodi/" % host + item.url = "%s/aggiornamento-episodi-nuovi/" % host item.action = "peliculas" itemlist = peliculas(item) # Continua la ricerca in caso di errore diff --git a/channels/toonitalia.py b/channels/toonitalia.py index 67bd9fec..bbcd709f 100644 --- a/channels/toonitalia.py +++ b/channels/toonitalia.py @@ -61,7 +61,7 @@ def peliculas(item): # debug = True # search = item.text if item.contentType != 'movie': anime = True - action = 'findvideos' if item.contentType == 'movie' else 'episodios' + action = 'check' blacklist = ['-Film Animazione disponibili in attesa di recensione '] if item.action == 'search': @@ -90,39 +90,25 @@ def peliculas(item): return locals() -def episodios(item): - @support.scrape - def findepisode(item): - actLike = 'episodios' - patron = r'>\s*(?:(?P\d+)(?:×|x|×))?(?P\d+)(?:\s+–\s+)?[ –]+(?P[^<]+)[ –]+.*?)(?:\s*(?:(?P\d+)(?:×|x|×))?(?P\d+)(?:\s+–\s+)?[ –]+(?P[^<]+)[ –]+.*?)(?:= 1 )) then export KOD_TST_CH=$1 fi -python tests/test_generic.py \ No newline at end of file +python3.9 tests/test_generic.py \ No newline at end of file diff --git a/tests/test_generic.py b/tests/test_generic.py index 1705beca..9ff50d3f 100644 --- a/tests/test_generic.py +++ b/tests/test_generic.py @@ -8,7 +8,9 @@ # python tests/test_generic.py import html import os +import random import sys +import time import unittest import xbmc @@ -53,7 +55,7 @@ import channelselector import re -httptools.HTTPTOOLS_DEFAULT_DOWNLOAD_TIMEOUT = 60 +httptools.HTTPTOOLS_DEFAULT_DOWNLOAD_TIMEOUT = 10 outDir = os.path.join(os.getcwd(), 'reports') validUrlRegex = re.compile( @@ -142,6 +144,11 @@ chNumRis = { }, } + +def wait(): + time.sleep(random.randint(1, 3)) + + servers = [] channels = [] @@ -152,6 +159,7 @@ results = [] logger.record = True for chItem in channel_list: ch = chItem.channel + wait() if ch not in chBlackList: hasChannelConfig = False mainlist = [] @@ -171,6 +179,7 @@ for chItem in channel_list: error = logger.recordedLog logger.recordedLog = '' for it in mainlist: + wait() try: print('preparing ' + ch + ' -> ' + it.title) @@ -186,15 +195,18 @@ for chItem in channel_list: else: itemlist = getattr(module, it.action)(it) - if not firstContent and itemlist and itemlist[0].action in ('findvideos', 'episodios'): + # if more search action (ex: movie, tvshow), firstcontent need to be changed in every menu + if itemlist and itemlist[0].action in ('findvideos', 'episodios'): firstContent = re.match('[ \w]*', itemlist[0].fulltitle).group(0) # some sites might have no link inside, but if all results are without servers, there's something wrong for resIt in itemlist: + wait() if resIt.action == 'findvideos' or resIt.action == 'episodios': if hasattr(module, resIt.action): serversFound[it.title] = getattr(module, resIt.action)(resIt) if serversFound[it.title] and resIt.action == 'episodios': + wait() serversFound[it.title] = getattr(module, serversFound[it.title][0].action)(serversFound[it.title][0]) else: serversFound[it.title] = [resIt]