From d17401ebc187c392b60de2f22d5a8a01b0a719d7 Mon Sep 17 00:00:00 2001 From: marco Date: Sun, 27 Sep 2020 16:13:58 +0200 Subject: [PATCH] rimossi test github actions, alcuni fix e disabilitato tantifilm --- .github/workflows/tests.yml | 46 ------------------------------- channels/cineblog01.py | 2 +- channels/tantifilm.json | 2 +- platformcode/shortcuts.py | 4 +-- platformcode/xbmc_videolibrary.py | 14 ++++++++-- tests/test_generic.py | 3 +- 6 files changed, 17 insertions(+), 54 deletions(-) delete mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index 30eb46f0..00000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,46 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: Test Suite - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch -on: - workflow_dispatch: - schedule: - - cron: '30 17 * * *' - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - tests: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: 2.7 - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install sakee - pip install html-testRunner - pip install parameterized - - - name: Run tests - run: | - export PYTHONPATH=$GITHUB_WORKSPACE - export KODI_INTERACTIVE=0 - export KODI_HOME=$GITHUB_WORKSPACE/tests/home - python tests/test_generic.py - - - uses: actions/upload-artifact@v2 - with: - name: report - path: reports/report.html diff --git a/channels/cineblog01.py b/channels/cineblog01.py index b7b646dd..16811fcc 100644 --- a/channels/cineblog01.py +++ b/channels/cineblog01.py @@ -101,7 +101,7 @@ def peliculas(item): # debug= True if 'newest' in item.args: if '/serietv/' not in item.url: - debug = True + # debug = True pagination = '' patronBlock = r'Ultimi 100 film [^:]+:(?P.*?)<\/td>' patron = r']+)"?>(?P[^<([]+)(?:\[(?P<lang>Sub-ITA|B/N|SUB-ITA)\])?\s*(?:\[(?P<quality>HD|SD|HD/3D)\])?\s*\((?P<year>[0-9]{4})\)<\/a>' diff --git a/channels/tantifilm.json b/channels/tantifilm.json index 1cf987db..d716a90c 100644 --- a/channels/tantifilm.json +++ b/channels/tantifilm.json @@ -2,7 +2,7 @@ "id": "tantifilm", "name": "Tantifilm", "language": ["ita"], - "active": true, + "active": false, "thumbnail": "tantifilm.png", "banner": "tantifilm.png", "categories": ["tvshow", "movie", "anime"], diff --git a/platformcode/shortcuts.py b/platformcode/shortcuts.py index 631d5896..2334d60d 100644 --- a/platformcode/shortcuts.py +++ b/platformcode/shortcuts.py @@ -7,12 +7,12 @@ def context(): context = [] # original # if config.get_setting('quick_menu'): context.append((config.get_localized_string(60360).upper(), "RunPlugin(plugin://plugin.video.kod/?%s)" % Item(channel='shortcuts', action="shortcut_menu").tourl())) - # if config.get_setting('side_menu'): context.append((config.get_localized_string(70737).upper(), "RunPlugin(plugin://plugin.video.kod/?%s)" % Item(channel='shortcuts',action="side_menu").tourl())) + # if config.get_setting('side_menu'): context.append((config.get_localized_string(70737).upper(), "RunPlugin(plugin://plugin.video.kod/?%s)" % Item(channel='shortcuts',action="Side_menu").tourl())) # if config.get_setting('kod_menu'): context.append((config.get_localized_string(60026), "RunPlugin(plugin://plugin.video.kod/?%s)" % Item(channel='shortcuts', action="settings_menu").tourl())) # pre-serialised if config.get_setting('quick_menu'): context.append((config.get_localized_string(60360), 'RunPlugin(plugin://plugin.video.kod/?ewogICAgImFjdGlvbiI6ICJzaG9ydGN1dF9tZW51IiwgCiAgICAiY2hhbm5lbCI6ICJzaG9ydGN1dHMiLCAKICAgICJpbmZvTGFiZWxzIjoge30KfQ%3D%3D)')) - if config.get_setting('Side_menu'): context.append((config.get_localized_string(70737), 'RunPlugin(plugin://plugin.video.kod/?ewogICAgImFjdGlvbiI6ICJzaWRlX21lbnUiLCAKICAgICJjaGFubmVsIjogInNob3J0Y3V0cyIsIAogICAgImluZm9MYWJlbHMiOiB7fQp9)')) + if config.get_setting('Side_menu'): context.append((config.get_localized_string(70737), 'RunPlugin(plugin://plugin.video.kod/?ewogICAgImFjdGlvbiI6ICJTaWRlX21lbnUiLCAKICAgICJjaGFubmVsIjogInNob3J0Y3V0cyIsIAogICAgImluZm9MYWJlbHMiOiB7fQp9)')) if config.get_setting('kod_menu'): context.append((config.get_localized_string(60026), 'RunPlugin(plugin://plugin.video.kod/?ewogICAgImFjdGlvbiI6ICJzZXR0aW5nc19tZW51IiwgCiAgICAiY2hhbm5lbCI6ICJzaG9ydGN1dHMiLCAKICAgICJpbmZvTGFiZWxzIjoge30KfQ%3D%3D)')) return context diff --git a/platformcode/xbmc_videolibrary.py b/platformcode/xbmc_videolibrary.py index a0b729c3..fb6ea365 100644 --- a/platformcode/xbmc_videolibrary.py +++ b/platformcode/xbmc_videolibrary.py @@ -9,6 +9,11 @@ import sys, os, threading, time, re, math, xbmc, xbmcgui PY3 = False if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int +if PY3: + import urllib.request as urllib2 # Es muy lento en PY2. En PY3 es nativo +else: + import urllib2 # Usamos el nativo de PY2 que es más rápido + from core import filetools, jsontools from platformcode import config, logger, platformtools from core import scrapertools @@ -434,7 +439,10 @@ def get_data(payload): @param payload: data :return: """ - import urllib.request, urllib.error + try: + import urllib.request as urllib + except ImportError: + import urllib logger.info("payload: %s" % payload) # Required header for XBMC JSON-RPC calls, otherwise you'll get a 415 HTTP response code - Unsupported media type headers = {'content-type': 'application/json'} @@ -447,8 +455,8 @@ def get_data(payload): xbmc_port = 0 xbmc_json_rpc_url = "http://" + config.get_setting("xbmc_host", "videolibrary") + ":" + str(xbmc_port) + "/jsonrpc" - req = urllib.request.Request(xbmc_json_rpc_url, data=jsontools.dump(payload), headers=headers) - f = urllib.request.urlopen(req) + req = urllib2.Request(xbmc_json_rpc_url, data=jsontools.dump(payload), headers=headers) + f = urllib.urlopen(req) response = f.read() f.close() diff --git a/tests/test_generic.py b/tests/test_generic.py index 35418ac1..5ec5e91a 100644 --- a/tests/test_generic.py +++ b/tests/test_generic.py @@ -52,7 +52,7 @@ validUrlRegex = re.compile( r'(?::\d+)?' # optional port r'(?:/?|[/?]\S+)$', re.IGNORECASE) -chBlackList = ['url'] +chBlackList = ['url', 'mediasetplay'] chNumRis = { 'altadefinizione01': { 'Film': 20 @@ -133,6 +133,7 @@ servers = [] channels = [] channel_list = channelselector.filterchannels("all") if 'KOD_TST_CH' not in os.environ else [Item(channel=os.environ['KOD_TST_CH'], action="mainlist")] +logger.info(channel_list) ret = [] for chItem in channel_list: try: