Skip to content

What are the best practices for this package? #453

Closed Answered by davidteather
davidteather asked this question in Q&A
Discussion options

You must be logged in to vote
from TikTokApi import TikTokApi
import string
import random

proxy = "some_proxy_service_like_luminati.io"
custom_did = ''.join(random.choice(string.digits) for num in range(19))
# custom_did should be provided to all calls you intend to download a video from

# Class constructor to use a custom_did persistently, could lead to TikTok detecting that specific did
# I personally recommend re-generating it after you're done parsing a specific response from TikTok
api = TikTokApi.get_instance(use_test_endpoints=True, proxy=proxy, custom_did=custom_did)

# Usage
top_funny = api.byHashtag('funny')
for tiktok in top_funny:
    tiktok_bytes = api.get_Video_By_TikTok(tiktok)

# Class constructor wi…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by davidteather
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant