commenti vari in checkhost
This commit is contained in:
@@ -11,9 +11,9 @@
|
|||||||
i controlli di ip, asdl e dns.
|
i controlli di ip, asdl e dns.
|
||||||
Questo perchè può succedere che in un qualsiasi momento
|
Questo perchè può succedere che in un qualsiasi momento
|
||||||
la connessione può avere problemi.
|
la connessione può avere problemi.
|
||||||
Nel caso succeda il controllo e relativa scrittura del file viene interrotto
|
Nel caso accada un problema, il controllo e relativa scrittura del file viene interrotto
|
||||||
con messaggio di avvertimento
|
con messaggio di avvertimento
|
||||||
|
|
||||||
"""
|
"""
|
||||||
import xbmc
|
import xbmc
|
||||||
import xbmcaddon
|
import xbmcaddon
|
||||||
@@ -24,7 +24,7 @@ from kdicc import test_conn
|
|||||||
|
|
||||||
def check(item):
|
def check(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
|
|
||||||
folderJson = xbmc.translatePath(xbmcaddon.Addon().getAddonInfo('path')).decode('utf-8')
|
folderJson = xbmc.translatePath(xbmcaddon.Addon().getAddonInfo('path')).decode('utf-8')
|
||||||
fileJson = 'channels.json'
|
fileJson = 'channels.json'
|
||||||
|
|
||||||
@@ -33,18 +33,19 @@ def check(item):
|
|||||||
## logger.info("DATA :%s" % data)
|
## logger.info("DATA :%s" % data)
|
||||||
|
|
||||||
risultato = {}
|
risultato = {}
|
||||||
|
|
||||||
for chann, host in sorted(data.items()):
|
for chann, host in sorted(data.items()):
|
||||||
ris = []
|
ris = []
|
||||||
logger.info("channel - host :%s - %s " % (chann, host))
|
logger.info("check #### INIZIO #### channel - host :%s - %s " % (chann, host))
|
||||||
|
|
||||||
#lst_host = []
|
#lst_host = []
|
||||||
#lst_host.append(host)
|
#lst_host.append(host)
|
||||||
lst_host = [host]
|
lst_host = [host]
|
||||||
|
|
||||||
rslt = test_conn(is_exit = True, check_dns = False, view_msg = True,
|
rslt = test_conn(is_exit = True, check_dns = False, view_msg = True,
|
||||||
lst_urls = lst_host, lst_site_check_dns = [], in_addon = True)
|
lst_urls = lst_host, lst_site_check_dns = [], in_addon = True)
|
||||||
|
|
||||||
logger.info("checkhost rslt :%s " % (rslt))
|
logger.info("check #### FINE #### rslt :%s " % (rslt))
|
||||||
rslt = rslt[0]
|
rslt = rslt[0]
|
||||||
# tutto ok
|
# tutto ok
|
||||||
if rslt['code'] == 200 and rslt['isRedirect'] == False:
|
if rslt['code'] == 200 and rslt['isRedirect'] == False:
|
||||||
@@ -57,7 +58,7 @@ def check(item):
|
|||||||
risultato[chann] = 'Host Sconosciuto - '+ str(rslt['code']) +' - '+ host
|
risultato[chann] = 'Host Sconosciuto - '+ str(rslt['code']) +' - '+ host
|
||||||
else:
|
else:
|
||||||
# altri tipi di errore
|
# altri tipi di errore
|
||||||
risultato[chann] = str(rslt['code']) +' - '+ host
|
risultato[chann] = 'Errore Sconosciuto - '+str(rslt['code']) +' - '+ host
|
||||||
|
|
||||||
fileJson_test = 'channels-test.json'
|
fileJson_test = 'channels-test.json'
|
||||||
# scrivo il file aggiornato
|
# scrivo il file aggiornato
|
||||||
|
|||||||
Reference in New Issue
Block a user