TikTok-Api
TikTok-Api copied to clipboard
[BUG] - AttributeError: parent doesn't exist on TikTokApi.api.Video
Bug description
The code says that there's no parent/that this TikTok is not an duet or stitch of an TikTok and that's true. I just want to get the bytes from the video.
The buggy code
video = TikTokApi.video(url=url) # error here
videoName = video.as_dict
videoBytes = video.bytes()
with open("tiktok/video.mp4", "wb") as output:
output.write(videoBytes)
Expected behavior
I'm trying to get the Tiktok Video then getting the bytes and writing it to an mp4 file
![Screenshot 2022-07-05 at 5 22 47 PM](https://user-images.githubusercontent.com/40246197/177362886-8729f4c1-3a65-455a-98ea-ad4c9df3659e.png)
Laptop:
- OS: MacOS Monterey 12.4
- TikTokApi Version Up to date
It's not bugged, you have to first build the API object. Try:
api = TikTokApi()
video = api.video(url=url) # error here
videoName = video.as_dict
videoBytes = video.bytes()
with open("tiktok/video.mp4", "wb") as output:
output.write(videoBytes)
@keko950 still its not working, I am getting the following error. 'AttributeError: 'TikTokApi' object has no attribute 'video' '
I assume this is fixed in V6 lmk