question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] - KeyError('name=%r, domain=%r, path=%r' % (name, domain, path)) KeyError: "name='ttwid', domain=None, path=None"

See original GitHub issue

Fill Out the template 😃

Describe the bug

A clear and concise description of what the bug is.

The buggy code

Please add any relevant code that is giving you unexpected results.

Preferably the smallest amount of code to reproduce the issue.

from TikTokApi import TikTokApi

api = TikTokApi(custom_verify_fp="***")

for video in api.trending.videos():
    print(video)

Expected behavior

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

Error Trace (if any)

Put the error trace below if there’s any error thrown.

  File "D:\Project\Python\tiktok\main.py", line 7, in <module>
    for video in api.trending.videos():
  File "D:\Project\Python\tiktok\venv\lib\site-packages\TikTokApi\api\trending.py", line 40, in videos
    ttwid = spawn.cookies["ttwid"]
  File "D:\Project\Python\tiktok\venv\lib\site-packages\requests\cookies.py", line 328, in __getitem__
    return self._find_no_duplicates(name)
  File "D:\Project\Python\tiktok\venv\lib\site-packages\requests\cookies.py", line 399, in _find_no_duplicates
    raise KeyError('name=%r, domain=%r, path=%r' % (name, domain, path))
KeyError: "name='ttwid', domain=None, path=None"

Desktop (please complete the following information):

  • OS: Windows 10
  • TikTokApi Version 5.0.0

Additional context

Add any other context about the problem here.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:9
  • Comments:15 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
dejlcommented, Feb 24, 2022

It’s most definitely not an IP detection issue at least on my end, surely. It was working fine with V4.x.x~ and suddenly stopped. If I hard code the ttwid in V5 from my browser instance (logged in to account), I get a captcha error though. api.user works for me but not user.videos()

1reaction
JorjanLLTcommented, Feb 24, 2022

Just so you’re aware it’s a problem with your IP getting detected so might be worth slowing down requests made

same error when use api.user(username=“***”)

i use different country proxy, most error as like “KeyError: “name=‘ttwid’, domain=None, path=None””

by the way ,when i use US proxy , its error like “TikTok blocks this request displaying a Captcha”

im confused

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] - raise KeyError('name=%r, domain=%r, path ... - GitHub
Hi, I have a problem just with a basic exercise taken from the guide from TikTokApi import TikTokApi with TikTokApi() as api: user ......
Read more >
What causes the Key Error:"name='AlteonP',domain=None ...
The error I am getting is raise KeyError('name=%r,domain=%r,path=%r'%(name,domain,path)) KeyError:"name='AlteonP',domain=None,path=None".
Read more >
Python KeyError: name - YouTube
Your browser can't play this video. Learn more. Switch camera.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found