403 on all save_video calls
403 on all save_video calls
Hi, I'm getting a 403 error every time I try to download a TikTok video.
Code sample:
api
=
TikAPI(TIKAPI_KEY)
response
=
api.public.video(
id
=
tt_id)
tt_json
=
response.json()
filepath
=
f
'/tmp/tiktok/
{
tt_id
}
.mp4'
response.save_video(tt_json[
'itemInfo'
][
'itemStruct'
][
'video'
][
'downloadAddr'
], filepath)
Error:
Traceback (most recent call last):
File "/Users/adambowker/projects/recipebook-lambda/index.py", line 138, in <module>
print(download_tiktok('
https://www.tiktok.com/@clairehodginss/video/7298475366795234606?q=high%20protein%20chili%20recipe&t=1727737599817'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/adambowker/projects/recipebook-lambda/index.py", line 112, in download_tiktok
response.save_video(tt_json['itemInfo']['itemStruct']['video']['downloadAddr'], filepath)
File "/Users/adambowker/projects/recipebook-lambda/.venv/lib/python3.12/site-packages/tikapi/__init__.py", line 89, in save_video
raise exception
tikapi.api.ResponseException: Failed downloading video, received invalid status code: 403