本文章中所有内容仅供学习交流使用,不用于其他任何目的,不提供完整代码严禁用于商业用途和非法用途,否则由此产生的一切后果均与作者无关!
本文章未经许可禁止转载,禁止任何修改后二次传播,擅自使用本文讲解的技术而导致的任何意外,作者均不负责,若有侵权,请联系作者立即删除!
案例网址
aHR0cHM6Ly93d3cuZG91eWluLmNvbS8=
请求首页什么都不带会返回一段js代码,我们把这个js代码拿下来,然后补个环境就能生成__ac_signature ,然后再带着这个参数在请求就能获取到ttwid了,这个ttwid几乎每个接口都会用到我补的多了可以用
ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0'
window = global;
location = {
"ancestorOrigins": {},
"href": "https://www.douyin.com/video/7356927761941925120",
"origin": "https://www.douyin.com",
"protocol": "https:",
"host": "www.douyin.com",
"hostname": "www.douyin.com",
"port": "",
"pathname": "/video/7356927761941925120",
"search": "",
"hash": ""
};
document = {
"location": location,
"cookie": "",
"referrer": "https://www.douyin.com/video/7356927761941925120",
};
navigator = {
"plugins": {
"0": {
"length": 2,
"item": function (a, b, c, d, e, f, g) {
},
"name": "PDF Viewer",
"filename": "internal-pdf-viewer"
},
"1": {
"length": 2,
"item": function (a, b, c, d, e, f, g) {
},
"name": "Chrome PDF Viewer",
"filename": "internal-pdf-viewer"
},
"2": {
"length": 2,
"item": function (a, b, c, d, e, f, g) {
},
"name": "Chromium PDF Viewer",
"filename": "internal-pdf-viewer"
}
},
"webdriver": false,
"userAgent": ua, // 与你请求发送时相同的userAgent
"platform": "Win32",
"appCodeName": "Mozilla",
"appName": "Netscape",
"appVersion": ua, // 与你请求发送时相同的userAgent
"language": "zh-CN",
"product": "Gecko",
"productSub": "20030107",
"vendor": "Google Inc.",
"vendorSub": "",
"cookieEnabled": true,
'hardwareConcurrency': 12,
'connection': 'NetworkInformation',
'downlink': 10
};