def get_media_from_object(tweet_obj):
    """Extract media from a tweet object

    Args:
        tweet_obj (dict): A dictionary that is the tweet object, extended_entities or extended_tweet

    Returns:
        list: list of medias that are extracted from the tweet.
    """
    media_list = []
    if "extended_entities" in tweet_obj.keys():
        if "media" in tweet_obj["extended_entities"].keys():
            for x in tweet_obj["extended_entities"]["media"]:
                a = None
                b = None
                if "type" in x.keys():
                    a = x["type"]
                if "expanded_url" in x.keys():
                    b = x["expanded_url"]
                media_list.append((a, b))
    return media_list