# Path: pydatajson/constants.py
# EXCEPTION_STATUS_CODES = [429]
# 
# INVALID_STATUS_CODES_REGEX = ["^4[0-9]+$", "^5[0-9]+$"]
# 
# Path: pydatajson/validators/simple_validator.py
# class SimpleValidator(object):
# 
#     def __init__(self, catalog):
#         self.catalog = catalog
# 
#     def validate(self):
#         raise NotImplementedError


import re
import requests
from requests import RequestException, Timeout
from pydatajson.constants import EXCEPTION_STATUS_CODES, \
    INVALID_STATUS_CODES_REGEX
from pydatajson.validators.simple_validator import SimpleValidator
#!/usr/bin/env python
# -*- coding: utf-8 -*-




class UrlValidator(SimpleValidator):

    def __init__(self, catalog, verify_ssl, url_check_timeout, threads_count):
        super(UrlValidator, self).__init__(catalog)
        self.verify_ssl = verify_ssl
        self.url_check_timeout = url_check_timeout
        self.threads_count = threads_count

    def validate(self):
        raise NotImplementedError

    def is_working_url(self, url):
        try:
            response = requests.head(url,
                                     timeout=self.url_check_timeout,
                                     verify=self.verify_ssl)
            matches = []

# Path: pydatajson/constants.py
# EXCEPTION_STATUS_CODES = [429]
# 
# INVALID_STATUS_CODES_REGEX = ["^4[0-9]+$", "^5[0-9]+$"]
# 
# Path: pydatajson/validators/simple_validator.py
# class SimpleValidator(object):
# 
#     def __init__(self, catalog):
#         self.catalog = catalog
# 
#     def validate(self):
#         raise NotImplementedError


# Path: pydatajson/validators/url_validator.py
import re
import requests
from requests import RequestException, Timeout
from pydatajson.constants import EXCEPTION_STATUS_CODES, \
    INVALID_STATUS_CODES_REGEX
from pydatajson.validators.simple_validator import SimpleValidator

#!/usr/bin/env python
# -*- coding: utf-8 -*-




class UrlValidator(SimpleValidator):

    def __init__(self, catalog, verify_ssl, url_check_timeout, threads_count):
        super(UrlValidator, self).__init__(catalog)
        self.verify_ssl = verify_ssl
        self.url_check_timeout = url_check_timeout
        self.threads_count = threads_count

    def validate(self):
        raise NotImplementedError

    def is_working_url(self, url):
        try:
            response = requests.head(url,
                                     timeout=self.url_check_timeout,
                                     verify=self.verify_ssl)
            matches = []

            if response.status_code not in EXCEPTION_STATUS_CODES: