diff --git a/README.MD b/README.MD index 3b9147a..38b6b92 100644 --- a/README.MD +++ b/README.MD @@ -5,9 +5,10 @@ social-auto-upload 该项目旨在自动化发布视频到各个社交媒体平 ## 💡Feature - 中国主流社交媒体平台: - 抖音 - - 视频号(todo) + - 视频号 - bilibili(todo) - 小红书 + - 快手 - 部分国外社交媒体: - tiktok(todo) @@ -88,7 +89,29 @@ generate_schedule_time_next_day 默认从第二天开始(此举为避免选择 --- -### 3. 小红书 +### 3. 视频号 +使用playwright模拟浏览器行为 +1. 准备视频目录结构 +2. cookie获取:get_tencent_cookie.py 扫码登录 +3. 上传视频:upload_video_to_tencent.py + + + +其他部分解释: +``` +参考上面douyin_setup 配置 +``` + +> 视频号使用chromium会出现不支持上传视频,需要自行指定本地浏览器 +> 解决方案: +> 1. 下载chrome +> 2. 找到chrome的安装目录 +> 3. 将目录配置到DouYinVideo类中 self.local_executable_path = "xxx/xxx/chrome.exe" + +--- + + +### 4. 小红书 该实现,借助ReaJason的[xhs](https://github.com/ReaJason/xhs),再次感谢。 1. 目录结构同上 diff --git a/examples/get_tencent_cookie.py b/examples/get_tencent_cookie.py new file mode 100644 index 0000000..20f33e5 --- /dev/null +++ b/examples/get_tencent_cookie.py @@ -0,0 +1,9 @@ +import asyncio +from pathlib import Path + +from conf import BASE_DIR +from tencent_uploader.main import weixin_setup + +if __name__ == '__main__': + account_file = Path(BASE_DIR / "tencent_uploader" / "account.json") + cookie_setup = asyncio.run(weixin_setup(str(account_file), handle=True)) diff --git a/examples/upload_video_to_tencent_video.py b/examples/upload_video_to_tencent.py similarity index 100% rename from examples/upload_video_to_tencent_video.py rename to examples/upload_video_to_tencent.py diff --git a/tencent_uploader/main.py b/tencent_uploader/main.py index c05619d..b85f204 100644 --- a/tencent_uploader/main.py +++ b/tencent_uploader/main.py @@ -83,8 +83,7 @@ class TencentVideo(object): self.publish_date = publish_date self.account_file = account_file self.category = category - self.local_executable_path = "C:/Program Files/Google/Chrome/Application/chrome.exe" - self.date_format = '%Y年%m月%d日 %H:%M' + self.local_executable_path = "" # change me necessary! async def set_schedule_time_tencent(self, page, publish_date): print("click schedule")