国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術(shù)文章
文章詳情頁

Python獲取抖音關(guān)注列表封號賬號的實(shí)現(xiàn)代碼

瀏覽:202日期:2022-06-14 15:50:28

最近抖音關(guān)注到達(dá)上限5000個(gè)了,所以就導(dǎo)致很多漂亮小姐姐沒辦法關(guān)注了,那么這里就通過python獲取已經(jīng)被封號的帳號取消關(guān)注就可以了

實(shí)現(xiàn)代碼

import requestsimport jsonimport time# 抖音創(chuàng)作者平臺cookieheader = {’Cookie’: ’你的COOKIE’}shijian = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())sbdy = str(0)sl = 0file = open('D:/test.txt', 'a+',encoding=’utf-8’)file.write(shijian)yczh = 0print(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+=1else: # print('用戶名:'+d[’nickname’]+' 正常') sl+=1 sbdy = str(json_str[’cursor’])else: print('檢測完成,已檢測賬號'+str(sl)+'個(gè),異常賬號共計(jì)'+str(yczh)+'個(gè)') print('異常賬號存儲在: '+file.name) file.close() exit() else:if ('status_message' in json_str): print(json_str[’status_message’]+',已檢測賬號'+str(sl)+'個(gè)') print('等待3分鐘繼續(xù)執(zhí)行') time.sleep(180) print('繼續(xù)執(zhí)行')else: print(json_str) print(sbdy) yn = input('是否重試,繼續(xù)執(zhí)行?[y/n]') if (yn == 'n'):file.close()exit()

需要手動去抖音創(chuàng)作者平臺獲取cookie,注意,只是封了頭像的用戶也會獲取的,因?yàn)樵砭褪桥袛囝^像地址我是新手,學(xué)Python寫的,能用就行:loveliness:

標(biāo)簽: 抖音 Python 編程語言
相關(guān)文章:
主站蜘蛛池模板: 普兰店市| 海淀区| 武宁县| 芒康县| 元氏县| 陇西县| 中西区| 大英县| 洱源县| 安国市| 正宁县| 策勒县| 新竹市| 贡山| 广安市| 六盘水市| 潞西市| 遵化市| 邵武市| 日喀则市| 宜城市| 深水埗区| 武夷山市| 高唐县| 封开县| 隆德县| 天台县| 青河县| 石林| 曲水县| 泰州市| 博爱县| 仙居县| 天峻县| 都江堰市| 黄冈市| 双城市| 宜兰市| 木兰县| 明溪县| 乐亭县|