Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No guest token found after five retry #23

Closed
cykac04 opened this issue Dec 17, 2021 · 2 comments
Closed

No guest token found after five retry #23

cykac04 opened this issue Dec 17, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@cykac04
Copy link

cykac04 commented Dec 17, 2021

Describe the bug

Traceback (most recent call last):
File "/home/.local/bin/twspace_dl", line 8, in
sys.exit(main())
File "/home/.local/lib/python3.9/site-packages/twspace_dl/main.py", line 145, in main
twspace_dl.download()
File "/home/.local/lib/python3.9/site-packages/twspace_dl/TwspaceDL.py", line 224, in download
metadata = self.metadata
File "/usr/lib/python3.9/functools.py", line 969, in get
val = self.func(instance)
File "/home/.local/lib/python3.9/site-packages/twspace_dl/TwspaceDL.py", line 133, in metadata
"x-guest-token": self.guest_token(),
File "/home/.local/lib/python3.9/site-packages/twspace_dl/TwspaceDL.py", line 104, in guest_token
raise RuntimeError("No guest token found after five retry")
RuntimeError: No guest token found after five retry

To Reproduce
command you entered

Expected behavior
A clear and concise description of what you expected to happen.

Output
If applicable, add the output of the command to help explain your problem.

here

Desktop (please complete the following information):

  • OS: [e.g. Windows]
  • Version [e.g. 2021.12.10.1]
  • Installation method (binary, pip, or other)

Additional context
solution:

authConstant = 'Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA'

def auth():
headers = {'authorization': authConstant}
rep = s.post('https://api.twitter.com/1.1/guest/activate.json', headers=headers)
return {'authorization': authConstant, 'x-guest-token': rep.json()['guest_token']}, time.time()

@cykac04 cykac04 added the bug Something isn't working label Dec 17, 2021
@Ryu1845
Copy link
Collaborator

Ryu1845 commented Dec 17, 2021

It usually fixes itself if you launch the command again. I think just adding a delay between the retries should fix it. I'll still look into your solution though. Thank you.

@Ryu1845
Copy link
Collaborator

Ryu1845 commented Dec 17, 2021

Also please use the template appropriately next time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants