-
-
Save davidteather/02e8d4adf8893ab319a2a7dfb5dbcf19 to your computer and use it in GitHub Desktop.
Example code for davidteather/TikTok-Api issue #10
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 sys | |
# Starts The Api Class | |
api = TikTokapi("browsermob-proxy/bin/browsermob-proxy") | |
# The Number of trending TikToks you want to be displayed | |
results = sys.argv[2] | |
# Searches for the top trending hashtag of TikTok | |
result = api.search_by_hashtag(sys.argv[1]) | |
for tiktok in result: | |
# Prints the video id of the tiktok | |
print(tiktok['itemInfos']['id']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment