trevorhobenshield / twitter-api-client

Implementation of X/Twitter v1, v2, and GraphQL APIs
https://pypi.org/project/twitter-api-client
MIT License
1.59k stars 216 forks source link

tweets_and_replies(user_ids) invalid #183

Closed yousonnet closed 8 months ago

yousonnet commented 8 months ago

only return [{'data': {'user': {}}}]

trevorhobenshield commented 8 months ago

Can't seem to reproduce this response. Ensure the user is valid and your cookies are still valid. You can try setting debug to a nonzero value (incrementing = greater verbosity) to get more information as to why this might be happening.

yousonnet commented 8 months ago

@trevorhobenshield 2024-02-24 09:58:42.375 [DEBUG] :: remaining: 0/50 requests 2024-02-24 09:58:42.375 [DEBUG] :: reset: 13.77 minutes 2024-02-24 09:58:42.379 [DEBUG] :: Unique results: 2341 cursor: DAABCgABGHER-jK_--cKAAIWqHFppRqQAQgAAwAAAAIAAA 2024-02-24 09:58:42.750 [ERROR] :: Failed to log: Expecting value: line 1 column 1 (char 0) 2024-02-24 09:58:42.750 [ERROR] :: Failed to get pagination data Expecting value: line 1 column 1 (char 0) Cannot parse JSON response 'NoneType' object has no attribute 'json'

seems like get_json() processing a None in final.it's specific for me?

yousonnet commented 8 months ago

if i set limit = under the final request,the function works fine. but if i let it be default which is Math.inf,then will return error above

doffn commented 8 months ago

I am getting the same error. Most of the errors are on verified accounts

image

i am using this code:

data_new = scraper.tweets_and_replies(['2335075836'])

yousonnet commented 8 months ago

I am getting the same error. Most of the errors are on verified accounts

image

i am using this code:

data_new = scraper.tweets_and_replies(['2335075836'])

for now i'm using scraper.tweets_and_replies(user_ids,limit=50) to avoid this,which is not a perfectly solution. what's cause this is that get_json() function take a None as parameter to execute,it usually happend in last request of one time tweets_and_replies(). is twitter_api was modified after @trevorhobenshield create it ?

doffn commented 8 months ago

I am getting the same error. Most of the errors are on verified accounts image i am using this code: data_new = scraper.tweets_and_replies(['2335075836'])

for now i'm using scraper.tweets_and_replies(user_ids,limit=50) to avoid this,which is not a perfectly solution. what's cause this is that get_json() function take a None as parameter to execute,it usually happend in last request of one time tweets_and_replies(). is twitter_api was modified after @trevorhobenshield create it ?

I think so. I used to use nitter to scrape from for a while. They have officially said we are unable to provide tweets cause of the new change twitter made.