Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import threading
- import sys
- videoid = "7126609694428253445"
- t = 0
- comm_num = 0
- lock = threading.Lock()
- def print(args):
- lock.acquire()
- sys.stdout.write(args + "\n")
- lock.release()
- def check(videoid, t):
- try:
- headers = {
- 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36',
- 'referer': f'https://www.tiktok.com/@x/video/{videoid}',
- }
- response = requests.get(
- url = f"https://www.tiktok.com/api/comment/list/?aid=1988&aweme_id={videoid}&count=9999999&cursor={t}",
- headers = headers
- ).json()
- for x in range(len(response["comments"])):
- print(response["comments"][x]["user"]["unique_id"])
- except Exception as e:
- pass
- while True:
- threading.Thread(target = check, args=[videoid, t]).start()
- t += 50
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement