您好,登錄后才能下訂單哦!
這篇文章將為大家詳細講解有關Python如何獲取抖音關注列表封號賬號,小編覺得挺實用的,因此分享給大家做個參考,希望大家閱讀完這篇文章后可以有所收獲。
最近抖音關注到達上限5000個了,所以就導致很多漂亮小姐姐沒辦法關注了,那么這里就通過python獲取已經被封號的帳號取消關注就可以了
實現代碼
import requests import json import time # 抖音創作者平臺cookie header = {'Cookie': '你的COOKIE'} shijian = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) sbdy = str(0) sl = 0 file = open("D:/test.txt", "a+",encoding='utf-8') file.write(shijian) yczh = 0 print(str(shijian)+"\n開始檢測,請耐心等待...") while (sl < 5000): url = 'https://creator.douyin.com/aweme/v1/creator/relation/following/list/?aid=2906&app_name=aweme_creator_platform&device_platform=web&referer=https:%2F%2Fcreator.douyin.com%2Fcreator-micro%2Fhome&user_agent=Mozilla%2F5.0+(Windows+NT+10.0%3B+Win64%3B+x64)+AppleWebKit%2F537.36+(KHTML,+like+Gecko)+Chrome%2F90.0.4430.212+Safari%2F537.36&cookie_enabled=true&screen_width=1536&screen_height=864&browser_language=zh-CN&browser_platform=Win32&browser_name=Mozilla&browser_version=5.0+(Windows+NT+10.0%3B+Win64%3B+x64)+AppleWebKit%2F537.36+(KHTML,+like+Gecko)+Chrome%2F90.0.4430.212+Safari%2F537.36&browser_online=true&timezone_name=Asia%2FShanghai&_signature=_02B4Z6wo00901TSjMlwAAIDChFLelrWwFwk0pzbAAC2OgYeyEeDw.eiDhwpfH.4NSilIGJd.pSZ5de4SL4e-U2DQy-VLvH0NkfwTIp14WBZCgv63l6pLIkqBZMs9VRrdqIj3xOjfyY.2y6v8de&cursor='+sbdy+'&count=20' r = requests.get(url,headers=header) json_str = json.loads(r.text) if (int(json_str['status_code']) == int('0')): if ("user_info_list" in json_str): av = json_str['user_info_list'] for d in av: url = str(d['avatar']) if (url == "c16000003f97583dac4" or url == "b76600039bd12b4c09da"): print("用戶名:"+d['nickname']+" 不正常") text = str('\n'+d['nickname']) file.write(text) sl+=1 yczh+=1 else: # print("用戶名:"+d['nickname']+" 正常") sl+=1 sbdy = str(json_str['cursor']) else: print("檢測完成,已檢測賬號"+str(sl)+"個,異常賬號共計"+str(yczh)+"個") print("異常賬號存儲在: "+file.name) file.close() exit() else: if ("status_message" in json_str): print(json_str['status_message']+",已檢測賬號"+str(sl)+"個") print("等待3分鐘繼續執行") time.sleep(180) print("繼續執行") else: print(json_str) print(sbdy) yn = input("是否重試,繼續執行?[y/n]") if (yn == "n"): file.close() exit()
關于“Python如何獲取抖音關注列表封號賬號”這篇文章就分享到這里了,希望以上內容可以對大家有一定的幫助,使各位可以學到更多知識,如果覺得文章不錯,請把它分享出去讓更多的人看到。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。