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

KeyError: 'user_id_str' #33

Open
linaki-org opened this issue Aug 10, 2024 · 1 comment
Open

KeyError: 'user_id_str' #33

linaki-org opened this issue Aug 10, 2024 · 1 comment

Comments

@linaki-org
Copy link

Hi !
While I was trying to upload a video using your example code (the one on the README), and I get the following error:

File "/home/videovortex/tiktok.py", line 9, in <module>
    uploadVideo(session_id, file, title, tags, verbose=True)
  File "/home/videovortex/Tiktok_uploader/__init__.py", line 74, in uploadVideo
    user_id = r.json()["data"]["user_id_str"]
KeyError: 'user_id_str'

Do you know why and how to fix it ?
Thanks

@linaki-org
Copy link
Author

By printing r.json() above this line in yout init.py, I see that the response is the following : {'data': {'description': 'session expired, please sign in again', 'name': 'session_expired'}, 'message': 'error'}.
But, on TikTok, my sessionId didn't changed and I am always logged in, so I don't think it's expired

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant