Advertisement
Hoangsontung_Jusst

TT_TDS_TIKTOK_NOW[V2]

Mar 23rd, 2023
740
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 17.21 KB | None | 0 0
  1. den = "\033[1;90m"
  2. luc = "\033[1;32m"
  3. trang = "\033[1;37m"
  4. red = "\033[1;31m"
  5. vang = "\033[1;33m"
  6. tim = "\033[1;35m"
  7. lamd = "\033[1;34m"
  8. lam = "\033[1;36m"
  9. purple = "\e[35m"
  10. hong = "\033[1;95m"
  11. # Đánh dấu bản quyền
  12. thanh_xau= trang + "~" + red + "[" + vang+ "⟨⟩" + red + "] " + trang + "➩ "
  13. thanh_dep= trang + "~" + red + "[" + luc + "✓" + red + "] " + trang + "➩ "
  14. ##### Cài Thư Viện #####
  15. from pystyle import Add, Center, Anime, Colors, Colorate, Write, System
  16. import requests, json
  17. import os
  18. from sys import platform
  19. from time import sleep
  20. from datetime import datetime
  21. from time import strftime
  22. total = 0
  23. may = 'mb' if platform[0:3] == 'lin' else 'pc'
  24. def banner():
  25.     pass
  26. def bongoc(so):
  27.     for i in range(so):
  28.         print(red+'────', end = '' )
  29.     print('')
  30. class TraoDoiSub_Api (object):
  31.     def __init__ (self, token):
  32.         self.token = token
  33.    
  34.     def main(self):
  35.         try:
  36.             main = requests.get('https://traodoisub.com/api/?fields=profile&access_token='+self.token).json()
  37.             try:
  38.                 return main['data']
  39.             except:
  40.                 False
  41.         except:
  42.             return False
  43.     def run(self, user):
  44.         try:
  45.             run = requests.get(f'https://traodoisub.com/api/?fields=tiktok_run&id={user}&access_token={self.token}').json()
  46.             try:
  47.                 return run['data']
  48.             except:
  49.                 return False
  50.         except:
  51.             return False
  52.     #tiktok_like, tiktok_follow
  53.     def get_job(self, type):
  54.         try:
  55.             get = requests.get(f'https://traodoisub.com/api/?fields={type}&access_token={self.token}')
  56.             return get
  57.         except:
  58.             return False
  59.    
  60.     def cache(self, id, type):
  61. #TIKTOK_LIKE_CACHE, TIKTOK_FOLLOW_CACHE
  62.         try:
  63.             cache = requests.get(f'https://traodoisub.com/api/coin/?type={type}&id={id}&access_token={self.token}').json()
  64.             try:
  65.                 cache['cache']
  66.                 return True
  67.             except:
  68.                 return False
  69.         except:
  70.             return False
  71.  
  72.     def nhan_xu(self, id, type):
  73.         try:
  74.             nhan = requests.get(f'https://traodoisub.com/api/coin/?type={type}&id={id}&access_token={self.token}')
  75.             try:
  76.                 xu = nhan.json()['data']['xu']
  77.                 msg = nhan.json()['data']['msg']
  78.                 job = nhan.json()['data']['job_success']
  79.                 xuthem = nhan.json()['data']['xu_them']
  80.                 global total
  81.                 total+=xuthem
  82.                 bongoc(14)
  83.                 print(f'{lam}Nhận Thành Công {job} Nhiệm Vụ {red}| {luc}{msg} {red}| {luc}TOTAL {vang}{total} {luc}Xu {red}| {vang}{xu} ')
  84.                 bongoc(14)
  85.                 if job == 0:
  86.                     return 0
  87.             except:
  88.                 if '"code":"error","msg"' in nhan.text:
  89.                     hien = nhan.json()['msg']; print(red+hien, end = '\r'); sleep(2); print(' '*len(hien), end = '\r')
  90.                 else:
  91.                     print(red+'Nhận Xu Thất Bại !', end = '\r'); sleep(2); print('                                                       ', end = '\r')
  92.                 return False
  93.         except:
  94.             print(red+'Nhận Xu Thất Bại !', end = '\r'); sleep(2); print('                                                       ', end = '\r')
  95.             return False
  96. def delay(dl):
  97.   try:
  98.     for i in range(dl, -1, -1):
  99.        print(f'{vang}[{trang}NGOCTOOL{vang}][{trang}'+str(i)+vang+']           ',end='\r')
  100.        sleep(1)
  101.   except:
  102.      sleep(dl)
  103.      print(dl,end='\r')
  104.  
  105. def chuyen(link, may):
  106.     if may == 'mb':
  107.         os.system(f'xdg-open {link}')
  108.     else:
  109.         os.system(f'cmd /c start {link}')
  110.  
  111.  
  112.  
  113.  
  114. #----------------------------------------------------------------------------
  115.  
  116.  
  117.  
  118. def main():
  119.     dem=0
  120.     banner()
  121.     while True:
  122.         if os.path.exists('configtds.txt'):
  123.             with open('configtds.txt', 'r') as f:
  124.                 token = f.read()
  125.             tds = TraoDoiSub_Api(token)
  126.             data = tds.main()
  127.             try:
  128.                 print(f'{thanh_xau}{luc}Nhập {vang}[{trang}1{vang}] {luc}Giữ Lại Tài Khoản '+vang+ data['user'] )
  129.                 print(f'{thanh_xau}{luc}Nhập {vang}[{trang}2{vang}] {luc}Nhập Access_Token TDS Mới')
  130.                 chon = input(f'{thanh_xau}{luc}Nhập {trang}===>: {vang}')
  131.                 if chon == '2':
  132.                     os.remove('configtds.txt')
  133.                 elif chon == '1':
  134.                     pass
  135.                 else:
  136.                     print(red+'Lựa chọn không xác định !!!');bongoc(14)
  137.                     continue
  138.             except:
  139.                 os.remove('configtds.txt')
  140.         if not os.path.exists('configtds.txt'):
  141.             token = input(f'{thanh_xau}{luc}Nhập Access_Token TDS: {vang}')
  142.             with open('configtds.txt', 'w') as f:
  143.                 f.write(token)
  144.         with open('configtds.txt', 'r') as f:
  145.             token = f.read()
  146.         tds = TraoDoiSub_Api(token)
  147.         data = tds.main()
  148.         try:
  149.             xu = data['xu']
  150.             xudie = data['xudie']
  151.             user = data['user']
  152.             print(lam+' Đăng Nhập Thành Công ')
  153.             break
  154.         except:
  155.             print(red+'Access Token Không Hợp Lệ! Xin Thử Lại ')
  156.             os.remove('configtds.txt')
  157.             continue
  158.     bongoc(14)
  159.    
  160.        
  161. #while True:
  162.     #cookie=input('Nhập Cookie Tiktok: ')
  163.     #try:
  164.         #headers={'Host':'www.tiktok.com','sec-ch-ua':'";Not A Brand";v="99", "Chromium";v="94"','sec-ch-ua-mobile':'?1','user-agent':'Mozilla/5.0 (Linux; Android 11; vivo 1904) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.56 Mobile Safari/537.36','sec-ch-ua-platform':'"Android"','accept':'*/*','sec-fetch-site':'same-origin','sec-fetch-mode':'cors','sec-fetch-dest':'empty','referer':'https://www.tiktok.com/foryou?is_from_webapp=v1&is_copy_url=1','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','cookie':cookie}
  165.         #info = requests.post(f'https://www.tiktok.com/passport/web/account/info/?aid=1459&app_language=vi-VN&app_name=tiktok_web&battery_info=0.79&browser_language=vi-VN&browser_name=Mozilla&browser_online=true&browser_platform=Linux%20aarch64&browser_version=5.0%20%28Linux%3B%20Android%2011%3B%20vivo%201904%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F94.0.4606.56%20Mobile%20Safari%2F537.36&channel=tiktok_web&cookie_enabled=true&device_id=7126951839819712002&device_platform=web_mobile&focus_state=true&from_page=fyp&history_len=28&is_fullscreen=false&is_page_visible=true&os=android&priority_region=VN&referer=&region=VN&screen_height=772&screen_width=360&tz_name=Asia%2FSaigon&webcast_language=vi-VN',headers=headers).json()
  166.         #id_tikok=info['data']['user_id_str']
  167.         #user_tiktok=info['data']['username']
  168.         #name_tiktok=info['data']['screen_name']
  169.         #print('User Tiktok:',user_tiktok)
  170.         #sleep(1)
  171.         #break
  172.     #except:
  173.         #print('Kiểm Tra Lại Cookie')
  174.  
  175.     banner()
  176.     print(f'{thanh_xau}{luc}Tên Tài Khoản: {vang}{user} ')
  177.     print(f'{thanh_xau}{luc}Xu Hiện Tại: {vang}{xu}')
  178.     print(f'{thanh_xau}{luc}Xu Bị Phạt: {vang}{xudie} ')
  179.     while True:
  180.         ntool=0
  181.         bongoc(14)
  182.         print(f'{thanh_xau}{luc}Nhập {red}[{vang}1{red}] {luc}Để Chạy Nhiệm Vụ Tim')
  183.         print(f'{thanh_xau}{luc}Nhập {red}[{vang}2{red}] {luc}Để Chạy Nhiệm Vụ Follow')
  184.         print(f'{thanh_xau}{luc}Nhập {red}[{vang}3{red}] {luc}Để Chạy Nhiệm Vụ Follow Tiktok Now')
  185.         nhiem_vu=input(f'{thanh_xau}{luc}Nhập Số Để Chạy Nhiệm Vụ: {vang}')
  186.         dl = int(input(f'{thanh_xau}{luc}Nhập Delay: {vang}'))
  187.         while True:
  188.             if ntool == 2:
  189.                 break
  190.             ntool = 0
  191.             bongoc(14)
  192.             nv_nhan=int(input(f'{thanh_xau}{luc}Sau Bao Nhiêu Nhiệm Vụ Thì Nhận Xu: {vang}'))
  193.             if nv_nhan < 8:
  194.                 print(red+'Trên 8 Nhiệm Vụ Mới Được Nhận Tiền!')
  195.                 continue
  196.             if nv_nhan > 15:
  197.                 print(red+'Nhận Xu Dưới 15 Nhiệm Vụ Để Tránh Lỗi')
  198.                 continue
  199.             user_cau_hinh=input(f'{thanh_xau}{luc}Nhập User Name Tik Tok Cần Cấu Hình: {vang}')
  200.             cau_hinh=tds.run(user_cau_hinh)
  201.             if cau_hinh != False:
  202.                 user=cau_hinh['uniqueID']
  203.                 id_acc=cau_hinh['id']
  204.                 bongoc(14)
  205.                 print(f'{luc}Đang Cấu Hình ID: {vang}{id_acc} {red}| {luc}User: {vang}{user} {red}| ')
  206.                 bongoc(14)
  207.             else:
  208.                 print(f'{red}Cấu Hinh Thất Bại User: {vang}{user_cau_hinh} ')
  209.                 continue
  210.             while True:
  211.                 if ntool==1 or ntool==2:break
  212.                 if '1' in nhiem_vu:
  213.                     listlike = tds.get_job('tiktok_like')
  214.                     if listlike == False:
  215.                         print(red+'Không Get Được Nhiệm Vụ Like              ', end = '\r');sleep(2); print('                                                        ', end = '\r')
  216.                     elif 'error' in listlike.text:
  217.                         if listlike.json()['error'] == 'Thao tác quá nhanh vui lòng chậm lại':
  218.                             coun = listlike.json()['countdown']
  219.                             print(f'{red}Đang Get Nhiệm Vụ Like, COUNTDOWN: {str(round(coun, 3))} ', end = '\r'); sleep(2); print('                                                       ', end = '\r')
  220.                         elif listlike.json()['error'] == 'Vui lòng ấn NHẬN TẤT CẢ rồi sau đó tiếp tục làm nhiệm vụ để tránh lỗi!':
  221.                             nhan = tds.nhan_xu('TIKTOK_LIKE_API', 'TIKTOK_LIKE') #TIKTOK_LIKE, TIKTOK_FOLLOW, TIKTOK_COMMENT
  222.                         else:
  223.                             print(red+listlike.json()['error'] , end ='\r');sleep(2); print('                                                        ', end = '\r')
  224.                     else:
  225.                         try:
  226.                             listlike = listlike.json()['data']
  227.                         except:
  228.                             print(red+'Hết Nhiệm Vụ Like                             ', end = '\r');sleep(2); print('                                                        ', end = '\r')
  229.                             continue
  230.                         if len(listlike) == 0:
  231.                             print(red+'Hết Nhiệm Vụ Like                             ', end = '\r');sleep(2); print('                                                        ', end = '\r')
  232.                         else:
  233.                             print(f'{luc}Tìm Thấy {vang}{len(listlike)} {luc}Nhiệm Vụ Like                       ', end = '\r');sleep(2); print('                                                        ', end = '\r')
  234.                             for i in listlike:
  235.                                 id = i['id']
  236.                                 link = i['link']
  237.                                 chuyen(link, may)
  238.                                 cache = tds.cache(id, 'TIKTOK_LIKE_CACHE')
  239.                                 if cache != True:
  240.                                     tg=datetime.now().strftime('%H:%M:%S')
  241.                                     hien = f'{vang}[{red}X{vang}] {red}| {lam}{tg} {red}| {vang}TIM {red}| {trang}{id} {red}|'; print(hien, end = '\r');sleep(1); print('                                                                                        ', end = '\r')
  242.                                 else:
  243.                                     dem+=1
  244.                                     tg=datetime.now().strftime('%H:%M:%S')
  245.                                     print(f'{vang}[{trang}{dem}{vang}] {red}| {lam}{tg} {red}| {Colorate.Horizontal(Colors.yellow_to_red, "TIM")} {red}| {trang}{id} {red}|')
  246.                                     delay(dl)
  247.                                     if dem % nv_nhan == 0:
  248.                                         nhan = tds.nhan_xu('TIKTOK_LIKE_API', 'TIKTOK_LIKE')
  249.                                         if nhan == 0:
  250.                                             print(luc+'Nhận Xu Thất Bại Acc Tiktok Của Bạn Ổn Chứ ')
  251.                                             print(f'{thanh_xau}{luc}Nhập {red}[{vang}1{red}] {luc}Để Thay Nhiệm Vụ ')
  252.                                             print(f'{thanh_xau}{luc}Nhập {red}[{vang}2{red}] {luc}Thay Acc Tiktok ')
  253.                                             print(f'{thanh_xau}{luc}Nhấn {red}[{vang}Enter{red}] {luc}Để Tiếp Tục')
  254.                                             chon=input(f'{thanh_xau}{luc}Nhập {trang}===>: {vang}')
  255.                                             if chon == '1':
  256.                                                 ntool=2
  257.                                                 break
  258.                                             elif chon =='2':
  259.                                                 ntool = 1
  260.                                                 break
  261.                                             bongoc(14)
  262.                 if ntool==1 or ntool==2:break
  263.                 if '2' in nhiem_vu:
  264.                     listfollow = tds.get_job('tiktok_follow')
  265.                     if listfollow == False:
  266.                         print(red+'Không Get Được Nhiệm Vụ Follow              ', end = '\r');sleep(2); print('                                                        ', end = '\r')
  267.                     elif 'error' in listfollow.text:
  268.                         if listfollow.json()['error'] == 'Thao tác quá nhanh vui lòng chậm lại':
  269.                             coun = listfollow.json()['countdown']
  270.                             print(red+f'Đang Get Nhiệm Vụ Follow, COUNTDOWN: {str(round(coun, 3))} ', end = '\r'); sleep(2); print('                                                       ', end = '\r')
  271.                         elif listfollow.json()['error'] == 'Vui lòng ấn NHẬN TẤT CẢ rồi sau đó tiếp tục làm nhiệm vụ để tránh lỗi!':
  272.                             nhan = tds.nhan_xu('TIKTOK_FOLLOW_API', 'TIKTOK_FOLLOW') #TIKTOK_LIKE, TIKTOK_FOLLOW, TIKTOK_COMMENT
  273.                         else:
  274.                             print(red+listfollow.json()['error'] , end ='\r');sleep(2); print('                                                        ', end = '\r')
  275.                     else:
  276.                         try:
  277.                             listfollow = listfollow.json()['data']
  278.                         except:
  279.                             print(red+'Hết Nhiệm Vụ Follow                             ', end = '\r');sleep(2); print('                                                        ', end = '\r')
  280.                             continue
  281.                         if len(listfollow) == 0:
  282.                             print(red+'Hết Nhiệm Vụ Follow                             ', end = '\r');sleep(2); print('                                                        ', end = '\r')
  283.                         else:
  284.                             print(luc+f'Tìm Thấy {vang}{len(listfollow)} {luc}Nhiệm Vụ Follow                       ', end = '\r');sleep(2); print('                                                        ', end = '\r')
  285.                             for i in listfollow:
  286.                                 id = i['id']
  287.                                 link = i['link']
  288.                                 chuyen(link, may)
  289.                                 cache = tds.cache(id, 'TIKTOK_FOLLOW_CACHE')
  290.                                 if cache != True:
  291.                                     tg=datetime.now().strftime('%H:%M:%S')
  292.                                     hien = f'{vang}[{red}X{vang}] {red}| {lam}{tg} {red}| {vang}FOLLOW {red}| {trang}{id} {red}|'; print(hien, end = '\r');sleep(1); print('                                                                                        ', end = '\r')
  293.                                 else:
  294.                                     dem+=1
  295.                                     tg=datetime.now().strftime('%H:%M:%S')
  296.                                     print(f'{vang}[{trang}{dem}{vang}] {red}| {lam}{tg} {red}| {Colorate.Horizontal(Colors.yellow_to_red, "FOLLOW")} {red}| {trang}{id} {red}|')
  297.                                     delay(dl)
  298.                                     if dem % nv_nhan == 0:
  299.                                         nhan = tds.nhan_xu('TIKTOK_FOLLOW_API', 'TIKTOK_FOLLOW')
  300.                                         if nhan == 0:
  301.                                             print(luc+'Nhận Xu Thất Bại Acc Tiktok Của Bạn Ổn Chứ ')
  302.                                             print(f'{thanh_xau}{luc}Nhập {red}[{vang}1{red}] {luc}Để Thay Nhiệm Vụ ')
  303.                                             print(f'{thanh_xau}{luc}Nhập {red}[{vang}2{red}] {luc}Thay Acc Tiktok ')
  304.                                             print(f'{thanh_xau}{luc}Nhấn {red}[{vang}Enter{red}] {luc}Để Tiếp Tục')
  305.                                             chon=input(f'{thanh_xau}{luc}Nhập {trang}===>: {vang}')
  306.                                             if chon == '1':
  307.                                                 ntool=2
  308.                                                 break
  309.                                             elif chon =='2':
  310.                                                 ntool = 1
  311.                                                 break
  312.                                             bongoc(14)
  313.                 if ntool==1 or ntool==2:break
  314.                 if '3' in nhiem_vu:
  315.                     listfollow = tds.get_job('tiktok_follow')
  316.                     if listfollow == False:
  317.                         print(red+'Không Get Được Nhiệm Vụ Follow              ', end = '\r');sleep(2); print('                                                        ', end = '\r')
  318.                     elif 'error' in listfollow.text:
  319.                         if listfollow.json()['error'] == 'Thao tác quá nhanh vui lòng chậm lại':
  320.                             coun = listfollow.json()['countdown']
  321.                             print(f'{red}Đang Get Nhiệm Vụ Follow, COUNTDOWN: {str(round(coun, 3))} ', end = '\r'); sleep(2); print('                                                       ', end = '\r')
  322.                         elif listfollow.json()['error'] == 'Vui lòng ấn NHẬN TẤT CẢ rồi sau đó tiếp tục làm nhiệm vụ để tránh lỗi!':
  323.                             nhan = tds.nhan_xu('TIKTOK_FOLLOW_API', 'TIKTOK_FOLLOW') #TIKTOK_LIKE, TIKTOK_FOLLOW, TIKTOK_COMMENT
  324.                         else:
  325.                             print(red+listfollow.json()['error'] , end ='\r');sleep(2); print('                                                        ', end = '\r')
  326.                     else:
  327.                         try:
  328.                             listfollow = listfollow.json()['data']
  329.                         except:
  330.                             print(red+'Hết Nhiệm Vụ Follow                             ', end = '\r');sleep(2); print('                                                        ', end = '\r')
  331.                             continue
  332.                         if len(listfollow) == 0:
  333.                             print(red+'Hết Nhiệm Vụ Follow                             ', end = '\r');sleep(2); print('                                                        ', end = '\r')
  334.                         else:
  335.                             print(f'{luc}Tìm Thấy {vang}{len(listfollow)} {luc}Nhiệm Vụ Follow                       ', end = '\r');sleep(2); print('                                                        ', end = '\r')
  336.                             for i in listfollow:
  337.                                 id = i['id']
  338.                                 uid = id.split('_')[0]
  339.                                 link = i['link']
  340.                                 que = i['uniqueID']
  341.                                 if may == 'mb':
  342.                                     chuyen(f'tiktoknow://user/profile?user_id={uid}', may)
  343.                                 else:
  344.                                     chuyen(f'https://now.tiktok.com/@{que}', may)
  345.                                 cache = tds.cache(id, 'TIKTOK_FOLLOW_CACHE')
  346.                                 if cache != True:
  347.                                     tg=datetime.now().strftime('%H:%M:%S')
  348.                                     hien = f'{vang}[{red}X{vang}] {red}| {lam}{tg} {red}| {vang}FOLLOW_TIKTOK_NOW {red}| {trang}{id} {red}|'; print(hien, end = '\r');sleep(1); print('                                                                                        ', end = '\r')
  349.                                 else:
  350.                                     dem+=1
  351.                                     tg=datetime.now().strftime('%H:%M:%S')
  352.                                     print(f'{vang}[{trang}{dem}{vang}] {red}| {lam}{tg} {red}| {Colorate.Horizontal(Colors.yellow_to_red, "FOLLOW_TIKTOK_NOW")} {red}| {trang}{id} {red}|')
  353.                                     delay(dl)
  354.                                     if dem % nv_nhan == 0:
  355.                                         nhan = tds.nhan_xu('TIKTOK_FOLLOW_API', 'TIKTOK_FOLLOW')
  356.                                         if nhan == 0:
  357.                                             print(luc+'Nhận Xu Thất Bại Acc Tiktok Của Bạn Ổn Chứ ')
  358.                                             print(f'{thanh_xau}{luc}Nhập {red}[{vang}1{red}] {luc}Để Thay Nhiệm Vụ ')
  359.                                             print(f'{thanh_xau}{luc}Nhập {red}[{vang}2{red}] {luc}Thay Acc Tiktok ')
  360.                                             print(f'{thanh_xau}{luc}Nhấn {red}[{vang}Enter{red}] {luc}Để Tiếp Tục')
  361.                                             chon=input(f'{thanh_xau}{luc}Nhập {trang}===>: {vang}')
  362.                                             if chon == '1':
  363.                                                 ntool=2
  364.                                                 break
  365.                                             elif chon =='2':
  366.                                                 ntool = 1
  367.                                                 break
  368.                                             bongoc(14)
  369. main()
  370. 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement