From d81f057c18f5428e38436aa931fc4a48d28be19a Mon Sep 17 00:00:00 2001 From: marco Date: Thu, 20 Feb 2020 20:03:59 +0100 Subject: [PATCH] checklinks threaded --- core/servertools.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/core/servertools.py b/core/servertools.py index 9c0e723f..c3234e54 100644 --- a/core/servertools.py +++ b/core/servertools.py @@ -745,12 +745,14 @@ def check_list_links(itemlist, numero='', timeout=3): numero -= 1 return itemlist -def check_video_link(url, server, timeout=3): - """ - Comprueba si el enlace a un video es valido y devuelve un string de 2 posiciones con la verificacion. - :param url, server: Link y servidor - :return: str(2) '??':No se ha podido comprobar. 'Ok':Parece que el link funciona. 'NO':Parece que no funciona. +def check_video_link(item, timeout=3): """ + Comprueba si el enlace a un video es valido y devuelve un string de 2 posiciones con la verificacion. + :param url, server: Link y servidor + :return: str(2) '??':No se ha podido comprobar. 'Ok':Parece que el link funciona. 'NO':Parece que no funciona. + """ + url = item.url + server = item.server NK = "[COLOR 0xFFF9B613][B]" + u"\u2022".encode('utf-8') + "[/B][/COLOR]" OK = "[COLOR 0xFF00C289][B]" + u"\u2022".encode('utf-8') + "[/B][/COLOR]" @@ -785,7 +787,7 @@ def check_video_link(url, server, timeout=3): finally: httptools.HTTPTOOLS_DEFAULT_DOWNLOAD_TIMEOUT = ant_timeout # Restaurar tiempo de descarga - return resultado + return item, resultado logger.info("[check_video_link] No hay test_video_exists para servidor: %s" % server) - return NK + return item, NK