Advertisement
xtekky_

Untitled

Aug 2nd, 2022
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.94 KB | None | 0 0
  1. import requests
  2. import threading
  3. import sys
  4.  
  5. videoid = "7126609694428253445"
  6. t = 0
  7. comm_num = 0
  8. lock = threading.Lock()
  9.  
  10. def print(args):
  11.     lock.acquire()
  12.     sys.stdout.write(args + "\n")
  13.     lock.release()
  14.  
  15. def check(videoid, t):
  16.     try:
  17.         headers = {
  18.             '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',
  19.             'referer': f'https://www.tiktok.com/@x/video/{videoid}',
  20.         }
  21.  
  22.         response = requests.get(
  23.             url = f"https://www.tiktok.com/api/comment/list/?aid=1988&aweme_id={videoid}&count=9999999&cursor={t}",
  24.             headers = headers
  25.         ).json()
  26.  
  27.         for x in range(len(response["comments"])):
  28.             print(response["comments"][x]["user"]["unique_id"])
  29.     except Exception as e:
  30.         pass
  31.  
  32. while True:
  33.     threading.Thread(target = check, args=[videoid, t]).start()
  34.     t += 50
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement