diff --git a/twoot.py b/twoot.py index 88f268f..745f47e 100755 --- a/twoot.py +++ b/twoot.py @@ -342,10 +342,13 @@ def main(argv): # Download twitter page of user. try: - twit_account_page = session.get(url, headers=headers) + twit_account_page = session.get(url, headers=headers, timeout=5) except requests.exceptions.ConnectionError: logging.fatal('Host did not respond when trying to download ' + url) exit(-1) + except requests.exceptions.Timeout: + logging.fatal(nitter_url + ' took too long to respond') + exit(-1) # Verify that download worked if twit_account_page.status_code != 200: