def __init__(self, url, validate_url=True): self.url = url if validate_url and not self.is_valid(): raise InvalidURL('Invalid URL')