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] - raise KeyError('name=%r, domain=%r, path=%r' % (name, domain, path)) KeyError: "name='ttwid', domain=None, path=None"

See original GitHub issue

Hi, I have a problem just with a basic exercise taken from the guide

from TikTokApi import TikTokApi

with TikTokApi() as api:
    user = api.user(username="therock")

    for video in user.videos():
        print(video.id)

    for liked_video in api.user(username="public_likes").videos():
        print(liked_video.id)

Despite reinstalling and installing tiktokAPI, I still get this

Traceback (most recent call last):
  File "C:\Users\matti\Desktop\s.py", line 6, in <module>
    for video in user.videos(get_all=True):
  File "C:\Users\matti\AppData\Local\Programs\Python\Python310\lib\site-packages\TikTokApi\api\user.py", line 133, in videos
    self.__find_attributes()
  File "C:\Users\matti\AppData\Local\Programs\Python\Python310\lib\site-packages\TikTokApi\api\user.py", line 263, in __find_attributes
    for u in self.parent.search.users(self.username):
  File "C:\Users\matti\AppData\Local\Programs\Python\Python310\lib\site-packages\TikTokApi\api\search.py", line 85, in search_type
    ttwid = spawn.cookies["ttwid"]
  File "C:\Users\matti\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\cookies.py", line 328, in __getitem__
    return self._find_no_duplicates(name)
  File "C:\Users\matti\AppData\Local\Programs\Python\Python310\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"

Do any of you know why this is so?

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:4
  • Comments:8

github_iconTop GitHub Comments

6reactions
demon071commented, Jun 3, 2022

find this line: ttwid = spawn.cookies[“ttwid”] in file C:\Users\matti\AppData\Local\Programs\Python\Python310\lib\site-packages\TikTokApi\api\search.py change it to ttwid = spawn.cookies.get_dict()[“ttwid”]

0reactions
hamza-topocommented, Nov 17, 2022

does anyone find a solution for that, im haing the same problem

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 >
Configuring custom domain names with AWS Chalice
In this post, we'll show how to associate your own domain name with a REST API we create. When deploying REST APIs with...
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