From d55067f74ab201dcead2715da1f0181ade2f675d Mon Sep 17 00:00:00 2001 From: mpentler Date: Sat, 27 Jan 2018 14:07:58 +0000 Subject: [PATCH] script now exits on twitter authentication error --- teletext-twitter.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/teletext-twitter.py b/teletext-twitter.py index 2933205..1f90b94 100644 --- a/teletext-twitter.py +++ b/teletext-twitter.py @@ -83,6 +83,10 @@ def main(): sys.exit(1) except twitter.error.TwitterError as e: for error in e.message: + if error['code'] == 32: + print("[!] Authentication error accessing Twitter. Check config.py file and make sure your tokens are correct.") + print("[!] Exiting...") + sys.exit(1) print("[!] Error accessing your Twitter timeline: {}".format(error['message']), file=sys.stderr) print("[!] Trying again after specified delay", file=sys.stderr) time.sleep(args.delay)