iSarabjitDhiman / TweeterPy

TweeterPy is a python library to extract data from Twitter. TweeterPy API lets you scrape data from a user's profile like username, userid, bio, followers/followings list, profile media, tweets, etc.
MIT License
155 stars 24 forks source link

with_tweet_replies is still returning replies even if its value is set to False #72

Open raymelon opened 2 months ago

raymelon commented 2 months ago

Hi @iSarabjitDhiman! First of all, great job in building this package.

Upon using the package, I noticed that with_tweet_replies is still returning replies even if its value is set to False

I am using with_tweet_replies for get_tweet():

tweet_data = twitter.get_tweet(tweet_id, with_tweet_replies=False, end_cursor=None, total=1, pagination=True)

I also noticed that the replies are housed in threaded_conversation_with_injections_v2 The field shows up in the output if I set with_tweet_replies to False

On the other hand, the same field is not showing up in the output if I set with_tweet_replies to True The field where the replies are is in the itemContent field

While this does not break the main use of disabling with_tweet_replies which is to use the endpoint without a session, it still makes the output huge.

A temporary solution whould be checking "entries":[], finding every "content": {} block that has "__typename": "TimelineTimelineModule", and cleaning them out of the output.

I would like to know if anyone else is experiencing the same issue.

Let's have a discussion in this thread. Cheers everyone!