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.64k stars 2.72k forks source link

twint.token.RefreshTokenException: Could not find the Guest token in HTML #1114

Open the-data-mogul opened 3 years ago

the-data-mogul commented 3 years ago

Hi,

I still have not been able to find a solution for this. Any help would be greatly appreciated.

Thank you!

Altimis commented 3 years ago

Hi. I dont know if this could help you, but I recently implemented this code that scrapes almost all kind of infos on Twitter.

mateuszbaransanok commented 3 years ago

Hi. I dont know if this could help you, but I recently implemented this code that scrapes almost all kind of infos on Twitter.

Hi, I have a list of tweet urls and I need scrap count of likes, comments and retweets. How i can do that via your lib?

the-data-mogul commented 3 years ago

Hi. I dont know if this could help you, but I recently implemented this code that scrapes almost all kind of infos on Twitter.

Hi Yassine, we have spoken before brother. I know about your tool, sadly I need to collect data using the location feature from Twint using Latitude and Longitude. I don't think your tool has that feature as of yet. Correct me if I am wrong please.

dpakpdl commented 3 years ago

This might help you. Check it

olivermj3 commented 2 years ago

I was running into this most of today as well running Jupyter notebook, python 3.6 and at 3.8, w anaconda package installer. I created a new environment just for this task, python 3.8:

pip3 install twint pip3 install --user --upgrade git+https://github.com/twintproject/twint.git@origin/master#egg=twint

On restart of kernel and change of IP address via VPN/proxy, it started working briefly (16 tweets), then back to the same issue.

Here is my most recent full print out after last tweet (tweet 16) collected:

[!] No more data! Scraping will stop now. found 0 deleted tweets in this search.

RefreshTokenException Traceback (most recent call last) /var/folders/7z/866jzymn52zcbnymflj7xhbw0000gn/T/ipykernel_6392/906502173.py in 7 filename = str(str(target)+".csv") 8 c.Output = filename ----> 9 twint.run.Search(c)

~/.local/lib/python3.8/site-packages/twint/run.py in Search(config, callback) 408 config.Followers = False 409 config.Profile = False --> 410 run(config, callback) 411 if config.Pandas_au: 412 storage.panda._autoget("tweet")

~/.local/lib/python3.8/site-packages/twint/run.py in run(config, callback) 327 raise 328 --> 329 get_event_loop().run_until_complete(Twint(config).main(callback)) 330 331

~/.local/lib/python3.8/site-packages/twint/run.py in init(self, config) 34 # USAGE : to get a new guest token simply do self.token.refresh() 35 self.token = token.Token(config) ---> 36 self.token.refresh() 37 self.conn = db.Conn(config.Database) 38 self.d = datelock.Set(self.config.Until, self.config.Since)

~/.local/lib/python3.8/site-packages/twint/token.py in refresh(self) 67 else: 68 self.config.Guest_token = None ---> 69 raise RefreshTokenException('Could not find the Guest token in HTML')

RefreshTokenException: Could not find the Guest token in HTML

rangersmyth74 commented 2 years ago

I am having the same issue on Dec 28, 2021.

I can't get it to work on Kali - the latest version with everything I need. I can get it to work using Google Shell, but after one or two goes, I get the same error. A token,

I have documented my journey here >> https://kali-ranger.blogspot.com/2021/12/kali-linux-help-for-how-to-install.html

File "/home/rangersmyth_74/.local/lib/python3.7/site-packages/twint/token.py", line 69, in refresh raise RefreshTokenException('Could not find the Guest token in HTML') twint.token.RefreshTokenException: Could not find the Guest token in HTML

I followed along with this post [1146] (https://github.com/twintproject/twint/pull/1146)

I am now going to install https://github.com/Altimis/Scweet scraper to see if that works for me.

Is there any fix for this please? I've spent 7 hours researching using 3 machines?

Do I need a token from twint to search every time? Do I need a token from Twitter? Are they blocking my attempt at scraping from Twitter?

What I am going to do next anyway is to delete twint and everything to do with it, and try the install a week or two into the future where it may be fixed.

Thanks in advance.

zine-eddine27 commented 2 years ago

same issue for me

SlasherZer0 commented 2 years ago

I'm having the same issue

aragig commented 2 years ago

Twint can no longer be used from around January 5th. Did the usage on the Twitter side change? Is there any solution?

The error is: File "/Users/hogehoge/Library/Python/3.9/lib/python/site-packages/twint/token.py", line 69, in refresh raise RefreshTokenException('Could not find the Guest token in HTML') twint.token.RefreshTokenException: Could not find the Guest token in HTML

Gryshchuk commented 2 years ago

same for me

afai79 commented 2 years ago

Same for me

SeifHediya commented 2 years ago

same for me

HossamBalaha commented 2 years ago

Step to overcome this issue: