Skip to content

Commit

Permalink
tweet import fix: author banner key missing when author has no banner
Browse files Browse the repository at this point in the history
  • Loading branch information
dale-wahl committed Jul 29, 2024
1 parent 32dac5d commit aa07e8c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion datasources/twitter-import/search_twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit aa07e8c

Please sign in to comment.