You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
RedditVideoMakerBot/utils/tiktok_upload.py

20 lines
670 B

from tiktok_uploader.upload import upload_video
from utils import settings
def upload_to_tiktok(filepath: str, description: str = "") -> None:
"""Upload a video to TikTok using the configured sessionid.
Parameters
----------
filepath : str
Path to the video file that should be uploaded.
description : str, optional
Description for the TikTok post, by default ""
"""
sessionid = settings.config["settings"]["tts"].get("tiktok_sessionid")
if not sessionid:
raise ValueError("TikTok sessionid is missing from the configuration.")
upload_video(filename=filepath, description=description, sessionid=sessionid)