This commit is contained in:
Alhaziel
2019-11-21 11:28:08 +01:00
3 changed files with 14 additions and 39 deletions

View File

@@ -318,12 +318,16 @@ def set_channel_info(parameters):
def auto_filter(auto_lang=False):
list_lang = ['ita', 'vos', 'sub-ita']
if config.get_setting("channel_language") == 'auto' or auto_lang == True:
lang = config.get_localized_string(20001)
else:
lang = config.get_setting("channel_language", default="all")
if lang not in list_lang:
lang = 'all'
return lang
# import xbmc, xbmcaddon

View File

@@ -7,27 +7,11 @@
"find_videos": {
"patterns": [
{
"pattern": "https://wstream.video/stream/switch_embed.php\\?file_code=([a-z0-9A-Z]+)",
"url": "https://wstream.video/video.php?file_code=\\1"
},
{
"pattern":"wstream.video\/api\/vcmod\/fastredirect\/streaming.php\\?id=([0-9a-zA-Z]+)",
"url": "https://wstream.video/api/vcmod/fastredirect/streaming.php?id=\\1"
},
{
"pattern": "wstream\\.video/video\\.php\\?file_code=([a-z0-9A-Z]+)",
"url": "https://wstream.video/video.php?file_code=\\1"
},
{
"pattern": "wstream\\.video\/(?:embed-|videos/|video/|videow/|videoj/)([a-z0-9A-Z]+)",
"url": "https://wstream.video/video.php?file_code=\\1"
},
{
"pattern": "wstream\\.video/(?!api/|stream/|embed-)([a-z0-9A-Z]+)",
"pattern": "wstream\\.video.*?(?<!api)(?:=|/)([a-z0-9A-Z]+)(?:[^/_.a-z0-9A-Z]|$)",
"url": "https://wstream.video/video.php?file_code=\\1"
}
],
"ignore_urls": [ ]
"ignore_urls": []
},
"settings": [
{

View File

@@ -18,8 +18,7 @@ from platformcode import config, logger
from platformcode import platformtools
from core.support import typo
import cPickle, shutil
from multiprocessing import Process
multi = 'process'
global_lock = threading.Lock()
addon = xbmcaddon.Addon('metadata.themoviedb.org')
def_lang = addon.getSetting('language')
@@ -574,15 +573,10 @@ def do_search(item, categories=None):
logger.info("Búsqueda cancelada")
return itemlist
if multithread:
if multi == 'threads':
t = Thread(target=channel_search, args=[search_results, channel_parameters, tecleado],
name=channel_parameters["title"])
t.setDaemon(True)
t.start()
else:
t = Process(target=channel_search, args=[search_results, channel_parameters, tecleado],
name=channel_parameters["title"])
t.start()
t = Thread(target=channel_search, args=[search_results, channel_parameters, tecleado],
name=channel_parameters["title"])
t.setDaemon(True)
t.start()
threads.append(t)
# Modo single Thread
else:
@@ -612,26 +606,19 @@ def search_progress(threads):
import math
progreso = platformtools.dialog_progress_bg(config.get_localized_string(20000), "")
if multi == 'threads':
pendent = [a for a in threads if a.isAlive()]
else:
pendent = [a for a in threads if a.is_alive()]
pendent = [a for a in threads if a.isAlive()]
if len(pendent) > 0: t = float(100) / len(pendent)
while len(pendent) > 0:
index = (len(threads) - len(pendent)) + 1
percentage = int(math.ceil(index * t))
list_pendent_names = ['test' for a in pendent]
list_pendent_names = [a.getName() for a in pendent]
mensaje = config.get_localized_string(70282) % (", ".join(list_pendent_names))
progreso.update(percentage,
config.get_localized_string(60521) % (len(threads) - len(pendent) + 1, len(threads)),
mensaje)
time.sleep(0.5)
if multi == 'threads':
pendent = [a for a in threads if a.isAlive()]
else:
pendent = [a for a in threads if a.is_alive()]
pendent = [a for a in threads if a.isAlive()]
progreso.close()
with open(os.path.join(res_dir, 'done'), 'w') as f:
f.write('1')