taspinar / twitterscraper

Scrape Twitter for Tweets
MIT License
2.39k stars 581 forks source link

Problem with twitter front-page ban #337

Open sm-ghavami opened 3 years ago

sm-ghavami commented 3 years ago

Some changes to bypass twitter restrictions

neuensjohn commented 3 years ago

Tested, this worked great for me. Thanks!

narain1 commented 3 years ago

works for me too

renatocron commented 3 years ago

worked for me too, only after patch.

LeoVS09 commented 3 years ago

Works for me, when this changes will be released?

renatocron commented 3 years ago

I don't know about this, I'm just testing today as beginner, every few tweets I got one from GamesRedDeer with tweet promoting a giveaway. With or without proxy. is this the expected result? it's always 1293568121329061889, no matter what query I do

https://twitter.com/GamesRedDeer/status/1293568121329061889

This is only happening when -c is passed (CSV), 1293568121329061889 is not found on the json file.

sspartzz257 commented 3 years ago

Can anyone provide a guide for someone new on how to use this commit request?

renatocron commented 3 years ago

click on files tab, then a diff will appear. on the right side, click on the three dots icon and click on "show file", the full file will load, then you search the "show raw" and open it, then copy all the content over the same file on your machine.

python cares for white spaces, that's why you should carefully copy the exactly file (you can download via wget/curl)

if you are running via docker, you should rebuild the image before running the command client.

On Thu, Aug 13, 2020, 21:18 sspartzz257 notifications@github.com wrote:

Can anyone provide a guide for someone new on how to use this commit request?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/taspinar/twitterscraper/pull/337#issuecomment-673771673, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOUQZEE2V5Q5CMNUH2QNETSAR7FDANCNFSM4P44VMMQ .

sspartzz257 commented 3 years ago

Test and works for me

christiangfv commented 3 years ago

How I can implement this solution without modifying the module ?

victorgois commented 3 years ago

Worked as well. Thanks!

wajonespress commented 3 years ago

This worked a few times, and then I get this error message and only a fraction of my limit.

Failed to parse JSON while requesting "https://twitter.com/i/search/timeline?f=tweets&vertical=default&include_available_features=1&include_entities=1&reset_error_state=false&src=typd&max_position=thGAVUV0VFVBaAwKqhpsTgySEWgoCogZGk3sohEjUAFQAlAFUAFQAVARUAFQAA&q=arson%20OR%20firebug%20since%3A2019-12-12%20until%3A2019-12-26&l=english" Traceback (most recent call last): File "/opt/anaconda3/lib/python3.8/site-packages/twitterscraper/query.py", line 109, in query_single_page html = json_resp['items_html'] or '' KeyError: 'items_html'

I also get errors for line 104 and 182 which doesn't resolve until a reinstall twitterscraper and the commit request.

Can anyone help? I'm a first time coder. Very, very new to this stuff.

GivenToFlyCoder commented 3 years ago

Thanks! I'm using Query Search with User Search, this work for a while, sometimes i get a lot of tweets and sometimes i get 0 tweets!

Sometimes i repeat the searches with the same keywords, Accounts and dates, and a i get different tweets.

HARDROCO commented 3 years ago

Thanks! I'm using Query Search with User Search, this work for a while, sometimes i get a lot of tweets and sometimes i get 0 tweets!

Sometimes I repeat the searches with the same keywords, Accounts, and dates, and a i get different tweets.

yeah same for me, I put the patch code and apparently the limit parameter doesn't work fine for instance I put "limit = 5" and I retrieve 142 tweets

HARDROCO commented 3 years ago

Getting 0 tweets still after updating this query.py file with the provided changes . Could anyone please explain how to implement the changes step wise. Thanks

don't worry, you have to go here https://github.com/taspinar/twitterscraper/pull/337/commits/2233682b3c04840531a94ba8ee3c3325d7bf6b4a

copy the green code lines and replace the red code lines in your query.py file and save it that's all and make sure to create a copy before do it

rizkysifaul commented 3 years ago

Getting 0 tweets still after updating this query.py file with the provided changes . Could anyone please explain how to implement the changes step wise. Thanks

don't worry, you have to go here 2233682

copy the green code lines and replace the red code lines in your query.py file and save it that's all and make sure to create a copy before do it

Thank you so much, I can do scraping normally, with changing some code on query.py. Actually it is not stable because after succeeding at the first attempt, I got 0 tweets after that.

LinqLover commented 3 years ago

Thanks for the PR! Anyone else receiving improper tweets (could be sponsored material) since using this patch?

Edit: Hm, the issue is even older. I just opened #342 for it. Still, our number of unmatching tweets has raised significantly since applying this PR ...

jason1991220 commented 3 years ago

It doesn't work again. Return 0 tweet.

Nellix commented 3 years ago

I confirm that it is not working anymore since this midnight 18-09-2020.

jason1991220 commented 3 years ago

I confirm that it is not working anymore since this midnight 18-09-2020.

404 error with init_url, anyone knows how to fix if?

INIT_URL = 'https://twitter.com/i/search/timeline?f=tweets&vertical=' \ 'default&include_available_features=1&include_entities=1&' \ 'reset_error_state=false&src=typd&max_position=-1&q={q}&l={lang}'

rhz commented 3 years ago

I get this ERROR:twitterscraper:An unknown error occurred! Returning tweets gathered so far.

gautampal1947 commented 3 years ago

Some changes to bypass twitter restrictions

Seems this solution is NOT working again :-(