mirror of
https://github.com/public-apis/public-apis.git
synced 2025-05-10 15:46:48 +02:00
Fix links validation (#1421)
This commit is contained in:
parent
a3e9fa01ce
commit
e35769370c
2 changed files with 6 additions and 2 deletions
|
@ -391,7 +391,7 @@ API | Description | Auth | HTTPS | CORS |
|
||||||
| [Hypixel](https://api.hypixel.net/) | Hypixel player stats | `apiKey` | Yes | Unknown |
|
| [Hypixel](https://api.hypixel.net/) | Hypixel player stats | `apiKey` | Yes | Unknown |
|
||||||
| [Hytale](https://hytale-api.com/) | Hytale blog posts and jobs | No | Yes | Unknown |
|
| [Hytale](https://hytale-api.com/) | Hytale blog posts and jobs | No | Yes | Unknown |
|
||||||
| [IGDB.com](https://api.igdb.com/) | Video Game Database | `apiKey` | Yes | Unknown |
|
| [IGDB.com](https://api.igdb.com/) | Video Game Database | `apiKey` | Yes | Unknown |
|
||||||
| [JokeAPI](https://sv443.net/jokeapi) | Programming, Miscellaneous and Dark Jokes | No | Yes | Yes |
|
| [JokeAPI](https://sv443.net/jokeapi/v2/) | Programming, Miscellaneous and Dark Jokes | No | Yes | Yes |
|
||||||
| [Jokes](https://github.com/15Dkatz/official_joke_api) | Programming and general jokes | No | Yes | Unknown |
|
| [Jokes](https://github.com/15Dkatz/official_joke_api) | Programming and general jokes | No | Yes | Unknown |
|
||||||
| [Jservice](http://jservice.io) | Jeopardy Question Database | No | No | Unknown |
|
| [Jservice](http://jservice.io) | Jeopardy Question Database | No | No | Unknown |
|
||||||
| [Magic The Gathering](http://magicthegathering.io/) | Magic The Gathering Game Information | No | No | Unknown |
|
| [Magic The Gathering](http://magicthegathering.io/) | Magic The Gathering Game Information | No | No | Unknown |
|
||||||
|
|
|
@ -34,7 +34,11 @@ def validate_links(links):
|
||||||
except socket.error as socketerror:
|
except socket.error as socketerror:
|
||||||
errors.append("SOC: {} : {}".format(socketerror, link))
|
errors.append("SOC: {} : {}".format(socketerror, link))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
errors.append("ERR: {} : {}".format(e, link))
|
# Ignore some exceptions which are not actually errors.
|
||||||
|
# The list below should be extended with other exceptions in the future if needed
|
||||||
|
if ((-1 != str(e).find("Content purported to be compressed with gzip but failed to decompress.")) and
|
||||||
|
(-1 != str(e).find("[SSL: CERTIFICATE_VERIFY_FAIL)ED] certificate verify failed (_ssl.c:852)"))) :
|
||||||
|
errors.append("ERR: {} : {}".format(e, link))
|
||||||
return errors
|
return errors
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue