d60/twikit

TweetWithVisibilityResults results in critical failure

Closed this issue · 2 comments

You can see that with a normal "Tweet"

The structure begins as

{'__typename': 'Tweet', 'rest_id': '1756093204984693206', ...

When you have a typename of "TweetWithVisibilityResults"

This will result in an error as the 'rest_id' is inside the "tweet" object and is inaccessible. It is presumable that the rest of the assignments will fail as well as a consequence.

I have provided a redacted example data structure. Should be simple to add handling for this

{
    "__typename": "TweetWithVisibilityResults",
    "tweet": {
        "rest_id": "",
        "core": {
            "user_results": {
                "result": {
                    "__typename": "User",
                    "id": "",
                    "rest_id": "",
                    "affiliates_highlighted_label": {},
                    "has_graduated_access": true,
                    "is_blue_verified": false,
                    "profile_image_shape": "Circle",
                    "legacy": {
                        "can_dm": true,
                        "can_media_tag": false,
                        "created_at": "",
                        "default_profile": false,
                        "default_profile_image": false,
                        "description": "",
                        "entities": {
                            "description": {
                                "urls": []
                            }
                        },
                        "fast_followers_count": 0,
                        "favourites_count": 0,
                        "followers_count": 0,
                        "friends_count": 0,
                        "has_custom_timelines": true,
                        "is_translator": false,
                        "listed_count": 0,
                        "location": "",
                        "media_count": 0,
                        "name": "",
                        "normal_followers_count": 0,
                        "pinned_tweet_ids_str": [
                            ""
                        ],
                        "possibly_sensitive": false,
                        "profile_image_url_https": "",
                        "profile_interstitial_type": "",
                        "screen_name": "",
                        "statuses_count": 0,
                        "translator_type": "none",
                        "verified": false,
                        "want_retweets": false,
                        "withheld_in_countries": []
                    },
                    "professional": {
                        "rest_id": "",
                        "professional_type": "Creator",
                        "category": []
                    }
                }
            }
        },
        "unmention_data": {},
        "edit_control": {
            "edit_tweet_ids": [
                ""
            ],
            "editable_until_msecs": "",
            "is_edit_eligible": true,
            "edits_remaining": "5"
        },
        "is_translatable": true,
        "views": {
            "count": "",
            "state": "EnabledWithCount"
        },
        "source": "",
        "legacy": {
            "bookmark_count": 0,
            "bookmarked": false,
            "created_at": "",
            "conversation_control": {
                "policy": "Community",
                "conversation_owner_results": {
                    "result": {
                        "__typename": "User",
                        "legacy": {
                            "screen_name": ""
                        }
                    }
                }
            },
            "conversation_id_str": "",
            "display_text_range": [],
            "entities": {
                "hashtags": [],
                "symbols": [],
                "timestamps": [],
                "urls": [],
                "user_mentions": []
            },
            "favorite_count": 0,
            "favorited": false,
            "full_text": "",
            "is_quote_status": false,
            "lang": "",
            "limited_actions": "limited_replies",
            "quote_count": 0,
            "reply_count": 0,
            "retweet_count": 0,
            "retweeted": false,
            "user_id_str": "",
            "id_str": ""
        },
        "quick_promote_eligibility": {
            "eligibility": "IneligibleNotProfessional"
        }
    },
    "limitedActionResults": {
        "limited_actions": [
            {
                "action": "Reply",
                "prompt": {
                    "__typename": "CtaLimitedActionPrompt",
                    "cta_type": "SeeConversation",
                    "headline": {
                        "text": "Who can reply?",
                        "entities": []
                    },
                    "subtext": {
                        "text": "People the author mentioned can reply",
                        "entities": []
                    }
                }
            }
        ]
    }
}```

d60 commented

What method did you execute that caused the error?

d60 commented

I understand what you mean. And I fixed the glitch. Thank you very much!