Skip to content
This repository has been archived by the owner on Mar 30, 2023. It is now read-only.

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

Open
the-data-mogul opened this issue Jan 20, 2021 · 13 comments

Comments

@the-data-mogul
Copy link

Hi,

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

Thank you!

@Altimis
Copy link

Altimis commented Jan 21, 2021

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
Copy link

mateuszbaransanok commented Jan 21, 2021

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
Copy link
Author

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
Copy link

dpakpdl commented Mar 17, 2021

This might help you. Check it

@olivermj3
Copy link

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
Copy link

rangersmyth74 commented Dec 30, 2021

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] (#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
Copy link

same issue for me

@SlasherZer0
Copy link

I'm having the same issue

@aragig
Copy link

aragig commented Jan 9, 2022

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
Copy link

same for me

@afai79
Copy link

afai79 commented Jan 14, 2022

Same for me

@SeifHediya
Copy link

same for me

@HossamBalaha
Copy link

Step to overcome this issue:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests