You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying the user example without changing anything, but I am getting a KeyError.
async def user_example():
async with TikTokApi() as api:
await api.create_sessions(ms_tokens=[ms_token], num_sessions=1, sleep_after=3)
user = api.user("therock")
user_data = await user.info()
print(user_data)
async for video in user.videos(count=30):
print(video)
print(video.as_dict)
This is the starter example code to get a user.
line 24, in
asyncio.run(user_example())
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/Users/selimbayar/Desktop/testTiktok.py", line 13, in user_example
user_data = await user.info()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/TikTokApi/api/user.py", line 87, in info
self.__extract_from_data()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/TikTokApi/api/user.py", line 204, in __extract_from_data
data["userInfo"]["user"]["id"],
KeyError: 'id'
This is the error message. Is this an error on the Api end?
The text was updated successfully, but these errors were encountered:
For me personally it seems to be happening on certain users. Although I get an error that "data["userInfo"]["user"]["id"]" KeyError: 'user'.
Not entirely sure what the issue is, for me the userInfo is completely empty for a certain account that I am fetching videos from. I checked that the account does not have any restrictions or privated videos.
I am trying the user example without changing anything, but I am getting a KeyError.
async def user_example():
async with TikTokApi() as api:
await api.create_sessions(ms_tokens=[ms_token], num_sessions=1, sleep_after=3)
user = api.user("therock")
user_data = await user.info()
print(user_data)
This is the starter example code to get a user.
line 24, in
asyncio.run(user_example())
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/Users/selimbayar/Desktop/testTiktok.py", line 13, in user_example
user_data = await user.info()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/TikTokApi/api/user.py", line 87, in info
self.__extract_from_data()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/TikTokApi/api/user.py", line 204, in __extract_from_data
data["userInfo"]["user"]["id"],
KeyError: 'id'
This is the error message. Is this an error on the Api end?
The text was updated successfully, but these errors were encountered: