# Path: dyndnsc/detector/base.py
# LOG = logging.getLogger(__name__)
# class IPDetector(Subject, DynamicCliMixin):
#     def __init__(self, *args, **kwargs):
#     def can_detect_offline(self):
#     def af(self):
#     def get_old_value(self):
#     def set_old_value(self, value):
#     def get_current_value(self, default=None):
#     def set_current_value(self, value):
#     def has_changed(self):
#     def configuration_key_prefix():
# 
# Path: dyndnsc/common/six.py
# def ipaddress(addr):
#     """Return an ipaddress.ip_address object from the given string IP."""
#     return _ipaddress.ip_address(addr)
# 
# Path: dyndnsc/common/constants.py
# REQUEST_HEADERS_DEFAULT = {
#     # dyndns2 standard requires that we set our own user agent:
#     "User-Agent": "python-dyndnsc/%s" % __version__,
# }


import logging
import re
import requests
    import json
from random import choice
from .base import IPDetector, AF_INET, AF_INET6, AF_UNSPEC
from ..common.six import ipaddress
from ..common import constants
    Return parsable output containing the IP address.

    .. note::
        This detection mechanism requires ipv4 connectivity, otherwise it
        will simply not detect the IP address.
    """

    configuration_key = "webcheck4"

    # TODO: consider throwing out all URLs with no TLS support
    urls = (
        ("http://checkip.eurodyndns.org/", "checkip"),
        ("http://ip.dnsexit.com/", "plain"),
        ("http://checkip.dns.he.net/", "checkip_dns_he_net"),
        ("http://ip1.dynupdate.no-ip.com/", "plain"),
        ("http://ip2.dynupdate.no-ip.com/", "plain"),
        ("https://api.ipify.org/", "plain"),
        ("https://dynamic.zoneedit.com/checkip.html", "plain"),
        ("https://freedns.afraid.org/dynamic/check.php", "freedns_afraid"),
        ("https://ifconfig.co/ip", "plain"),
        ("https://ipinfo.io/ip", "plain"),
        ("https://ipv4.icanhazip.com/", "plain"),
        ("https://ipv4.nsupdate.info/myip", "plain"),
        ("https://jsonip.com/", "jsonip"),
    )

    def __init__(self, *args, **kwargs):
        """Initialize."""
        super(IPDetectorWebCheck, self).__init__(*args, **kwargs)


# Path: dyndnsc/detector/base.py
# LOG = logging.getLogger(__name__)
# class IPDetector(Subject, DynamicCliMixin):
#     def __init__(self, *args, **kwargs):
#     def can_detect_offline(self):
#     def af(self):
#     def get_old_value(self):
#     def set_old_value(self, value):
#     def get_current_value(self, default=None):
#     def set_current_value(self, value):
#     def has_changed(self):
#     def configuration_key_prefix():
# 
# Path: dyndnsc/common/six.py
# def ipaddress(addr):
#     """Return an ipaddress.ip_address object from the given string IP."""
#     return _ipaddress.ip_address(addr)
# 
# Path: dyndnsc/common/constants.py
# REQUEST_HEADERS_DEFAULT = {
#     # dyndns2 standard requires that we set our own user agent:
#     "User-Agent": "python-dyndnsc/%s" % __version__,
# }


# Path: dyndnsc/detector/webcheck.py
import logging
import re
import requests
    import json
from random import choice
from .base import IPDetector, AF_INET, AF_INET6, AF_UNSPEC
from ..common.six import ipaddress
from ..common import constants

    Return parsable output containing the IP address.

    .. note::
        This detection mechanism requires ipv4 connectivity, otherwise it
        will simply not detect the IP address.
    """

    configuration_key = "webcheck4"

    # TODO: consider throwing out all URLs with no TLS support
    urls = (
        ("http://checkip.eurodyndns.org/", "checkip"),
        ("http://ip.dnsexit.com/", "plain"),
        ("http://checkip.dns.he.net/", "checkip_dns_he_net"),
        ("http://ip1.dynupdate.no-ip.com/", "plain"),
        ("http://ip2.dynupdate.no-ip.com/", "plain"),
        ("https://api.ipify.org/", "plain"),
        ("https://dynamic.zoneedit.com/checkip.html", "plain"),
        ("https://freedns.afraid.org/dynamic/check.php", "freedns_afraid"),
        ("https://ifconfig.co/ip", "plain"),
        ("https://ipinfo.io/ip", "plain"),
        ("https://ipv4.icanhazip.com/", "plain"),
        ("https://ipv4.nsupdate.info/myip", "plain"),
        ("https://jsonip.com/", "jsonip"),
    )

    def __init__(self, *args, **kwargs):
        """Initialize."""
        super(IPDetectorWebCheck, self).__init__(*args, **kwargs)


        self.opts_family = AF_INET