TikTok-Api icon indicating copy to clipboard operation
TikTok-Api copied to clipboard

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

Open Otorhin opened this issue 3 years ago • 15 comments

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.

Otorhin avatar Feb 14 '22 09:02 Otorhin

I have same problem

blackWhaleDev avatar Feb 20 '22 15:02 blackWhaleDev

same story

akorchyn avatar Feb 20 '22 18:02 akorchyn

Same problem

Lossfull avatar Feb 20 '22 22:02 Lossfull

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

davidteather avatar Feb 23 '22 00:02 davidteather

Same here Fails even with passing ttwid to kwargs

But api.user(username=X) works and returns user ID etc..

dejl avatar Feb 23 '22 10:02 dejl

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

JorjanLLT avatar Feb 24 '22 03:02 JorjanLLT

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()

dejl avatar Feb 24 '22 13:02 dejl

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()

yes its user.videos() not work, but api.user work fine. Also v4 work fine on monday... but now not work./sad

JorjanLLT avatar Feb 25 '22 06:02 JorjanLLT

I have same problem

impossibleno1 avatar Feb 26 '22 07:02 impossibleno1

i have same problem

baodv1001 avatar Feb 27 '22 09:02 baodv1001

I have the same problem

Incher25 avatar Feb 28 '22 03:02 Incher25

I have the same problem

bjtuweb-12281047 avatar Mar 09 '22 04:03 bjtuweb-12281047

I have the same problem

krusalovorg avatar Mar 16 '22 12:03 krusalovorg

I have the same problem, API request to TikTok 403 response code, the server blocked the request

djcarrillo avatar Apr 25 '22 15:04 djcarrillo

Same here, running from local PC

thedevale avatar Aug 04 '22 11:08 thedevale

Use V6

davidteather avatar Aug 08 '23 22:08 davidteather