fix: impostazioni resolverDNS

This commit is contained in:
greko17
2019-12-09 19:21:33 +01:00
parent a89df6e6f9
commit d060880a08
5 changed files with 98 additions and 92 deletions

View File

@@ -5681,8 +5681,9 @@ msgctxt "#70740"
msgid "Your system does not have a web browser, so here's the short link you can open in another device:\n%s"
msgstr ""
# DNS start [ settings and declaration ]
msgctxt "#707401"
msgid "Enable Check DNS"
msgid "Enable DNS Check Alert"
msgstr ""
msgctxt "#707402"
@@ -5690,54 +5691,54 @@ msgid "Connection or DNS problems"
msgstr ""
msgctxt "#707403"
msgid "Reminder Activation"
msgid "Disable alert"
msgstr ""
msgctxt "#707404"
msgid "By deactivating the DNS check, you have activated a reminder that it will appear at the top right."
msgid "Remind me"
msgstr ""
msgctxt "#707405"
msgid "If you disable 'Enable DNS' you will use the dns set in your modem or device."
msgstr ""
msgctxt "#707412"
msgid "If you want to insert YOUR DNS that do not appear in the list, run in order:"
msgstr ""
msgctxt "#707413"
msgid "'Enable DNS' -> OFF - 'Enter your DNS' -> ON"
msgstr ""
msgctxt "#707414"
msgid "Note: If 'Activate DNS' and 'Insert your DNS' are both ON, the former will prevail."
msgstr ""
msgctxt "#707415"
msgid "For any change to the DNS you MUST restart KODI!"
msgid "Notice Activation"
msgstr ""
msgctxt "#707406"
msgid "Activate DNS"
msgid "By disabling the alert, you have activated a notice\nthat will appear at the top right in case of problems"
msgstr ""
msgctxt "#707407"
msgid "Choose the DNS provider"
msgid "For any change to the DNS you MUST restart KODI!"
msgstr ""
msgctxt "#707408"
msgid "Choose your preferred DNS provider and restart KODI!"
msgid "Activate DNS"
msgstr ""
msgctxt "#707409"
msgid "Insert your DNS"
msgid "Choose the DNS provider"
msgstr ""
msgctxt "#707410"
msgid "DNS supplier."
msgstr ""
msgctxt "#707411"
msgid "Insert your DNS"
msgstr ""
msgctxt "#707412"
msgid "DNS1"
msgstr ""
msgctxt "#7074011"
msgctxt "#707413"
msgid "DNS2"
msgstr ""
# DNS end
msgctxt "#707414"
msgid "You are using the DNS set on your device or modem"
msgstr ""
msgctxt "#707415"
msgid "You have not selected any choice, the cloudflare DNS will be used."
msgstr ""
# end DNS

View File

@@ -5685,64 +5685,64 @@ msgctxt "#70740"
msgid "Your system does not have a web browser, so here's the short link you can open in another device:\n%s"
msgstr "Il tuo sistema non ha un browser, quindi ecco un link corto che puoi aprire in un altro dispositivo\n%s"
# DNS start
# DNS start [ settings and declaration ]
msgctxt "#707401"
msgid "Enable Check DNS"
msgstr "Abilita Check DNS"
msgid "Enable DNS Check Alert"
msgstr "Abilita Avviso Check DNS"
msgctxt "#707402"
msgid "Connection or DNS problems"
msgstr "Problema di connessione o DNS"
msgctxt "#707403"
msgid "Reminder Activation"
msgstr "Attivazione Promemoria..."
msgid "Disable alert"
msgstr "Disattiva avviso"
msgctxt "#707404"
msgid "By deactivating the DNS check, you have activated a reminder that it will appear at the top right."
msgstr "Disattivando il check DNS, hai attivato un promemoria\nche apparirà in alto a dx"
msgid "Remind me"
msgstr "Ricordami"
msgctxt "#707405"
msgid "If you disable 'Enable DNS' you will use the dns set in your modem or device."
msgstr "Se disattivi Attiva DNS userai i dns impostati nel modem o nel dispositivo in uso."
msgid "Notice Activation"
msgstr "Attivazione Notifica"
msgctxt "#707412"
msgid "If you want to insert YOUR DNS that do not appear in the list, run in order:"
msgstr "Se vuoi inserire TUOI DNS che non compaiono nell'elenco, esegui in ordine:"
msgctxt "#707406"
msgid "By disabling the alert, you have activated a notice\nthat will appear at the top right in case of problems"
msgstr "Disattivando l'avviso, hai attivato una notifica\nche apparirà in alto a dx in caso di problemi"
msgctxt "#707413"
msgid "'Enable DNS' -> OFF - 'Enter your DNS' -> ON"
msgstr "Attiva DNS -> OFF - Inserisci i tuoi DNS -> ON"
msgctxt "#707414"
msgid "Note: If 'Activate DNS' and 'Insert your DNS' are both ON, the former will prevail."
msgstr "N.B: Se Attiva DNS e Inserisci i tuoi DNS sono entrambi a ON, prevarranno i primi."
msgctxt "#707415"
msgctxt "#707407"
msgid "For any change to the DNS you MUST restart KODI!"
msgstr "Per ogni modifica sui DNS DEVI riavviare KODI!"
msgctxt "#707406"
msgctxt "#707408"
msgid "Activate DNS"
msgstr "Attiva DNS"
msgctxt "#707407"
msgctxt "#707409"
msgid "Choose the DNS provider"
msgstr "Scegli il fornitore DNS"
msgctxt "#707408"
msgid "Choose your preferred DNS provider and restart KODI!"
msgstr "Scegli il tuo provider per i DNS che preferisci."
msgctxt "#707410"
msgid "DNS supplier."
msgstr "Fornitore DNS"
msgctxt "#707409"
msgctxt "#707411"
msgid "Insert your DNS"
msgstr "Inserisci i tuoi DNS"
msgctxt "#707410"
msgctxt "#707412"
msgid "DNS1"
msgstr "DNS1"
msgctxt "#707411"
msgctxt "#707413"
msgid "DNS2"
msgstr "DNS2"
# DNS end
msgctxt "#707414"
msgid "You are using the DNS set on your device or modem"
msgstr "Stai utilizzando i DNS impostati sul dispositivo o modem"
msgctxt "#707415"
msgid "You have not selected any choice, the cloudflare DNS will be used."
msgstr "Non hai selezionato nessuna scelta!\nVerranno utilizzati i DNS di cloudflare."
# end DNS

View File

@@ -123,23 +123,25 @@
values="[COLOR white]white[/COLOR]|[COLOR cyan]cyan[/COLOR]|[COLOR deepskyblue]deepskyblue[/COLOR]|[COLOR firebrick]firebrick[/COLOR]|[COLOR gold]gold[/COLOR]|[COLOR goldenrod]goldenrod[/COLOR]|[COLOR hotpink]hotpink[/COLOR]|[COLOR limegreen]limegreen[/COLOR]|[COLOR orange]orange[/COLOR]|[COLOR orchid]orchid[/COLOR]|[COLOR red]red[/COLOR]|[COLOR salmon]salmon[/COLOR]|[COLOR yellow]yellow[/COLOR]"
default="white" visible="eq(-17,true)+eq(-18,true)"/> -->
</category>
<!-- Scelgo i DNS da utilizzare -->
<!-- DNS -->
<category label="DNS">
<setting id="checkdns" type="bool" label="707401" default="true" visible="true"/>
<setting type="lsep"/>
<setting label="707415" visible="true" enable="true"/>
<setting id="resolver_dns" type="bool" label="707406" default="true" enable="true" visible="true"/>
<setting id="resolver_dns_service" type="enum" values="Cloudflare|Google|OpenDns Home ip(v4)|OpenDns Family Shield ip(v4)|OpenDns ip(v6)" label="707407" default="0" visible="eq(-1,true)" enable="eq(-1,true)"/>
<setting label="707408" visible="eq(-2,true)" enable="eq(-2,true)"/>
<setting id="resolver_dns_custom" type="bool" label="707409" default="false" enable="eq(-3,false)" visible="true"/>
<setting id="resolver_dns_custom1" type="ipaddress" visible="eq(-1,true)" label="707410" default="1.1.1.1"/>
<setting id="resolver_dns_custom2" type="ipaddress" visible="eq(-2,true)" label="707411" default="1.0.0.1"/>
<setting label="707406" visible="eq(-1,false)" enable="true"/>
<setting label="707405" visible="true" enable="true"/>
<setting label="707412" visible="true" enable="true"/>
<setting label="707413" visible="true" enable="true"/>
<setting label="707414" visible="true" enable="true"/>
<setting type="lsep"/>
<!-- avviso riavvio -->
<setting label="707407" visible="true" enable="true"/>
<!-- attivazione dns KOD -->
<setting id="resolver_dns" type="bool" label="707408" default="true" enable="true" visible="true"/>
<setting label="707414" visible="!eq(-1,true)" enable="true"/>
<!-- fornitori dns -->
<setting id="resolver_dns_service_choose" type="bool" label="707409" default="true" enable="eq(-2,true)" visible="true"/>
<setting id="resolver_dns_service" type="enum" values="Cloudflare|Google|OpenDns Home ip(v4)|OpenDns Family Shield ip(v4)|OpenDns ip(v6)" label="707410" default="0" visible="eq(-3,true)+eq(-1,true)" enable="true"/>
<!-- custom dns -->
<setting id="resolver_dns_custom" type="bool" label="707411" default="true" enable="eq(-4,true)+eq(-2,false)" visible="true"/>
<setting id="resolver_dns_custom1" type="ipaddress" visible="eq(-1,true)+eq(-5,true)+eq(-3,false)" label="707412" default="1.1.1.1"/>
<setting id="resolver_dns_custom2" type="ipaddress" visible="eq(-2,true)+eq(-6,true)+eq(-4,false)" label="707413" default="1.0.0.1"/>
<setting label="707415" visible="eq(-7,true)+eq(-5,false)+eq(-3,false)" enable="true"/>
</category>
<!-- Other -->
<category label="70149">

View File

@@ -34,6 +34,7 @@ class Kdicc():
self.view_msg = view_msg
self.lst_site_check_dns = lst_site_check_dns
self.urls = []
logger.info("check #### INIZIO INIT#### ")
def check_Ip(self):
"""
@@ -189,13 +190,13 @@ class Kdicc():
dialog = xbmcgui.Dialog()
if config.get_setting('checkdns'):
risposta= dialog.yesno(addonname, txt, nolabel='Disattiva', yeslabel='Ricordami')
risposta= dialog.yesno(addonname, txt, nolabel=config.get_localized_string(707403), yeslabel=config.get_localized_string(707404))
if risposta == False:
config.set_setting('checkdns', False)
dialog.textviewer(addonname+ ' '+config.get_localized_string(707403), config.get_localized_string(707404))
dialog.textviewer(addonname+' '+config.get_localized_string(707405), config.get_localized_string(707406))
else:
txt = config.get_localized_string(707402)
dialog.notification(addonname, txt, xbmcgui.NOTIFICATION_INFO, 5000)
dialog.notification(addonname, txt, xbmcgui.NOTIFICATION_INFO, 10000)
"""
def richiamato in launcher.py
"""

View File

@@ -4,7 +4,8 @@
from platformcode import config
from core import support
if config.get_setting('resolver_dns') or config.get_setting('resolver_dns_custom'):
##if config.get_setting('resolver_dns') or config.get_setting('resolver_dns_custom'):
if config.get_setting('resolver_dns'):
from lib import dns
import dns.resolver
from dns.resolver import override_system_resolver
@@ -18,25 +19,26 @@ if config.get_setting('resolver_dns') or config.get_setting('resolver_dns_custom
legge le impostazioni dalla configurazione
e setta i relativi DNS
"""
nameservers_dns = config.get_setting('resolver_dns_service')
support.log("NAME SERVER1: {}".format(nameservers_dns))
if config.get_setting('resolver_dns_custom') and not config.get_setting('resolver_dns'):
res.nameservers = [config.get_setting('resolver_dns_custom1'),config.get_setting('resolver_dns_custom2')]
elif nameservers_dns == 1:# 'Google'
res.nameservers = ['8.8.8.8', '2001:4860:4860::8888',
'8.8.4.4', '2001:4860:4860::8844']
elif nameservers_dns == 2:#'OpenDns Home ip(v4)':
res.nameservers = ['208.67.222.222', '208.67.222.220']
elif nameservers_dns == 3:#'OpenDns Family Shield ip(v4)':
res.nameservers = ['208.67.222.123', '208.67.220.123']
elif nameservers_dns == 4:#'OpenDns ip(v6)':
#https://support.opendns.com/hc/en-us/articles/227986667-Does-OpenDNS-Support-IPv6-
res.nameservers = ['2620:119:35::35', '2620:119:53::53']
elif nameservers_dns == 0:#'Cloudflare':
res.nameservers = ['1.1.1.1', '2606:4700:4700::1111',
'1.0.0.1', '2606:4700:4700::1001']
if config.get_setting('resolver_dns_custom') and not config.get_setting('resolver_dns_service_choose'):
res.nameservers = [config.get_setting('resolver_dns_custom1'),config.get_setting('resolver_dns_custom2')]
else:
nameservers_dns = config.get_setting('resolver_dns_service')
# config.get_setting('resolver_dns_service_choose') == true
if nameservers_dns == 1:# 'Google'
res.nameservers = ['8.8.8.8', '2001:4860:4860::8888',
'8.8.4.4', '2001:4860:4860::8844']
elif nameservers_dns == 2:#'OpenDns Home ip(v4)'
res.nameservers = ['208.67.222.222', '208.67.222.220']
elif nameservers_dns == 3:#'OpenDns Family Shield ip(v4)':
res.nameservers = ['208.67.222.123', '208.67.220.123']
elif nameservers_dns == 4:#'OpenDns ip(v6)'
#https://support.opendns.com/hc/en-us/articles/227986667-Does-OpenDNS-Support-IPv6-
res.nameservers = ['2620:119:35::35', '2620:119:53::53']
else:#if nameservers_dns == 0:#'Cloudflare'
res.nameservers = ['1.1.1.1', '2606:4700:4700::1111',
'1.0.0.1', '2606:4700:4700::1001']
# log di verifica dei DNS impostati, d'aiuto quando gli utenti smanettano...
support.log("NAME SERVER2: {}".format(res.nameservers))
override_system_resolver(res)