-
-
Save shanselman/77b82fc9540263962cc5f750396764ac to your computer and use it in GitHub Desktop.
TikTok downloader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from TikTokApi import TikTokApi | |
import random | |
import string | |
proxy = "some_cool" | |
api = TikTokApi.get_instance(use_test_endpoints=True) | |
did = ''.join(random.choice(string.digits) for num in range(19)) | |
count = 500 | |
tiktoks = api.byUsername("shanselman", count=count, custom_did=did) | |
for index, tiktok in enumerate(tiktoks): | |
vid = api.get_Video_By_TikTok(tiktok, custom_did=did) | |
with open(str(index) + ".mp4", 'wb') as out: | |
out.write(vid) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment