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)