1. add cli support.

2. change LOCAL_CHROME_PATH to conf file
3. change douyin gen cookie url
This commit is contained in:
pookz@stme
2024-06-13 18:13:21 +08:00
parent d9d31a4d59
commit e088d76516
6 changed files with 168 additions and 10 deletions
+52 -5
View File
@@ -65,9 +65,56 @@ meta_file 内容(content):
这位勇敢的男子为了心爱之人每天坚守 🥺❤️‍🩹
#坚持不懈 #爱情执着 #奋斗使者 #短视频
```
### Usage
1. 设置conf 文件中的 `LOCAL_CHROME_PATH`(在douyin 或者视频号可能出现chromium 不兼容的各种问题,建议设置本地的chrome)
2. 这里分割出来3条路
- 可自行研究源码,免费、任意 穿插在自己的项目中
- 可参考下面的各个平台的使用指南,`examples`文件夹中有各种示例代码
- 使用cli 简易使用(支持tiktok douyin 视频号)
#### cli 用法
```python
python cli_main.py <platform> <account_name> <action: upload, login> [options]
```
查看详细的参数说明使用:
```python
python cli_main.py -h
```
```python
usage: cli_main.py [-h] platform account_name action ...
Upload video to multiple social-media.
positional arguments:
platform Choose social-media platform: douyin tencent tiktok
account_name Account name for the platform: xiaoA
action Choose action
upload upload operation
login login operation
watch watch operation
options:
-h, --help show this help message and exit
```
示例
```python
python cli_main.py douyin test login
douyin平台,账号名为test,动作为login
python douyin test upload "C:\Users\duperdog\Videos\2023-11-07_05-27-44 - 这位少女如梦中仙... .mp4" -pt 0
douyin平台, 账号名为test, 动作为upload, 视频文件(需对应的meta文件,详见上), 发布方式(pt):0 立即发布
python douyin test upload "C:\Users\superdog\Videos\2023-11-07_05-27-44 - 这位少女如梦中仙... .mp4" -pt 1 -t "2024-6-14 12:00"
douyin平台, 账号名为test, 动作为upload, 视频文件, 发布方式(pt):1 定时发布, 发布时间(t): 2024-6-14 12:00
```
---
### 2. 抖音
## 各平台详细说明
### 1. 抖音
<img src="media/show/pdf3.gif" alt="douyin show" width="500"/>
使用playwright模拟浏览器行为
@@ -104,7 +151,7 @@ generate_schedule_time_next_day 默认从第二天开始(此举为避免选择
---
### 3. 视频号
### 2. 视频号
使用playwright模拟浏览器行为
1. 准备视频目录结构
2. cookie获取:get_tencent_cookie.py 扫码登录
@@ -126,7 +173,7 @@ generate_schedule_time_next_day 默认从第二天开始(此举为避免选择
---
### 4. 小红书
### 3. 小红书
该实现,借助ReaJason的[xhs](https://github.com/ReaJason/xhs),再次感谢。
1. 目录结构同上
@@ -166,7 +213,7 @@ https://github.com/requireCool/stealth.min.js
---
### 5. bilibili
### 4. bilibili
该实现,借助biliup的[biliup-rs](https://github.com/biliup/biliup-rs),再次感谢。
1. 准备视频目录结构
2. cookie获取:`biliup.exe -u account.json login` 选项你喜欢的登录方式
@@ -184,7 +231,7 @@ bilibili cookie 长期有效(至少我运行2年以来是这样的)
---
### 6. tiktok
### 5. tiktok
使用playwright模拟浏览器行为(Simulating Browser Behavior with playwright)
1. 准备视频目录结构(Prepare the video directory structure)
2. cookie获取(generate your cookie):get_tk_cookie.py