carcabot / tiktok-signature

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

how to get a correct x-signature #114

Closed thewoz closed 3 years ago

thewoz commented 3 years ago

Hi, I have a list of video link previously saved in the following format:

https://p77-sign-sg.tiktokcdn.com/obj/tos-maliva-p-0068/f7c128e9235d44868591b4f1771c3360_1586091718?x-expires=1613397600&x-signature=qPHNNUjatu%2BL3OWF96rh7ve6sts%3D

If I try to download it I will get a 403 error. Checking the video's link on the Tiktok page I saw that the link has changed.

https://p77-sign-sg.tiktokcdn.com/obj/tos-maliva-p-0068/f7c128e9235d44868591b4f1771c3360_1586091718?x-expires=1614733200&x-signature=rtsHOyJ5iK6uFXOgzMJ108abEbo%3D

from what I understand the "expires" field is the unix-timestamps and I can change it accordingly. but what about the "x-signature" field?

some one can help?

carcabot commented 3 years ago

Hi there,

I have tried to generate a signature for your url but it's not working as I expected. Probably this kind of link uses a different signature process which is processed on backend only.

thewoz commented 3 years ago

hi carcabot, thank you a lot!

damn I have like 7K of links and I need it for research.

I have for the same video the following link:

https://v16-web.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c003/64a709d96f58466fa9c270e3b88967d0/?a=1988&br=1438&bt=719&cd=0%7C0%7C1&ch=0&cr=0&cs=0&cv=1&dr=0&ds=3&er=&expire=1613399034&l=202102150823460101901880171B7022ED&lr=tiktok_m&mime_type=video_mp4&pl=0&policy=2&qs=0&rc=anh4dzg2aTp3dDMzMzczM0ApZGY2aWVkaTs5Nzk7Nzw7Z2dvYWkycmEtYTFfLS0vMTZzczReXzBgYmMzMWEuLzU1YjY6Yw%3D%3D&signature=b73a1a7f2961e810065c368c78cae59e&tk=tt_webid_v2&vl=&vr=

that doesn't work

and also this one:

https://www.tiktok.com/@ludovicobattini/video/6812212018154572800

for this I notice that the "id" of the video as change. form 6812212018154572800 to 6812212018154573062 do you know noting about this?

thewoz commented 3 years ago

Hi @fracogno!! where I can text you?

carcabot commented 3 years ago

@thewoz the only way is to get fresh video links using the original url ( https://www.tiktok.com/@ludovicobattini/video/6812212018154572800 )