twintproject / twint

An advanced Twitter scraping & OSINT tool written in Python that doesn't use Twitter's API, allowing you to scrape a user's followers, following, Tweets and more while evading most API limitations.
MIT License
15.81k stars 2.73k forks source link

Still cannot get user info after editing the get.py following #769 #775

Closed Cheryl520 closed 4 years ago

Cheryl520 commented 4 years ago

I'm getting user information these days but i noticed it suddenly gave error messgages of "CRITICAL:root:twint.get:User:'NoneType' object is not subscriptable" this morning. And i noticed that there's change on the twitter end and there's change in the 'get.py'.

I followed the modification by deleting: r = await Request(url) and adding: r = await Request(url, headers={"X-Requested-With": "XMLHttpRequest"}) by editing the 'get.py' manually.

But it still doesn't work since "CRITICAL:root:twint.get:User:'NoneType' object is not subscriptable" still comes out.

kijames653 commented 4 years ago

Getting the same issue this morning :(

bulucemonkey commented 4 years ago

twitter's page which about use "user_id" to get user info is change ,maybe twint need to change the way, 'soup.find("a", "fn url alternate-context")["href"].replace("/", "")' need to fix,it isn't worked.

Cheryl520 commented 4 years ago

I have solved this problem by editing two places in the 'get.py' :

change line 163 to : r = await Request(url, headers={"X-Requested-With": "XMLHttpRequest"}) (refer to #769 )

change line 182 to : response = await Request(url, headers={"X-Requested-With": "XMLHttpRequest"}, connector=_connector) (refer to #772 )

bulucemonkey commented 4 years ago

thanks , your answer is rigtht

kijames653 commented 4 years ago

This is solved the issue; however, getting the same error when using with other options like "twint -u account_name --profile-full"

Any thought please !

pielco11 commented 4 years ago

Patch merged, please update with pip3 install --user --upgrade git+https://github.com/twintproject/twint.git@origin/master#egg=twint

mikaelyh commented 4 years ago

It was working until yesterday, but something else has been broken.

Someone having an idea ?

pielco11 commented 4 years ago

@mikaelyh solution in #863