From 3a2c8093a39caaee4535fc96b9ecfec57e5c1694 Mon Sep 17 00:00:00 2001 From: jeancf Date: Thu, 17 Dec 2020 10:15:46 +0100 Subject: [PATCH] Improved logging in cleanup_tweet_text --- twoot.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/twoot.py b/twoot.py index 9b8f54d..0293685 100755 --- a/twoot.py +++ b/twoot.py @@ -104,9 +104,9 @@ def cleanup_tweet_text(tt_iter, twit_account, status_id, tweet_uri, get_vids): tweet_text += '\n\n[Video embedded in original tweet]' except OSError: logging.error("Could not execute twitterdl.py (is it there? Is it set as executable?)") - sys.exit(-1) except subprocess.TimeoutExpired: # Video download and encoding took too long + logging.error("twitterdl.py execution timed out") tweet_text += '\n\n[Video embedded in original tweet]' else: tweet_text += '\n\n[Video embedded in original tweet]' @@ -137,7 +137,7 @@ def cleanup_tweet_text(tt_iter, twit_account, status_id, tweet_uri, get_vids): pass else: - print("*** WARNING: No handler for tag in twitter text: " + tag.prettify()) + logging.warning("No handler for tag in twitter text: " + tag.prettify()) return tweet_text @@ -349,7 +349,6 @@ def main(argv): tweet = { "author": author, "author_account": author_account, - "author_logo_url": author_logo_url, "timestamp": timestamp, "tweet_id": tweet_id, "tweet_text": tweet_text,