1. tk(chrome support)

2. tk add thumbnail support
This commit is contained in:
pookz@stme
2024-07-03 16:58:19 +08:00
parent 71220564a6
commit e40fd39b67
6 changed files with 307 additions and 10 deletions
+8 -2
View File
@@ -2,7 +2,8 @@ import asyncio
from pathlib import Path
from conf import BASE_DIR
from tk_uploader.main import tiktok_setup, TiktokVideo
# from tk_uploader.main import tiktok_setup, TiktokVideo
from tk_uploader.main_chrome import tiktok_setup, TiktokVideo
from utils.files_times import generate_schedule_time_next_day, get_title_and_hashtags
@@ -17,8 +18,13 @@ if __name__ == '__main__':
cookie_setup = asyncio.run(tiktok_setup(account_file, handle=True))
for index, file in enumerate(files):
title, tags = get_title_and_hashtags(str(file))
thumbnail_path = file.with_suffix('.png')
print(f"video_file_name:{file}")
print(f"video_title:{title}")
print(f"video_hashtag:{tags}")
app = TiktokVideo(title, file, tags, publish_datetimes[index], account_file)
if thumbnail_path.exists():
print(f"thumbnail_file_name:{thumbnail_path}")
app = TiktokVideo(title, file, tags, publish_datetimes[index], account_file, thumbnail_path)
else:
app = TiktokVideo(title, file, tags, publish_datetimes[index], account_file)
asyncio.run(app.main(), debug=False)