carcabot / tiktok-signature

Generate tiktok signature token using node
733 stars 285 forks source link

Status code -1 response from /api/user/detail/ #129

Closed a1d4r closed 2 years ago

a1d4r commented 3 years ago

There is an endpoint to get information about a user. You can open any video and hover over any user avatar in comments. Then, a request will be made to https://www.tiktok.com/api/user/detail/.

However, when I try to repeat the request using the same parameters but with generated signature (verifyFp and _signature), the server responds with b'{\n statusCode: -1,\n userInfo: {}\n}'

I tried to copy all the query parameters and even replaced the user agent with mine. Requests are absolutely identical with only difference in order (in real request verifyFp goes right after browser_online) and values (verifyFp and _signature are different).

Here is a real (successful) request:

curl --location --request GET 'https://www.tiktok.com/api/user/detail/?aid=1988&app_name=tiktok_web&device_platform=web_pc&device_id=6930141418598008326&region=RU&priority_region=RU&os=linux&referer=&root_referer=&cookie_enabled=true&screen_width=1920&screen_height=1080&browser_language=en-US&browser_platform=Linux+x86_64&browser_name=Mozilla&browser_version=5.0+(X11%3B+Linux+x86_64)+AppleWebKit%2F537.36+(KHTML,+like+Gecko)+Chrome%2F91.0.4472.114+Safari%2F537.36&browser_online=true&verifyFp=verify_kqqi4n69_EAGaxikt_Cvac_4IrK_BO2X_4Ezpt3EcsWuJ&app_language=en&timezone_name=Europe%2FMoscow&is_page_visible=true&focus_state=false&is_fullscreen=false&history_len=7&uniqueId=bigboyslim&language=en&_signature=_02B4Z6wo00101ByAUTQAAIDB1LXDuS8zsjAcgFWAAGfJ67' \
--header 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36'

and the request with generated signature (status code -1):

curl --location --request GET 'https://www.tiktok.com/api/user/detail/?aid=1988&app_name=tiktok_web&device_platform=web_pc&device_id=6930141418598008326&region=RU&priority_region=RU&os=linux&referer=&root_referer=&cookie_enabled=true&screen_width=1920&screen_height=1080&browser_language=en-US&browser_platform=Linux+x86_64&browser_name=Mozilla&browser_version=5.0+(X11%3B+Linux+x86_64)+AppleWebKit%2F537.36+(KHTML,+like+Gecko)+Chrome%2F91.0.4472.114+Safari%2F537.36&browser_online=true&app_language=en&timezone_name=Europe%2FMoscow&is_page_visible=true&focus_state=false&is_fullscreen=false&history_len=7&uniqueId=bigboyslim&language=en&verifyFp=verify_kqqqs1wo_ijY4PT8W_OU1e_496Q_BYzT_xhtHm12iEK7P&_signature=_02B4Z6wo00f01IxAYFQAAIDDOf38tC06iiiMYGTAAEP38e' \
--header 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36'

There are also some problems with endpoints: https://www.tiktok.com/api/challenge/item_list/ and https://www.tiktok.com/api/post/item_list/

Used OS: Linux NodeJS version: v12.22.1 Signature Version: 1.3.0 CLI or Module: docker-compose Do you run the tool through Proxy, VPN, VPS: No proxy