diff --git a/datasources/twitter-import/search_twitter.py b/datasources/twitter-import/search_twitter.py index f566c1302..baa506923 100644 --- a/datasources/twitter-import/search_twitter.py +++ b/datasources/twitter-import/search_twitter.py @@ -81,7 +81,7 @@ def map_item_modern(tweet): "author_fullname": tweet["core"]["user_results"]["result"]["legacy"]["name"], "author_id": tweet["legacy"]["user_id_str"], "author_avatar_url": tweet["core"]["user_results"]["result"]["legacy"]["profile_image_url_https"], - "author_banner_url": tweet["core"]["user_results"]["result"]["legacy"]["profile_banner_url"], + "author_banner_url": tweet["core"]["user_results"]["result"]["legacy"].get("profile_banner_url", ""), # key does not exist when author does not have a banner "source": strip_tags(tweet["source"]), "language_guess": tweet["legacy"].get("lang"), "possibly_sensitive": "yes" if tweet.get("possibly_sensitive") else "no",