抖音自动上传脚本部署教程
📌 抖音自动上传脚本部署教程
1、安装 Node.js
2、创建目录存放脚本
注意:下面代码要用 PowerShell 打开
mkdir C:\playwright-douyin
cd C:\playwright-douyin3、设置 PowerShell 执行策略
将执行策略(Execution Policy)设置为 RemoteSigned
powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -Force4、列出不同作用域下的执行策略值
powershell
Get-ExecutionPolicy -List5、初始化项目
powershell
npm init -y6、安装 Playwright
powershell
npm i playwright7、安装 Chromium 浏览器
powershell
npx playwright install chromium8、下载自动上传脚本
点击进入
9、登录抖音
注意:要点一下 高清发布 才能生成登录的 auth.jsonpowershell
node .\uploader_douyin.mjs --setup --state="C:\playwright-douyin\state\auth.json" --debug10、进入目录
powershell
cd C:\playwright-douyin11、运行脚本
powershell
node .\uploader_douyin.mjs (Get-ChildItem "D:\Video_Generation\Output\combined" -Filter *.mp4 | Select-Object -First 1).FullName "【神国之上】 #小说动漫 #神国之上"12、设置定时任务
创建 uploader.ps1
在 C:\playwright-douyin 目录下创建 uploader.ps1 文件,输入以下命令:
powershell
node "C:\playwright-douyin\uploader_douyin.mjs" (Get-ChildItem "D:\Video_Generation\Output\combined" -Filter *.mp4 | Select-Object -First 1).FullName "【神国之上】 #小说动漫 #神国之上"打开 Windows 任务计划程序
- 按
Win + R,输入taskschd.msc→ 回车 - 在右边点击 创建基本任务
设置任务
- 名称:如
DouyinUploader - 触发器:选择执行时间(每天 / 每周 / 每月,具体几点几分)
- 操作:选择 启动程序
配置执行命令
- 程序或脚本 填:
powershell.exe 添加参数 填:
代码-NoProfile -ExecutionPolicy Bypass -File "C:\playwright-douyin\uploader.ps1"起始于 填:
代码C:\playwright-douyin
版权声明:本文为原创文章,版权归 KuDog Xy's Blog 所有,转载请联系博主获得授权。
本文地址:https://blog.148668.xyz/index.php/archives/14/
如果对本文有什么问题或疑问都可以在评论区留言,我看到后会尽量解答。