carcabot / tiktok-signature

Generate tiktok signature token using node
756 stars 286 forks source link

Browser.js not generating correct signature. #9

Closed muneeb331 closed 4 years ago

muneeb331 commented 4 years ago

Following is the url I am trying to generate the URL with

node browser.js "https://m.tiktok.com/share/item/list?secUid=MS4wLjABAAAAiWABcA0z8O_trkXaALB5r2El1C8oUVABE3dGlt8AnxY&id=16631823&type=1&count=30&minCursor=0&maxCursor=0&shareUid="
s0Ju9AAgEBCwzpufd4evy7NCb-AAO0V

The user agent used for getting the info of the user is the same as being sent in the final request with signature but it doesnt work.

carcabot commented 4 years ago

@muneeb331 I have tried too to generate signature for your link and I got this one s0Ju9AAgEBB2qUaWd4evy7NCb-AAO0V instead which it's working , your's should be the same if you didn't changed anything in code.

muneeb331 commented 4 years ago

are you able to get the response?

carcabot commented 4 years ago

As I said, it's working with my signature.

hemu161 commented 4 years ago

I needed to change line 34 in browser.js for the script to work.I had to change it from await page.goto(dirname + '/local.html', { waitUntil: 'domcontentloaded' }); to await page.goto('file://' + dirname + '/local.html', { waitUntil: 'domcontentloaded' }); after which the script is working properly

carcabot commented 4 years ago

@hemu161 Yes that's true, this is happened also to me on linux with node 10.18.0 , on windows I had no problems with the current path.

muneeb331 commented 4 years ago

this is what i get in response. Sorry to keep asking but I am kinda stuck here.

image

image

@hemu161 even tried that still not working

this is my complete url

https://m.tiktok.com/share/item/list?secUid=MS4wLjABAAAAiWABcA0z8O_trkXaALB5r2El1C8oUVABE3dGlt8AnxY&id=16631823&type=1&count=30&minCursor=0&maxCursor=0&shareUid=&lang=&_signature=s0Ju9AAgEBCwzpufd4cpBbNCb-AAO0V

carcabot commented 4 years ago

@muneeb331 you have to use this user-agent Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1 because this it was used when you generate.

muneeb331 commented 4 years ago

Thanks its working.