Open michaelmoreno opened 1 year ago
https://github.com/twintproject/twint/issues/1061#issuecomment-1010716112
After replacing the token.py file, twint can work normally
I have the same issue:
RefreshTokenException: Could not find the Guest token in HTML
Has the issue been resolved?
also have this error: twint.token.RefreshTokenException: Could not find the Guest token in HTML
replacing token.py with what? thanks
install twint (need install git) , dont't use pip install twint command.
pip3 install --user --upgrade git+https://github.com/twintproject/twint.git@origin/master#egg=twint
get file path
python.exe -c "import twint;print(twint.__file__);"
replace token.py file https://gist.github.com/moxak/ed83dd4169112a0b1669500fe855101a
wow ok many thanks. sorry tired & missed your link to the comment there.
does it work? because from 28 feb 2023 it always return Raising Exception Could not find the Guest token in HTML
it appears to be working, yes. had to change token.py file.
I still having error
RefreshTokenException Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_8280\828474447.py in <module>
4 c.Pandas=True
5 c.Lang = "id"
----> 6 twint.run.Search(c)
~\AppData\Roaming\Python\Python39\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")
~\AppData\Roaming\Python\Python39\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
~\AppData\Roaming\Python\Python39\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)
~\AppData\Roaming\Python\Python39\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
I am having the same issue and I have tried replacing token.py
I use python3.8.8, I don't know if it will help you
I still having error
RefreshTokenException Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_8280\828474447.py in <module> 4 c.Pandas=True 5 c.Lang = "id" ----> 6 twint.run.Search(c) ~\AppData\Roaming\Python\Python39\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") ~\AppData\Roaming\Python\Python39\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 ~\AppData\Roaming\Python\Python39\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) ~\AppData\Roaming\Python\Python39\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
what does your environment setup look like? When I was working with this issue in development I changed the token.py file that was in /venv folder in my project...had to do something else for production
I still having error
RefreshTokenException Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_8280\828474447.py in <module> 4 c.Pandas=True 5 c.Lang = "id" ----> 6 twint.run.Search(c) ~\AppData\Roaming\Python\Python39\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") ~\AppData\Roaming\Python\Python39\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 ~\AppData\Roaming\Python\Python39\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) ~\AppData\Roaming\Python\Python39\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
what does your environment setup look like? When I was working with this issue in development I changed the token.py file that was in /venv folder in my project...had to do something else for production
Have you tried replacing the files in the '~\AppData\Roaming\Python\Python39\site-packages\twint\' directory?
Attempting to run a trivial user search
Raising Exception
Could not find the Guest token in HTML
Python Version: 3.11 pip version: 23.0.1 twint version: 2.1.21 OS: MacOS Montery 12.6 (M2)
I have tried installing twint both through
pip install twint
andpip install --upgrade -e git+https://github.com/twintproject/twint.git@origin/master#egg=twint
Output of
pip list