Closed jarvisaoieong closed 3 years ago
Hi there,
You get this error because the page that signature is trying to load (https://www.tiktok.com/@rihanna) is requesting you to solve a captcha and javascript is not loading correctly. Probably you tried multiples times to grab some content and they just challenged you to solve a captcha puzzle. Try use a proxy or just solve a captcha from that IP and send cookies to the signature.
index.js
const cookies = fs.readFileSync('./config/cookies.json', 'utf8')
const deserializedCookies = JSON.parse(cookies)
await this.context.addCookies(deserializedCookies)
this.page = await this.context.newPage();
cookies.json
[
{
"name": "s_v_web_id",
"value": "...",
"domain": "www.tiktok.com",
"path": "/",
"expires": -1,
"httpOnly": false,
"secure": false,
"sameSite": "None"
},
{
"name": "MONITOR_WEB_ID",
"value": "...",
"domain": ".www.tiktok.com",
"path": "/",
"expires": 1619200702,
"httpOnly": false,
"secure": false,
"sameSite": "None"
},
{
"name": "csrf_session_id",
"value": "...",
"domain": ".www.tiktok.com",
"path": "/",
"expires": -1,
"httpOnly": false,
"secure": false,
"sameSite": "None"
},
{
"name": "tt_webid_v2",
"value": "...",
"domain": ".tiktok.com",
"path": "/",
"expires": 1642960698,
"httpOnly": true,
"secure": true,
"sameSite": "None"
},
{
"name": "tt_webid",
"value": "...",
"domain": ".tiktok.com",
"path": "/",
"expires": 1642960698,
"httpOnly": true,
"secure": true,
"sameSite": "None"
},
{
"name": "tt_csrf_token",
"value": "...",
"domain": ".tiktok.com",
"path": "/",
"expires": -1,
"httpOnly": true,
"secure": true,
"sameSite": "Lax"
},
{
"name": "csrf_session_id",
"value": "...",
"domain": ".webcast.tiktok.com",
"path": "/",
"expires": -1,
"httpOnly": false,
"secure": true,
"sameSite": "None"
}
]
In this way, you will send cookies from a solved captcha to the tiktok web.
Greetings.