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

find the Guest token in HTML #1075

Merged
merged 1 commit into from
Dec 17, 2020
Merged

find the Guest token in HTML #1075

merged 1 commit into from
Dec 17, 2020

Conversation

ajctrl
Copy link
Contributor

@ajctrl ajctrl commented Dec 16, 2020

fix issue #1061

@ajctrl ajctrl changed the title Update token.py find the Guest token in HTML Dec 16, 2020
innocentius added a commit to innocentius/twint that referenced this pull request Dec 17, 2020
@pielco11 pielco11 merged commit 4b30fa3 into twintproject:master Dec 17, 2020
@ajctrl ajctrl deleted the patch-1 branch December 17, 2020 12:22
yentowngarden added a commit to yentowngarden/twint that referenced this pull request Jun 28, 2021
@karinorz
Copy link

why the patch-1 has to be deleted? I got error message due to it

WARNING: Did not find branch or tag 'patch-1', assuming revision or ref.

@CuFFaz
Copy link

CuFFaz commented Dec 28, 2021

Did you find a workaround to this?

@MINIMALaq
Copy link

I have the same isuue from 2 weeks ago.

@Silvthril
Copy link

Really need to figure the solution to this twint.token.RefreshTokenException: Could not find the Guest token in HTML

@MINIMALaq
Copy link

@Silvthril
Copy link

you can use this pr: https://github.com/Museum-Barberini/twint/tree/fix/RefreshTokenException

Ty for the suggestion. I'm a bit of a GitHub noobie. How can I update Twint properly with the link you provided?

I tried just copying the token.py file found in the link you gave but I broke it worse so I reverted the changes.

@Silvthril
Copy link

Silvthril commented Jan 7, 2022

I tried switching the branches on my local machine with git checkout -b Fix/RefreshTokenException which results in successfully switching branches message Switched to a new branch 'fix/RefreshTokenException'.

However after running a simple twint command such as python twint -s "apple" the result is the same as prior to switching from the Master branch File "/home/ark/Tools/tradecraft/OSINT/Twint/twint", line 33, in <module> sys.exit(load_entry_point('twint==2.1.21', 'console_scripts', 'twint')()) File "/home/ark/Tools/tradecraft/OSINT/Twint/src/twint/twint/cli.py", line 339, in run_as_command main() File "/home/ark/Tools/tradecraft/OSINT/Twint/src/twint/twint/cli.py", line 330, in main run.Search(c) File "/home/ark/Tools/tradecraft/OSINT/Twint/src/twint/twint/run.py", line 410, in Search run(config, callback) File "/home/ark/Tools/tradecraft/OSINT/Twint/src/twint/twint/run.py", line 329, in run get_event_loop().run_until_complete(Twint(config).main(callback)) File "/home/ark/Tools/tradecraft/OSINT/Twint/src/twint/twint/run.py", line 36, in __init__ self.token.refresh() File "/home/ark/Tools/tradecraft/OSINT/Twint/src/twint/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

A tidbit more information on my particular install >> I use Garuda Linux; Love it! I installed twint via pip over 6 months ago. I wanted to utilize it in a more accessible file rather than navigating to the .local/bin/src location where my setup installs pip programs. To achieve this I created a simple directory as you can see in the output above that contains a symlink to the .local/bin/src location.

This issue started a few weeks ago. I use two text files and a loop.sh program to loop search terms together I call '''keywords''' & catalysts in order to have a nice boolean feature with this program. It worked great for a long time. Then out of about 100 or so search term pairs about 10% would hit this error listed above. A few days ago I was running a simple task just python twint -s "keyword" where I would have to attempt to run the command about 5 times before it would run passing through his GuestToken error. Yesterday and today it's completely useless and I can't find a workaround or perhaps I'm not knowledgeable enough to effectively understand/utilize a workaround that may exist.

@Silvthril
Copy link

Silvthril commented Jan 7, 2022

SOLVED:

Ok. So what I did in my initial comment copying the token.py file found @ https://github.com/Museum-Barberini/twint/tree/fix/RefreshTokenException did not work because I edited the token.py file at the .local/bin/src location described in my second comment. This is because, as mentioned the location I run the program out of (and surprisingly even if I try running twint out of the .local/bin/src location) runs the program out of the directory I made where there is a symlink pointing to that .local/bin/src location. Now, this is just a hunch based on the solution I discovered which I will list below but I think that this did not work because I would need to have updated the symlink?

What solved the problem was repeating the same thing but this time I updated the src file located in the directory I created home/ark/Tools/tradecraft/OSINT/Twint/twint >> full path to token.py >> /home/ark/Tools/tradecraft/OSINT/Twint/src/twint/twint << <<

Now, why do I need the twint src code in this directory if it should be retrieving the src code from the symlink I created? I have no idea BUT twint wont work PERIOD in this easier to navigate to directory without both the symlink and the code contained within. Super strange I set it up over 6 months ago so I don't recall why I had to do this but yeah. There it is. Thank you for your help @MINIMALaq !

SOLUTION SUMMARY:

Overwrite your existing token.py file with the file contents contained here: https://github.com/Museum-Barberini/twint/blob/fix/RefreshTokenException/twint/token.py

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

Successfully merging this pull request may close these issues.

6 participants