1. add kuaishou cli
This commit is contained in:
@@ -87,7 +87,7 @@ usage: cli_main.py [-h] platform account_name action ...
|
|||||||
Upload video to multiple social-media.
|
Upload video to multiple social-media.
|
||||||
|
|
||||||
positional arguments:
|
positional arguments:
|
||||||
platform Choose social-media platform: douyin tencent tiktok
|
platform Choose social-media platform: douyin tencent tiktok kuaishou
|
||||||
account_name Account name for the platform: xiaoA
|
account_name Account name for the platform: xiaoA
|
||||||
action Choose action
|
action Choose action
|
||||||
upload upload operation
|
upload upload operation
|
||||||
|
|||||||
+10
-1
@@ -6,10 +6,11 @@ from pathlib import Path
|
|||||||
|
|
||||||
from conf import BASE_DIR
|
from conf import BASE_DIR
|
||||||
from uploader.douyin_uploader.main import douyin_setup, DouYinVideo
|
from uploader.douyin_uploader.main import douyin_setup, DouYinVideo
|
||||||
|
from uploader.ks_uploader.main import ks_setup, KSVideo
|
||||||
from uploader.tencent_uploader.main import weixin_setup, TencentVideo
|
from uploader.tencent_uploader.main import weixin_setup, TencentVideo
|
||||||
from uploader.tk_uploader.main_chrome import tiktok_setup, TiktokVideo
|
from uploader.tk_uploader.main_chrome import tiktok_setup, TiktokVideo
|
||||||
from utils.base_social_media import get_supported_social_media, get_cli_action, SOCIAL_MEDIA_DOUYIN, \
|
from utils.base_social_media import get_supported_social_media, get_cli_action, SOCIAL_MEDIA_DOUYIN, \
|
||||||
SOCIAL_MEDIA_TENCENT, SOCIAL_MEDIA_TIKTOK
|
SOCIAL_MEDIA_TENCENT, SOCIAL_MEDIA_TIKTOK, SOCIAL_MEDIA_KUAISHOU
|
||||||
from utils.constant import TencentZoneTypes
|
from utils.constant import TencentZoneTypes
|
||||||
from utils.files_times import get_title_and_hashtags
|
from utils.files_times import get_title_and_hashtags
|
||||||
|
|
||||||
@@ -63,6 +64,8 @@ async def main():
|
|||||||
await tiktok_setup(str(account_file), handle=True)
|
await tiktok_setup(str(account_file), handle=True)
|
||||||
elif args.platform == SOCIAL_MEDIA_TENCENT:
|
elif args.platform == SOCIAL_MEDIA_TENCENT:
|
||||||
await weixin_setup(str(account_file), handle=True)
|
await weixin_setup(str(account_file), handle=True)
|
||||||
|
elif args.platform == SOCIAL_MEDIA_KUAISHOU:
|
||||||
|
await ks_setup(str(account_file), handle=True)
|
||||||
elif args.action == 'upload':
|
elif args.action == 'upload':
|
||||||
title, tags = get_title_and_hashtags(args.video_file)
|
title, tags = get_title_and_hashtags(args.video_file)
|
||||||
video_file = args.video_file
|
video_file = args.video_file
|
||||||
@@ -84,6 +87,12 @@ async def main():
|
|||||||
await weixin_setup(account_file, handle=True)
|
await weixin_setup(account_file, handle=True)
|
||||||
category = TencentZoneTypes.LIFESTYLE.value # 标记原创需要否则不需要传
|
category = TencentZoneTypes.LIFESTYLE.value # 标记原创需要否则不需要传
|
||||||
app = TencentVideo(title, video_file, tags, publish_date, account_file, category)
|
app = TencentVideo(title, video_file, tags, publish_date, account_file, category)
|
||||||
|
elif args.platform == SOCIAL_MEDIA_KUAISHOU:
|
||||||
|
await ks_setup(account_file, handle=True)
|
||||||
|
app = KSVideo(title, video_file, tags, publish_date, account_file)
|
||||||
|
else:
|
||||||
|
print("Wrong platform, please check your input")
|
||||||
|
exit()
|
||||||
|
|
||||||
await app.main()
|
await app.main()
|
||||||
|
|
||||||
|
|||||||
@@ -7,10 +7,11 @@ SOCIAL_MEDIA_DOUYIN = "douyin"
|
|||||||
SOCIAL_MEDIA_TENCENT = "tencent"
|
SOCIAL_MEDIA_TENCENT = "tencent"
|
||||||
SOCIAL_MEDIA_TIKTOK = "tiktok"
|
SOCIAL_MEDIA_TIKTOK = "tiktok"
|
||||||
SOCIAL_MEDIA_BILIBILI = "bilibili"
|
SOCIAL_MEDIA_BILIBILI = "bilibili"
|
||||||
|
SOCIAL_MEDIA_KUAISHOU = "kuaishou"
|
||||||
|
|
||||||
|
|
||||||
def get_supported_social_media() -> List[str]:
|
def get_supported_social_media() -> List[str]:
|
||||||
return [SOCIAL_MEDIA_DOUYIN, SOCIAL_MEDIA_TENCENT, SOCIAL_MEDIA_TIKTOK]
|
return [SOCIAL_MEDIA_DOUYIN, SOCIAL_MEDIA_TENCENT, SOCIAL_MEDIA_TIKTOK, SOCIAL_MEDIA_KUAISHOU]
|
||||||
|
|
||||||
|
|
||||||
def get_cli_action() -> List[str]:
|
def get_cli_action() -> List[str]:
|
||||||
|
|||||||
Reference in New Issue
Block a user