From 43fc32c5cd26725623a4b4da4fd72803354475e8 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Wed, 16 Nov 2022 16:59:15 +0100 Subject: [PATCH] =?UTF-8?q?=20-=20Fix=20Finestra=20selezione=20Qualit?= =?UTF-8?q?=C3=A0=20=20-=20Fix=20Redirect=20StreamingCommunity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- channels/streamingcommunity.py | 12 ++++++------ platformcode/platformtools.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/channels/streamingcommunity.py b/channels/streamingcommunity.py index 6295113e..ef2f3b1c 100644 --- a/channels/streamingcommunity.py +++ b/channels/streamingcommunity.py @@ -2,10 +2,10 @@ # ------------------------------------------------------------ # Canale per StreamingCommunity # ------------------------------------------------------------ -import functools -import json, requests, re, sys -from core import support, channeltools, httptools, jsontools, filetools -from platformcode import logger, config, platformtools + +import json, re, sys +from core import support, channeltools, httptools, jsontools +from platformcode import logger, config if sys.version_info[0] >= 3: from concurrent import futures @@ -130,11 +130,11 @@ def peliculas(item): records = json.loads(support.match(data, patron=r'slider-title titles-json="(.*?)"\s*slider-name="').matches[item.args]) elif not item.search: payload = {'type': videoType, 'offset':offset, 'genre':item.args} - records = requests.post(host + '/api/browse', headers=headers, json=payload).json()['records'] + records = httptools.downloadpage(host + '/api/browse', headers=headers, post=payload).json['records'] else: payload = {'q': item.search} headers['referer'] = host + '/search' - records = requests.post(host + '/api/search', headers=headers, json=payload).json()['records'] + records = httptools.downloadpage(host + '/api/search', headers=headers, post=payload).json['records'] if records and type(records[0]) == list: js = [] diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index f07f6646..bb89ccb7 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -1066,7 +1066,7 @@ def play_video(item, strm=False, force_direct=False, autoplay=False): # Open the selection dialog to see the available options opciones, video_urls, seleccion, salir = get_dialogo_opciones(item, default_action, strm, autoplay) - if salir: return + if salir or len(opciones) == 0: return # get default option of addon configuration seleccion = get_seleccion(default_action, opciones, seleccion, video_urls)