carcabot / tiktok-signature

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

Request failed with status code 573 #170

Closed akaoppa closed 1 year ago

akaoppa commented 1 year ago

Hello!

Anyone is getting "Request failed with status code 573" ? This is happening today, we are behind a proxy.

Issue with : user-info.js

yuananf commented 1 year ago

I got timeout error with user-info.js. @carcabot Do you have time to check it?

xulei324 commented 1 year ago

same problem, and get video comments is not work too.

ckosmic commented 1 year ago

I've got the same issue, hopefully it's just the signature that's changed

xulei324 commented 1 year ago

For now, user-videos is block. xttparams still worked, but TT_REQ_PERM_URL has expiration and it's very short.

ckosmic commented 1 year ago

Interestingly for both user-info and user-videos, I changed the unsigned URL's query params to match what I see in chrome dev tools, including device_id and user_agent, and I'm able to open the signed URL in chrome and see the expected response, but querying it in node through axios gives a response with status_code: -1 for user-info and random data for user-videos. I also noticed if I turn off cookies in chrome, the response in the browser will also give status_code: -1, but turning them back on will bring back the expected response.

So it looks like the signer is working and generates a valid URL, but there's some difference between the request the browser makes and what axios makes. I even set the cookie header and still didn't get any meaningful response.

EDIT: Spoke too soon with user-videos. Here's my request:

response = await axios(signature2.signed_url, {
                headers: {
                    'cookie': 'msToken=[msToken cookie value from Chrome]',
                    'origin': 'https://www.tiktok.com',
                    'user-agent': navigator2.user_agent,
                    'x-tt-params': signature2['x-tt-params']
                },
                method: 'GET',
            });

Note the required cookie and origin headers that must be set and the fact that we are requesting the signed_url and not a perm url. The request is successful using this. It doesn't seem to work for user-info though.