Advertisement
kpntool

cmttdsdl

Aug 8th, 2022 (edited)
428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 10.60 KB | None | 0 0
  1. import os, requests as ss
  2. from time import sleep
  3. import os.path
  4. import json
  5. from os import path
  6. os.system("clear")
  7. ktra=path.exists("api_tds.txt")
  8. if ktra==True:
  9.         #print(user)
  10.     sua=input(f"\033[37;1mBạn có muốn sửa api không (y/n): \033[32;1m")
  11.     if sua=="y":
  12.         os.remove("api_tds.txt")
  13.         a=open('api_tds.txt','w')
  14.         api=input("\033[37;1mNhập api TDS: \033[32;1m")
  15.         a.write(api)
  16.         a.close()
  17.     else:
  18.         a=open('api_tds.txt','r')
  19.         api=a.readline()
  20. else:
  21.     a=open('api_tds.txt','w')
  22.     api=input("\033[37;1mNhập api TDS: \033[32;1m")
  23.     a.write(api)
  24.     a.close()
  25.  
  26. ktra=path.exists("ua_kpn.txt")
  27. if ktra==True:
  28.     c=open('ua_kpn.txt','r')
  29.     ua=c.readline()
  30. else:
  31.     c=open('ua_kpn.txt','w')
  32.     ua=input("\033[37;1mNhập user_agent: \033[32;1m")
  33.     c.write(ua)
  34.     c.close()
  35.  
  36. head = {
  37. "host":"traodoisub.com",
  38. "content-type":"application/x-www-form-urlencoded; charset=UTF-8",
  39. "user-agent":ua,
  40. }
  41.  
  42. os.system("clear")
  43.  
  44. print("\033[32;1mTOOL TDS TIKTOK BY KPN".center(60))
  45. print("\033[33;1m▪\033[32;1m▪\033[31;1m▪\033[36;1m▪"*15)
  46.  
  47. ktra=path.exists("ck_kpn.txt")
  48. if ktra==True:
  49.         #print(user)
  50.     sua=input(f"\033[37;1mBạn có muốn sửa cookie không (y/n): \033[32;1m")
  51.     if sua=="y":
  52.         os.remove("ck_kpn.txt")
  53.         b=open('ck_kpn.txt','w')
  54.         cookie=input("\033[37;1mNhập cookie: \033[32;1m")
  55.         b.write(cookie)
  56.         b.close()
  57.     else:
  58.         b=open('ck_kpn.txt','r')
  59.         list = b.read().splitlines()
  60. else:
  61.     b=open('ck_kpn.txt','w')
  62.     cookie=input("\033[37;1mNhập cookie: \033[32;1m")
  63.     b.write(cookie)
  64.     b.close()
  65. def cauhinh(cookie,api,i):
  66.     head_chh= {
  67.         'Accept': '*/*',
  68.         'Accept-Language': 'vi-VN,vi;q=0.9',
  69.         'Connection': 'keep-alive',
  70.         'Cookie': cookie,
  71.         'Origin': 'https://www.tiktok.com',
  72.         'Referer': 'https://www.tiktok.com/',
  73.         'Sec-Fetch-Dest': 'empty',
  74.         'Sec-Fetch-Mode': 'cors',
  75.         'Sec-Fetch-Site': 'same-site',
  76.         'User-Agent':ua,
  77.         'content-type': 'application/x-www-form-urlencoded',
  78.         'sec-ch-ua': '".Not/A)Brand";v="99", "Google Chrome";v="103", "Chromium";v="103"',
  79.         'sec-ch-ua-mobile': '?0',
  80.         'sec-ch-ua-platform': '"Linux"',
  81.     }
  82.     a=ss.get('https://www.tiktok.com/passport/web/account/info/?aid=1459&app_language=vi-VN&app_name=tiktok_web&battery_info=0.48&browser_language=vi-VN&browser_name=Mozilla&browser_online=true&browser_platform=Linux%20armv8l&browser_version=5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F86.0.4240.198%20Safari%2F537.36&channel=tiktok_web&cookie_enabled=true&device_id=7086378675985974827&device_platform=web_pc&focus_state=true&from_page=video&history_len=1&is_fullscreen=false&is_page_visible=true&os=windows&priority_region=VN&referer=&region=VN&screen_height=780&screen_width=360&tz_name=Asia%2FSaigon&verifyFp=verify_0c253cb955b80adc6d83ca7715c47138&webcast_language=vi-VN',headers=head_chh).json()
  83.     name=a['data']['user_id']
  84.     ten=a['data']['username']
  85.     datch=ss.get(f"https://traodoisub.com/api/?fields=tiktok_run&id={name}&access_token={api}",headers=head).json()
  86.     if "success" in datch:
  87.         print(f"\033[37;1mĐặt acc {i} cấu hình\033[32;1m",name,"<=>",ten,"\033[32;1mthành công")
  88.     else:
  89.         print(f"\033[37;1mĐặt acc {i} cấu hình\033[31;1m",name,"<=>",ten,"\033[31;1mthất bại")
  90.        
  91.  
  92.  
  93. delay=int(input("\033[37;1mNhập delay: \033[32;1m"))
  94. os.system("clear")
  95. print("\033[32;1mTOOL TDS TIKTOK BY KPN".center(60))
  96. h=0
  97. #tt_token=cookie.split('tt_csrf_token=')[1].split(';')[0]
  98. def cmt(cookie,id,ndcmt,tt_token,xtoken,name):
  99.     head_cmt = {
  100.     'authority': 'www.tiktok.com',
  101.     'accept': '*/*',
  102.     'accept-language': 'vi-VN,vi;q=0.9,fr-FR;q=0.8,fr;q=0.7,en-US;q=0.6,en;q=0.5',
  103.     'content-type': 'application/x-www-form-urlencoded',
  104.     'cookie': cookie,
  105.     'origin': 'https://www.tiktok.com',
  106.     'referer': 'https://www.tiktok.com/@toeicdoclacungsec/video/7123952252527660315',
  107.     'sec-ch-ua': '".Not/A)Brand";v="99", "Google Chrome";v="103", "Chromium";v="103"',
  108.     'sec-ch-ua-mobile': '?0',
  109.     'sec-ch-ua-platform': '"Windows"',
  110.     'sec-fetch-dest': 'empty',
  111.     'sec-fetch-mode': 'cors',
  112.     'sec-fetch-site': 'same-origin',
  113.     'tt-csrf-token': tt_token,
  114.     'user-agent': ua,
  115.     'x-secsdk-csrf-token': xtoken,
  116.     }
  117.     cmt=ss.post(f"https://www.tiktok.com/api/comment/publish/?aid=1988&app_language=vi-VN&app_name=tiktok_web&aweme_id={id}&battery_info=0.48&browser_language=vi-VN&browser_name=Mozilla&browser_online=true&browser_platform=Linux%20armv8l&browser_version=5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F86.0.4240.198%20Safari%2F537.36&channel=tiktok_web&cookie_enabled=true&device_id={name}&device_platform=web_pc&focus_state=true&from_page=video&history_len=2&is_fullscreen=false&is_page_visible=true&os=windows&priority_region=VN&referer=&region=VN&screen_height=780&screen_width=360&text={ndcmt}&text_extra=%5B%5D&tz_name=Asia%2FSaigon&webcast_language=vi-VN",headers=head_cmt).json()
  118.     check=cmt['status_msg']
  119.     print(f"\033[37;1m[\033[32;1m{ndcmt}\033[37;1m][\033[32;1m{check}\033[37;1m]")
  120.  
  121. def nhan_cmt(idd,api,thanh,nx):
  122.     nhan=ss.get(f'https://traodoisub.com/api/coin/?type=TIKTOK_COMMENT&id={idd}&access_token={api}').json()
  123.     if "success" in nhan:
  124.         print(f"{thanh} \n• {nx} \033[37;1m• +1000 =>",nhan['data']['xu'])
  125.     if "error" in nhan:
  126.         print(f"{thanh} \n• {nx} \033[37;1m•",nhan['error'])
  127.  
  128. with open('ck_kpn.txt') as f:
  129.     size=len([0 for _ in f])
  130.     soacc=int(size)
  131.  
  132. while True:
  133.     for i in range(1,int(soacc)+1):
  134.         c=i-1
  135.         b=open('ck_kpn.txt','r')
  136.         list = b.read().splitlines()
  137.         cookie=list[c]
  138.         head_x = {
  139.         'Host':'www.tiktok.com',
  140.         'Accept': '*/*',
  141.         'Cookie': cookie,
  142.         'x-secsdk-csrf-version':'1.2.7',
  143.         'accept-encoding': 'gzip, deflate, br',
  144.         'accept-language': 'vi,en;q=0.9,vi-VN;q=0.8,fr-FR;q=0.7,fr;q=0.6,en-US;q=0.5',
  145.         'x-secsdk-csrf-request':'1',
  146.         'content-type': 'application/x-www-form-urlencoded',
  147.         'origin': 'https://www.tiktok.com',
  148.         'Referer':'https://www.tiktok.com/',
  149.         'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="102", "Google Chrome";v="102"',
  150.         'sec-ch-ua-mobile': '?0',
  151.         'sec-ch-ua-platform': '"Windows"',
  152.         'sec-fetch-dest': 'empty',
  153.         'sec-fetch-mode': 'cors',
  154.         'sec-fetch-site': 'same-origin',
  155.         'user-agent':ua,
  156.         }
  157.         print("\033[33;1m▪\033[32;1m▪\033[31;1m▪\033[36;1m▪"*15)
  158.         cauhinh(cookie,api,i)
  159.         for _ in range(5,0,-1):
  160.             print("Đang tải job đợi",_,end=" \r")
  161.             sleep(1)
  162.         head_chh= {
  163.         'Accept': '*/*',
  164.         'Accept-Language': 'vi-VN,vi;q=0.9',
  165.         'Connection': 'keep-alive',
  166.         'Cookie': cookie,
  167.         'Origin': 'https://www.tiktok.com',
  168.         'Referer': 'https://www.tiktok.com/',
  169.         'Sec-Fetch-Dest': 'empty',
  170.         'Sec-Fetch-Mode': 'cors',
  171.         'Sec-Fetch-Site': 'same-site',
  172.         'User-Agent':ua,
  173.         'content-type': 'application/x-www-form-urlencoded',
  174.         'sec-ch-ua': '".Not/A)Brand";v="99", "Google Chrome";v="103", "Chromium";v="103"',
  175.         'sec-ch-ua-mobile': '?0',
  176.         'sec-ch-ua-platform': '"Linux"',
  177.         }
  178.         g=ss.get('https://www.tiktok.com/passport/web/account/info/?aid=1459&app_language=vi-VN&app_name=tiktok_web&battery_info=0.48&browser_language=vi-VN&browser_name=Mozilla&browser_online=true&browser_platform=Linux%20armv8l&browser_version=5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F86.0.4240.198%20Safari%2F537.36&channel=tiktok_web&cookie_enabled=true&device_id=7086378675985974827&device_platform=web_pc&focus_state=true&from_page=video&history_len=1&is_fullscreen=false&is_page_visible=true&os=windows&priority_region=VN&referer=&region=VN&screen_height=780&screen_width=360&tz_name=Asia%2FSaigon&verifyFp=verify_0c253cb955b80adc6d83ca7715c47138&webcast_language=vi-VN',headers=head_chh).json()
  179.         name=g['data']['user_id']
  180.         tt_token=cookie.split('tt_csrf_token=')[1].split(';')[0]
  181.         xtoken=ss.head(f"https://www.tiktok.com/api/comment/publish/",headers=head_x).headers['x-ware-csrf-token'].split('0,')[1].split(',')[0]
  182.         print("\033[33;1m▪\033[32;1m▪\033[31;1m▪\033[36;1m▪"*15)
  183.         get_cmt=ss.get(f"https://traodoisub.com/api/?fields=tiktok_comment&access_token={api}",headers=head).json()
  184.         if get_cmt==[]:
  185.             print("Hết job ...",end=" \r")
  186.             for _ in range(10,0,-1):
  187.                 print("Đang chuyển acc khác đợi",_,end=" \r")
  188.                 sleep(1)
  189.             #break
  190.         else:
  191.             try:
  192.                 for x in get_cmt:
  193.                     idd = x['id']
  194.                     link = x['link']
  195.                     id=link.split('video/')[1]
  196.                     ndcmt=x['noidung']
  197.                     #ndcmt=json.loads(nd)[0]
  198.                     h+=1
  199.                     print(f"\033[37;1m[\033[32;1m{h}\033[37;1m][\033[32;1mCOMMENT\033[37;1m][\033[32;1m{id}\033[37;1m]")
  200.                     try:
  201.                         cmt(cookie,id,ndcmt,tt_token,xtoken,name)
  202.                     except:
  203.                         print(f"\033[37;1m[\033[32;1m{ndcmt}\033[37;1m][\033[31;1mCOMMENT ERROR\033[37;1m]")
  204.                     for i in range(delay, 0, -1):
  205.                         print(f'\033[1;95m[KPNTOOL] Vui Lòng Đợi {i} _         ', end='\r')
  206.                         sleep(0.25)
  207.                         print(f'\033[1;94m[KPNTOOL] Vui Lòng Đợi {i} __        ', end='\r')
  208.                         sleep(0.25)
  209.                         print(f'\033[1;93m[KPNTOOL] Vui Lòng Đợi {i} ___       ', end='\r')
  210.                         sleep(0.25)
  211.                         print(f'\033[1;92m[KPNTOOL] Vui Lòng Đợi {i} ____      ', end='\r')
  212.                         sleep(0.25)
  213.                     nhan=ss.get(f'https://traodoisub.com/api/coin/?type=TIKTOK_COMMENT&id={idd}&access_token={api}').json()
  214.                     if "success" in nhan:
  215.                         print(f"\033[37;1m[\033[32;1m+1000\033[37;1m][\033[36;1m",nhan['data']['xu'],"\033[37;1m]                              ")
  216.                     if "error" in nhan:
  217.                         print(f"\033[37;1m[\033[31;1m{nhan['error']}\033[37;1m]                                 ")
  218.                     #nhan_cmt(idd,api,thanh,nx)
  219.                 for _ in range(10,0,-1):
  220.                     print("Đang chuyển acc khác đợi",_,end=" \r")
  221.                     sleep(1)
  222.             except:
  223.                 pass
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement