MiniGlome / Tiktok-uploader

Python3 script to upload and schedule TikTok videos
186 stars 25 forks source link

KeyError: 'user_id_str' #33

Open linaki-org opened 1 month ago

linaki-org commented 1 month ago

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 commented 1 month ago

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