Suppress SubjectAltNameWarning.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Wed, 14 Oct 2015 18:51:34 +0000 (20:51 +0200)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Wed, 14 Oct 2015 18:51:34 +0000 (20:51 +0200)
bob_download.py

index 57be3abfa4dce786c91284af8e43c515db233752..b3b67b2b68e158609c13db1cc9f0007e1fa54b7e 100644 (file)
@@ -16,10 +16,14 @@ import os
 import re
 import time
 import argparse
+import warnings
 from urllib.parse import urljoin
 import requests # pip install requests
 from bs4 import BeautifulSoup # pip install beautifulsoup4
+from requests.packages.urllib3.exceptions import SubjectAltNameWarning
 
+# SubjectAltNameWarning's should go off 0 times per host
+warnings.simplefilter('ignore', SubjectAltNameWarning)
 
 def main(username, password, destdir, csv_format):
     session = requests.Session()