1. add kuaishou uploader
2. refactor the code
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
# cd bilibili_uploader
|
||||
# cd uploader/bilibili_uploader
|
||||
# biliup.exe -u account.json login
|
||||
|
||||
@@ -2,8 +2,8 @@ import asyncio
|
||||
from pathlib import Path
|
||||
|
||||
from conf import BASE_DIR
|
||||
from douyin_uploader.main import douyin_setup
|
||||
from uploader.douyin_uploader.main import douyin_setup
|
||||
|
||||
if __name__ == '__main__':
|
||||
account_file = Path(BASE_DIR / "douyin_uploader" / "account.json")
|
||||
account_file = Path(BASE_DIR / "cookies" / "douyin_uploader" / "account.json")
|
||||
cookie_setup = asyncio.run(douyin_setup(str(account_file), handle=True))
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import asyncio
|
||||
from pathlib import Path
|
||||
|
||||
from conf import BASE_DIR
|
||||
from uploader.ks_uploader.main import ks_setup
|
||||
|
||||
if __name__ == '__main__':
|
||||
account_file = Path(BASE_DIR / "cookies" / "ks_uploader" / "account.json")
|
||||
cookie_setup = asyncio.run(ks_setup(str(account_file), handle=True))
|
||||
@@ -2,8 +2,8 @@ import asyncio
|
||||
from pathlib import Path
|
||||
|
||||
from conf import BASE_DIR
|
||||
from tencent_uploader.main import weixin_setup
|
||||
from uploader.tencent_uploader.main import weixin_setup
|
||||
|
||||
if __name__ == '__main__':
|
||||
account_file = Path(BASE_DIR / "tencent_uploader" / "account.json")
|
||||
account_file = Path(BASE_DIR / "cookies" / "tencent_uploader" / "account.json")
|
||||
cookie_setup = asyncio.run(weixin_setup(str(account_file), handle=True))
|
||||
|
||||
@@ -2,8 +2,8 @@ import asyncio
|
||||
from pathlib import Path
|
||||
|
||||
from conf import BASE_DIR
|
||||
from tk_uploader.main_chrome import tiktok_setup
|
||||
from uploader.tk_uploader.main_chrome import tiktok_setup
|
||||
|
||||
if __name__ == '__main__':
|
||||
account_file = Path(BASE_DIR / "tk_uploader" / "account.json")
|
||||
account_file = Path(BASE_DIR / "cookies" / "tk_uploader" / "account.json")
|
||||
cookie_setup = asyncio.run(tiktok_setup(str(account_file), handle=True))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
from bilibili_uploader.main import read_cookie_json_file, extract_keys_from_json, random_emoji, BilibiliUploader
|
||||
from uploader.bilibili_uploader.main import read_cookie_json_file, extract_keys_from_json, random_emoji, BilibiliUploader
|
||||
from conf import BASE_DIR
|
||||
from utils.constant import VideoZoneTypes
|
||||
from utils.files_times import generate_schedule_time_next_day, get_title_and_hashtags
|
||||
@@ -9,7 +9,7 @@ from utils.files_times import generate_schedule_time_next_day, get_title_and_has
|
||||
if __name__ == '__main__':
|
||||
filepath = Path(BASE_DIR) / "videos"
|
||||
# how to get cookie, see the file of get_bilibili_cookie.py.
|
||||
account_file = Path(BASE_DIR / "bilibili_uploader" / "account.json")
|
||||
account_file = Path(BASE_DIR / "cookies" / "bilibili_uploader" / "account.json")
|
||||
if not account_file.exists():
|
||||
print(f"{account_file.name} 配置文件不存在")
|
||||
exit()
|
||||
|
||||
@@ -2,13 +2,13 @@ import asyncio
|
||||
from pathlib import Path
|
||||
|
||||
from conf import BASE_DIR
|
||||
from douyin_uploader.main import douyin_setup, DouYinVideo
|
||||
from uploader.douyin_uploader.main import douyin_setup, DouYinVideo
|
||||
from utils.files_times import generate_schedule_time_next_day, get_title_and_hashtags
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
filepath = Path(BASE_DIR) / "videos"
|
||||
account_file = Path(BASE_DIR / "douyin_uploader" / "account.json")
|
||||
account_file = Path(BASE_DIR / "cookies" / "douyin_uploader" / "account.json")
|
||||
# 获取视频目录
|
||||
folder_path = Path(filepath)
|
||||
# 获取文件夹中的所有文件
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import asyncio
|
||||
from pathlib import Path
|
||||
|
||||
from conf import BASE_DIR
|
||||
from uploader.ks_uploader.main import ks_setup, KSVideo
|
||||
from utils.files_times import generate_schedule_time_next_day, get_title_and_hashtags
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
filepath = Path(BASE_DIR) / "videos"
|
||||
account_file = Path(BASE_DIR / "cookies" / "ks_uploader" / "account.json")
|
||||
# 获取视频目录
|
||||
folder_path = Path(filepath)
|
||||
# 获取文件夹中的所有文件
|
||||
files = list(folder_path.glob("*.mp4"))
|
||||
file_num = len(files)
|
||||
publish_datetimes = generate_schedule_time_next_day(file_num, 1, daily_times=[16])
|
||||
cookie_setup = asyncio.run(ks_setup(account_file, handle=False))
|
||||
for index, file in enumerate(files):
|
||||
title, tags = get_title_and_hashtags(str(file))
|
||||
# 打印视频文件名、标题和 hashtag
|
||||
print(f"视频文件名:{file}")
|
||||
print(f"标题:{title}")
|
||||
print(f"Hashtag:{tags}")
|
||||
app = KSVideo(title, file, tags, publish_datetimes[index], account_file)
|
||||
asyncio.run(app.main(), debug=False)
|
||||
@@ -2,14 +2,14 @@ import asyncio
|
||||
from pathlib import Path
|
||||
|
||||
from conf import BASE_DIR
|
||||
from tencent_uploader.main import weixin_setup, TencentVideo
|
||||
from uploader.tencent_uploader.main import weixin_setup, TencentVideo
|
||||
from utils.constant import TencentZoneTypes
|
||||
from utils.files_times import generate_schedule_time_next_day, get_title_and_hashtags
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
filepath = Path(BASE_DIR) / "videos"
|
||||
account_file = Path(BASE_DIR / "tencent_uploader" / "account.json")
|
||||
account_file = Path(BASE_DIR / "cookies" / "tencent_uploader" / "account.json")
|
||||
# 获取视频目录
|
||||
folder_path = Path(filepath)
|
||||
# 获取文件夹中的所有文件
|
||||
|
||||
@@ -3,13 +3,13 @@ from pathlib import Path
|
||||
|
||||
from conf import BASE_DIR
|
||||
# from tk_uploader.main import tiktok_setup, TiktokVideo
|
||||
from tk_uploader.main_chrome import tiktok_setup, TiktokVideo
|
||||
from uploader.tk_uploader.main_chrome import tiktok_setup, TiktokVideo
|
||||
from utils.files_times import generate_schedule_time_next_day, get_title_and_hashtags
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
filepath = Path(BASE_DIR) / "videos"
|
||||
account_file = Path(BASE_DIR / "tk_uploader" / "account.json")
|
||||
account_file = Path(BASE_DIR / "cookies" / "tk_uploader" / "account.json")
|
||||
folder_path = Path(filepath)
|
||||
# get video files from folder
|
||||
files = list(folder_path.glob("*.mp4"))
|
||||
|
||||
@@ -6,10 +6,10 @@ from xhs import XhsClient
|
||||
|
||||
from conf import BASE_DIR
|
||||
from utils.files_times import generate_schedule_time_next_day, get_title_and_hashtags
|
||||
from xhs_uploader.main import sign_local, beauty_print
|
||||
from uploader.xhs_uploader.main import sign_local, beauty_print
|
||||
|
||||
config = configparser.RawConfigParser()
|
||||
config.read(Path(BASE_DIR / "xhs_uploader" / "accounts.ini"))
|
||||
config.read(Path(BASE_DIR / "uploader" / "xhs_uploader" / "accounts.ini"))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user