File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 1+ import requests
2+ from bs4 import BeautifulSoup
3+ import json
4+
5+ username = ""
6+ url = "https://www.tiktok.com/@" + username
7+ response = requests .get (url ,headers = {'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36' })
8+ soup = BeautifulSoup (response .text , "html.parser" )
9+ script_tag = soup .find ('script' ,id = '__UNIVERSAL_DATA_FOR_REHYDRATION__' )
10+ jzon = json .loads (script_tag .text )['__DEFAULT_SCOPE__' ]['webapp.user-detail' ]['userInfo' ]['user' ]
11+
12+ id = jzon ['id' ]
13+ uniqueId = jzon ['uniqueId' ]
14+ nickname = jzon ['nickname' ]
15+ avatarLarger = jzon ['avatarLarger' ]
16+ region = jzon ['region' ]
17+ nickNameModifyTime = jzon ['nickNameModifyTime' ]
18+ uniqueIdModifyTime = jzon ['uniqueIdModifyTime' ]
19+ roomId = jzon ['roomId' ]
20+ secUid = jzon ['secUid' ]
21+ print (secUid )
22+
You can’t perform that action at this time.
0 commit comments