mirror of
https://gitlab.com/jeancf/twoot.git
synced 2025-01-18 15:27:07 +00:00
Catching connection exception to nitter site
This commit is contained in:
parent
200837c336
commit
a463ce335b
6
twoot.py
6
twoot.py
|
@ -328,7 +328,11 @@ def main(argv):
|
|||
url += '/with_replies'
|
||||
|
||||
# Download twitter page of user.
|
||||
twit_account_page = session.get(url, headers=headers)
|
||||
try:
|
||||
twit_account_page = session.get(url, headers=headers)
|
||||
except requests.exceptions.ConnectionError:
|
||||
logging.fatal('Host did not respond when trying to download ' + url)
|
||||
exit(-1)
|
||||
|
||||
# Verify that download worked
|
||||
if twit_account_page.status_code != 200:
|
||||
|
|
Loading…
Reference in New Issue
Block a user