From 585aebec9500d4cc04b804b5903d849100d2a8b4 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Tue, 26 Jan 2021 21:21:09 +0100 Subject: [PATCH] un paio di fix --- .github/workflows/tests.yml | 2 +- channels/eurostreaming.py | 3 ++- channels/filmpertutti.py | 2 +- tests/template.html | 4 ++-- tests/test_generic.py | 17 +++++++++-------- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b3dfb284..3661e88c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,7 +2,7 @@ name: Test Suite on: workflow_dispatch: schedule: - - cron: '00 16 * * *' + - cron: '00 15 * * *' jobs: tests: diff --git a/channels/eurostreaming.py b/channels/eurostreaming.py index 9508ca52..f4ec0f92 100644 --- a/channels/eurostreaming.py +++ b/channels/eurostreaming.py @@ -29,13 +29,14 @@ def mainlist(item): @support.scrape def peliculas(item): + # debug = True action = 'episodios' if item.args == 'newest': item.contentType = 'episode' patron = r'(?P[^<]+) –\s*<a href="(?P<url>[^"]+)"[^>]*>\s?(?P<episode>\d+[×x]\d+-\d+|\d+[×x]\d+) (?P<title2>[^<\(]+)\s?\(?(?P<lang>SUB ITA)?\)?</a>' pagination = '' else: - patron = r'<div class="post-thumb">.*?\s<img src="(?P<thumb>[^"]+)".*?><a href="(?P<url>[^"]+)"[^>]+>(?P<title>.+?)\s?(?: Serie Tv)?\s?\(?(?P<year>\d{4})?\)?<\/a><\/h2>' + patron = r'<div class="post-thumb">.*?<img src="(?P<thumb>[^"]+)".*?><a href="(?P<url>[^"]+)"[^>]+>(?P<title>.+?)\s?(?: Serie Tv)?\s?\(?(?P<year>\d{4})?\)?<\/a><\/h2>' patronNext=r'a class="next page-numbers" href="?([^>"]+)">Avanti »</a>' return locals() diff --git a/channels/filmpertutti.py b/channels/filmpertutti.py index 4c9e9164..e9f24e30 100644 --- a/channels/filmpertutti.py +++ b/channels/filmpertutti.py @@ -9,7 +9,7 @@ from platformcode import config def findhost(url): page = httptools.downloadpage(url).data - url = support.scrapertools.find_single_match(page, 'Il nuovo indirizzo di FILMPERTUTTI è <a href="([^"]+)') + url = support.scrapertools.find_single_match(page, 'Il nuovo indirizzo di FILMPERTUTTI è ?<a href="([^"]+)') return url host = config.get_channel_url(findhost) diff --git a/tests/template.html b/tests/template.html index ea6098dd..9d931d09 100644 --- a/tests/template.html +++ b/tests/template.html @@ -7,7 +7,7 @@ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"> </head> <body> - <div class="container"> + <div class="container-fluid"> <div class="row"> <div class="col-xs-12"> <h2 class="text-capitalize">{{ title }}</h2> @@ -113,8 +113,8 @@ {%- if subtest.err or subtest.err %} <tr style="display:none;"> <td class="col-xs-9" colspan="3"> - {%- if subtest.err %}<p style="color:maroon;">{{ subtest.err[0].__name__ }}: {{ subtest.err[1] }}</p>{% endif %} {%- if subtest.err %}<p style="color:maroon;">{{ subtest.test_exception_info }}</p>{% endif %} + {%- if subtest.err %}<p style="color:maroon;">{{ subtest.err[0].__name__ }}: {{ subtest.err[1] }}</p>{% endif %} </td> </tr> {%- endif %} diff --git a/tests/test_generic.py b/tests/test_generic.py index 10a93461..8718e158 100644 --- a/tests/test_generic.py +++ b/tests/test_generic.py @@ -209,11 +209,11 @@ for chItem in channel_list: logMenu[it.title] = logger.recordedLog logger.recordedLog = '' - results.append( - {'ch': ch, 'hasChannelConfig': hasChannelConfig, 'mainlist': [it.title for it in mainlist], - 'menuItemlist': {k: [it.tojson() if type(it) == Item else it for it in menuItemlist[k]] for k in menuItemlist.keys()}, - 'serversFound': {k: [it.tojson() if type(it) == Item else it for it in menuItemlist[k]] for k in menuItemlist.keys()}, - 'module': str(module), 'logMenu': logMenu, 'error': error}) + # results.append( + # {'ch': ch, 'hasChannelConfig': hasChannelConfig, 'mainlist': [it.title for it in mainlist], + # 'menuItemlist': {k: [it.tojson() if type(it) == Item else it for it in menuItemlist[k]] for k in menuItemlist.keys()}, + # 'serversFound': {k: [it.tojson() if type(it) == Item else it for it in menuItemlist[k]] for k in menuItemlist.keys()}, + # 'module': str(module), 'logMenu': logMenu, 'error': error}) channels.append( {'ch': ch, 'hasChannelConfig': hasChannelConfig, 'mainlist': mainlist, 'menuItemlist': menuItemlist, 'serversFound': serversFound, 'module': module, 'logMenu': logMenu, 'error': error}) @@ -222,9 +222,10 @@ logger.record = False from specials import news dictNewsChannels, any_active = news.get_channels_list() -if not os.path.isdir(outDir): - os.mkdir(outDir) -json.dump(results, open(os.path.join(outDir, 'result.json'), 'w')) +# if not os.path.isdir(outDir): +# os.mkdir(outDir) +# json.dump(results, open(os.path.join(outDir, 'result.json'), 'w')) + # only 1 server item for single server serverNames = [] serversFinal = []