手记

Tiktok 根据主播id(uniqueId)获取个人详细信息

本文所有教程及源码、软件仅为技术研究。不涉及计算机信息系统功能的删除、修改、增加、干扰,更不会影响计算机信息系统的正常运行。不得将代码用于非法用途,如侵立删!


Tiktok 根据主播id(uniqueId)获取个人详细信息

环境

  • win10

  • Python3

抓包分析

可以看到一些常规的参数都是有的 uid、nickname、secUid、关注量、粉丝量、点赞量

“UserModule”:{“users”:{“adaheiheihei”:{“id”:“6916391078255133701”,“shortId”:"",“uniqueId”:“adaheiheihei”,“nickname”:“ada嘿嘿嘿”,“avatarLarger”:“https:\u002F\u002Fp16-sign-sg.tiktokcdn.com\u002Faweme\u002F1080x1080\u002Ftos-alisg-avt-0068\u002F7f8f320565bd9270cd3ad6cdaa327c6c.jpeg?x-expires=1687701600&x-signature=0RMNLvMU6pFnCyK35KFbDRVdWwk%3D”,“avatarMedium”:“https:\u002F\u002Fp16-sign-sg.tiktokcdn.com\u002Faweme\u002F720x720\u002Ftos-alisg-avt-0068\u002F7f8f320565bd9270cd3ad6cdaa327c6c.jpeg?x-expires=1687701600&x-signature=8yTWt97oElIf8ejUI1sfAdgsvWw%3D”,“avatarThumb”:“https:\u002F\u002Fp16-sign-sg.tiktokcdn.com\u002Faweme\u002F100x100\u002Ftos-alisg-avt-0068\u002F7f8f320565bd9270cd3ad6cdaa327c6c.jpeg?x-expires=1687701600&x-signature=ZNHQdL%2F63wBWeu%2BbNW6JuWMNWyA%3D”,“signature”:“油管完整版:https:\u002F\u002Fwww.youtube.com\u002F@user-ada289\u002F\n电报粉丝群:https:\u002F\u002Ft.me\u002F+le8O-Pb2NBllNDBl”,“createTime”:0,“verified”:false,“secUid”:“MS4wLjABAAAAluRZU7mIU9ZefKyEZX7_AxJ1KP7uDDs9ixJGy_P3cyAuAxCw3s-0058iQSCYV6GM”,“ftc”:false,“relation”:0,“openFavorite”:false,“commentSetting”:0,“commerceUserInfo”:{“commerceUser”:false},“duetSetting”:0,“stitchSetting”:0,“privateAccount”:false,“secret”:false,“isADVirtual”:false,“roomId”:"",“uniqueIdModifyTime”:0,“ttSeller”:false,“region”:“AM”,“downloadSetting”:0,“profileTab”:{“showMusicTab”:false,“showQuestionTab”:false,“showPlayListTab”:false},“followingVisibility”:1,“recommendReason”:"",“nowInvitationCardUrl”:"",“nickNameModifyTime”:1681114871,“isEmbedBanned”:false,“canExpPlaylist”:true,“profileEmbedPermission”:3,“language”:“zh-Hant”,“extraInfo”:{“statusCode”:0}}},“stats”:{“adaheiheihei”:{“followerCount”:28700,“followingCount”:0,“heart”:52200,“heartCount”:52200,“videoCount”:27,“diggCount”:0,“needFix”:true}}}

数据请求

import requests


headers = {
“Accept”: “text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9”,
“Accept-Language”: “zh-CN,zh;q=0.9”,
“Cache-Control”: “no-cache”,
“Connection”: “keep-alive”,
“Pragma”: “no-cache”,
“Sec-Fetch-Dest”: “document”,
“Sec-Fetch-Mode”: “navigate”,
“Sec-Fetch-Site”: “none”,
“Sec-Fetch-User”: “?1”,
“Upgrade-Insecure-Requests”: “1”,
“User-Agent”: “Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1”
}
cookies = {
“tt_csrf_token”: “w6pwt5Ff-t4HSydC_ltITMqEQ1g-LxfW_lU0”,
“tt_chain_token”: “3AuAy9nkwF1cjOo75epLYg==”,
"_tea_cache_tokens_1988": "{%22_type%22:%22default%22%2C%22user_unique_id%22:%227247896934471665170%22%2C%22timestamp%22:1687532528591}",
“tiktok_webapp_theme”: “light”,
“ttwid”: “1%7CjtPOW949e7WmtphEjENgNHREuEqxNhsuTgAm3EvqUOc%7C1687532545%7C47eefcae622b8427ec9d624cf991ada4cb2178eedcdb40cbd23582adc243e0b8”,
“msToken”: “SarBhe2E9iYXonyPzdF0H6wBbHJEk8V8rV0eJyQ_n_kGq1hkgB_EaYIPpooTRI6xjc39rZCjXWg4rUQBJlqEJrKhL8SmQULk7ejR-An5FUxB-RJ9M9qJkif9ZBwlqenC-R-vs5s0qg==”
}
response = requests.get(url, headers=headers, cookies=cookies)

print(response.text)
print(response)

效果

资源下载


本文仅供学习交流使用,如侵立删!


0人推荐
随时随地看视频
慕课网APP