Skip to content

KeyError: 'entries' #361

Open
Open
@s-vigneshwaran

Description

@s-vigneshwaran

await user.get_tweets('Tweets', count=20) throws this error. I'm sure this is a error for some handes and not all handles. Specifically handles with 0 tweets in their profiles.

File [~/anaconda3/envs/notebook/lib/python3.12/site-packages/twikit/user.py:170](http://localhost:8888/home/shankavn/anaconda3/envs/notebook/lib/python3.12/site-packages/twikit/user.py#line=169), in User.get_tweets(self, tweet_type, count)
    131 async def get_tweets(
    132     self,
    133     tweet_type: Literal['Tweets', 'Replies', 'Media', 'Likes'],
    134     count: int = 40,
    135 ) -> Result[Tweet]:
    136     """
    137     Retrieves the user's tweets.
    138 
   (...)
    168     ...
    169     """
--> 170     return await self._client.get_user_tweets(self.id, tweet_type, count)

File [~/anaconda3/envs/notebook/lib/python3.12/site-packages/twikit/client/client.py:1918](http://localhost:8888/home/shankavn/anaconda3/envs/notebook/lib/python3.12/site-packages/twikit/client/client.py#line=1917), in Client.get_user_tweets(self, user_id, tweet_type, count, cursor)
   1915     return Result([])
   1916 instructions = instructions_[0]
-> 1918 items = instructions[-1]['entries']
   1919 next_cursor = items[-1]['content']['value']
   1920 previous_cursor = items[-2]['content']['value']

KeyError: 'entries'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions