1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
| import asyncio
| import sys
| from datetime import datetime
| from auto_media_publisher.utils.uploader_helper import create_and_run_uploader
| from auto_media_publisher.utils.utils_file import load_json
|
| async def main():
| if len(sys.argv) < 3:
| print("python test_upload.py [PLATFORM] [JSON_PATH] ")
| print("python test_upload.py douyin medias/user01/test.json")
| print("douyin, kuaishou, shipinhao, xiaohongshu, bilibili, baijiahao, tiktok, twitterX, all")
| return
| #test_video_json = "medias/user01/test.json"
| proxy=None
| #proxy="http://127.0.0.1:7890"
|
| await create_and_run_uploader(platform=sys.argv[1],json_data=load_json(sys.argv[2]),proxy=proxy)
|
| if __name__ == "__main__":
| asyncio.run(main())
|
| """
| if __name__ == '__main__':
| user="user01"
| title = "test_video"
| tags=["你好","不知都"]
| path_video = "medias/user01/demo.mp4"
| path_cover = "medias/user01/demo.png"
| publish_datetime = datetime.strptime("2025-05-02 22:00", "%Y-%m-%d %H:%M")
| localtion = "上海市"
| proxy="http://127.0.0.1:7890"
| class_type="动物"
| #app = UploaderDouyin(user,title, path_video, tags, publish_datetime, localtion,path_cover)
| #app = UploaderKuaishou(user,title, path_video, tags, publish_datetime, localtion,path_cover)
| #app = UploaderXiaohongshu(user,title, path_video, tags, publish_datetime, localtion,path_cover)
| #app = UploaderBaijiahao(user,title, path_video, tags, publish_datetime, localtion,path_cover)
| #app = UploaderShipinhao(user,title, path_video, tags, publish_datetime, localtion,path_cover)
| #app = UploaderBilibili(user,title, path_video, tags, publish_datetime, localtion,path_cover)
| #app = UploaderTiktok(user,title, path_video, tags, publish_datetime, localtion,path_cover,proxy)
| app = UploaderTwitterX(user,title, path_video, tags, publish_datetime, localtion,path_cover,proxy)
|
| success = asyncio.run(app.run())
| """
|
|