diff --git a/lowfat/validator.py b/lowfat/validator.py index 903b4b7c..4e32fa3b 100644 --- a/lowfat/validator.py +++ b/lowfat/validator.py @@ -15,6 +15,11 @@ def online_document(url): except HTTPError as exception: if exception.code == 410: raise ValidationError("Online document was removed.") # This is the code returned by Google Drive + elif exception.code == 403: + req = request.Request(url, headers={'User-Agent' : "lowFAT"}) + online_resource = request.urlopen(req) + else: + raise ValidationError("Error! HTTP status code is {}.".format(exception.code)) # Need to test if website didn't redirect the request to another resource. if url != online_resource.geturl() or online_resource.getcode() != 200: