github地址:https://github.com/carcabot/tiktok-signature.git,亲测有效
npm i tiktok-signature
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-s0WNkkl8-1635413604581)(examples/howto.gif)]
docker build . -t tiktok-signature
docker run -p 80:8080 -v $(pwd):/usr/app tiktok-signature
curl -X POST \
-H "Content-type: application/json" \
-d 'https://m.tiktok.com/share/item/list?secUid=&id=&type=5&count=30&minCursor=0&maxCursor=0&shareUid=' \
http://localhost/signature
To generate signatures dynamically this repo comes with an integrated http server (listen.js) which accepts POST requests to http://localhost/signature with url in request body.
You have to start the server
npm start
const Signer = require("tiktok-signature"); // Import package
const signer = new Signer(); // Create new signer
await signer.init(); // Create page with. Returns promise
const signature = await signer.sign("tiktok url"); // Get sign for your url. Returns promise
const navigator = await signer.navigator(); // Retrieve navigator data used when signature was generated
console.log(signature);
console.log(navigator);
await signer.close(); // Close browser. Returns promise
You can pass your desired User-Agent on class creation.
new Signer("Mozilla"); // Set User-Agent to Mozilla
Install dependencies
npm i playwright-chromium
Now you can generate the token using
node browser.js "https://m.tiktok.com/api/post/item_list/?aid=1988&count=30&secUid=MS4wLjABAAAAOUoQXeHglWcq4ca3MwlckxqAe-RIKQ1zlH9NkQkbLAT_h1_6SDc4zyPdAcVdTWZF&cursor=0"
The response token should look like this
{
"status": "ok",
"data": {
"signature": "_02B4Z6wo00f01DBbvBwAAIBCcuSZt1Pua8AwS7iAAGyZ6e",
"verify_fp": "verify_knvz9j2k_miXwiqOy_msam_42g2_BYoa_e4EAbuQnDwqI",
"signed_url": "https://m.tiktok.com/api/post/item_list/?aid=1988&count=30&secUid=MS4wLjABAAAAOUoQXeHglWcq4ca3MwlckxqAe-RIKQ1zlH9NkQkbLAT_h1_6SDc4zyPdAcVdTWZF&cursor=0&verifyFp=verify_knvz9j2k_miXwiqOy_msam_42g2_BYoa_e4EAbuQnDwqI&_signature=_02B4Z6wo00f01DBbvBwAAIBCcuSZt1Pua8AwS7iAAGyZ6e",
"x-tt-params": "1BLhm+0j/AG2Dlsz3v4u4w==",
"navigator": {
"width": 884,
"height": 1244,
"deviceScaleFactor": 3,
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (Windows NT 10.0; Win64; x64) Chrome/90.0.4430.85 Safari/537.36",
"browser_language": "en-US",
"browser_platform": "MacIntel",
"browser_name": "Mozilla",
"browser_version": "5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (Windows NT 10.0; Win64; x64) Chrome/90.0.4430.85 Safari/537.36"
}
}
}
You can test it using trending.py file included in this repo.
pip install Naked
python examples/trending.py
NOTE
It’s very important that the userAgent be the same when generate and when request for response.
Keeping a process too much time opened can increase memory usage, to avoid this uncomment the following lines in listen.js
.
// setTimeout(function () {
// server.close(() => {
// console.log("Server shutdown completed.");
// process.exit(1);
// });
// }, 1 * 60 * 60 * 1000);
Bug reports and pull requests are welcome on GitHub at https://github.com/carcabot/tiktok-signature.
git checkout -b my-new-feature
)git commit -am 'Add some new feature'
)git push origin my-new-feature
)The lib is available as open source under the terms of the MIT License.
需要注意的地方
1.测centons系统启动安装playwright,缺少依赖,建议使用docker启动。
2.需要用境外代理,香港的代理不行,配置代理在index.js中修改,3,docker启动.需要进入docker修改镜像
docker 启动后
docker ps #查看容器id
docker exec -it 容器id bash #进入容器
使用vim命令修改index.js文件,增加代理配置,提示没有vim命令,使用apt-get vim 安装
文章浏览阅读7.8k次,点赞2次,收藏34次。STM32+BM8563时钟芯片不走时问题解决(含配置代码)一、寄存器BM8563是一款低功耗CMOS实时时钟/日历芯片,它提供一个可编程的时钟输出,一个中断输出和一个掉电检测器,所有的地址和数据都通过I2C总线接口串行传递。最大总线速度为400Kbits/s,每次读写数据后,内嵌的字地址寄存器会自动递增。BM8563有16个寄存器,其中11个是BCD格式。配置是要注意值范围,不能超出。更多具体应用请看官方手册。二、晶振晶振选择非常重要。32.768不用说了,主要是ESR值,不能小了,也不能太大_bm8563esa stm32 代码
文章浏览阅读1.6w次,点赞27次,收藏170次。原文代码+Food_5K数据集,提取码:zws7什么是迁移学习当数据集没有大到足以训练整个CNN网络时,通常可以对预训练好的imageNet网络(如VGG16,Inception-v3等)进行调整以适应新任务。通常来说,迁移学习有两种类型:特征提取 微调(fine-tuning)第一种迁移学习是将预训练的网络视为一个任意特征提取器。图片经过输入层,然后前向传播,最后在指定层停......_vgg16迁移学习
文章浏览阅读643次。作者:追梦1819原文:https://blog.csdn.net/weixin_39759846/article/details/94428903版权声明:本文为博主原创文章,转载请附上博文链接!引言 邮件的重要性也无需多说了,例如注册验证,消息通知,系统异常提醒等,都离不开邮件的发送。版本信息JDK:1.8 SpringBoot :2.1.4.RELEASE m..._springboot mail
文章浏览阅读1.6k次,点赞2次,收藏7次。PID 控制器代码实现PID 控制器代码实现效果展示实现代码PID 控制器代码实现PID:比列(Proportion),积分(Integral),微分(Differential)偏差 e:某时刻的系统的输出值(output)和目标值(target)之差Kp: 比列系数Ki: 积分系数Kd: 微分系数Ti: 积分时间Td: 微分时间比例系数Kp:增大比例系数使系统反应灵敏,调节速度加快,并且可以减小稳态误差。但是比例系数过大会使超调量增大,振荡次数增加,调节时间加长,动态性能变坏,比例系数_pid源码
文章浏览阅读1.6k次。mysql 在根据某一个字符串字段进行排序的时候,往往没法按照字母进行排序,这时候需要在oder by后面更换成以下形式就可以按照字母就行排序了ORDER BY CONVERT(c.NAME USING gbk) COLLATE gbk_chinese_ci ASC;CONVERT(c.NAME USING gbk) 表示把该字段按照gbk进行重新编码;COLLATE gbk_chines..._convert( a.province using gbk ) collate gbk_chinese_ci asc
文章浏览阅读3.9k次,点赞29次,收藏98次。AI超强工具大揭秘!你想要的我都有_ai宝典
文章浏览阅读998次。/usr/local/mmseg/etc这个目录下1、了解几个文件mmseg.ini unigram.txt uni.libuni.lib --------- 编译后的词库unigram.txt ---- 原词库给人看的, 在这里面添加词库2、添加词条海斯队 1x:1丝路 1x:1令人心悸 1x:13、重新编_mmseg 新增词库
文章浏览阅读1.3k次。一、原始检测方法具体内容如下: 判别特征点pp是否是一个特征点,可以通过判断以该点为中心画圆,该圆过16个像素点。设在圆周上的16个像素点中是否最少有nn个连续的像素点满足都比Ip+tIp+t大,或者都比Ip−tIp−t小。(这里IpIp指的点pp的灰度值,tt是一个阈值)如果满足这样的要求,则判断pp是一个特征点,否则pp不是。在原论文中nn的值一般设为12。 如下图所示: 由于在检测特征点时..._fast 特征检测
文章浏览阅读3.7k次。Oracle查询客户端编码集SQL> select userenv('language') from dual; USERENV('LANGUAGE')----------------------------------------------------AMERICAN_AMERICA.ZHS16GBK_oracle 获取机器码
文章浏览阅读458次。最近在重构公司以前产品的前端代码,摈弃了以前的session-cookie鉴权方式,采用token鉴权,忙里偷闲觉得有必要对几种常见的鉴权方式整理一下。 目前我们常用的鉴权有四种: HTTP Basic Authenticationsession-cookieT..._强鉴权
文章浏览阅读1.4k次。あIOC:国際オリンピック委い員会 IOC: International Olympic Committee 国际奥林匹克委员会愛情 love, affection 爱情アイディア ...
文章浏览阅读1.5k次,点赞4次,收藏2次。3D slicer编译过程中遇到的问题总结1,有关python部分编译1>------ 已启动生成: 项目: python-setuptools, 配置: Debug x64 ------1> Creating directories for 'python-setuptools'1> Building Custom Rule D:/S/S4/CMakeLists.txt1> No download step for 'python-setuptools'1>_3d slicer package生成时报错 file install cannot find