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

HELP!!! Could not find the Guest token in HTML! #1324

Open
LUCKLIKECLOUD opened this issue Jan 5, 2022 · 4 comments
Open

HELP!!! Could not find the Guest token in HTML! #1324

LUCKLIKECLOUD opened this issue Jan 5, 2022 · 4 comments

Comments

@LUCKLIKECLOUD
Copy link

Issue

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/bin/twint", line 33, in
sys.exit(load_entry_point('twint==2.1.21', 'console_scripts', 'twint')())
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/twint/cli.py", line 339, in run_as_command
main()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/twint/cli.py", line 330, in main
run.Search(c)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/twint/run.py", line 410, in Search
run(config, callback)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/twint/run.py", line 329, in run
get_event_loop().run_until_complete(Twint(config).main(callback))
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/twint/run.py", line 36, in init
self.token.refresh()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/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

Initial Check

Description of Issue

Haven't been able to mine data on Twitter

Environment Details

Using macOS 11.6 Terminal
Using Python version is 3.9.9
Using VPN(Based in China)

@StuartRucker
Copy link

Same as #1320. It looks like it might be a recent issue. Also getting this on ubuntu VM, and mac with no VPN

@xXedwardXx
Copy link

It looks like this amendment to the token.py file fixes the issue:

#1320 (comment)

@MirunaClinciu
Copy link

Overwrite "token.py" with this => https://github.com/Museum-Barberini/twint/edit/fix/RefreshTokenException/twint/token.py

  1. My first step was to install/reinstall twint which failed.

  2. After I used the following libraries (not sure if it was useful):
    import nest_asyncio
    nest_asyncio.apply()
    import twint
    import requests
    res = requests.get('https://twitter.com')
    print(res.text.split('\n')[-1])

  3. I installed a VPN (ProtonVPN), not sure if it was the best one etc and I am open to other suggestions.

  4. I overwrite the file token.py with a different version. The one that I shared here worked.

aburyak added a commit to wl-lab/twint that referenced this issue Jan 16, 2022
fix Could not find the Guest token in JSON issue

taken from twintproject#1324
gurcankavakci added a commit to gurcankavakci/twint that referenced this issue Jan 18, 2022
@Meenu-Jain
Copy link

for me not working either

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

5 participants