INNER CODE UNIT · Python
generate_and_upload_short
FujiwaraChoki/MoneyPrinterV2 · src/main.py:22
def generate_and_upload_short(youtube: YouTube, tts: TTS, topic: str | None = None) -> None:
"""Generates a Short (optionally from a user-provided topic), then asks
whether to upload it and cross-post it via Post Bridge.
Args:
youtube (YouTube): The initialized YouTube automation instance.
tts (TTS): The TTS instance used for the voiceover.
topic (str | None): Optional custom topic. When None, the topic is
generated by the LLM from the account niche.
Returns:
None"""
youtube.generate_video(tts, topic=topic)
upload_to_yt = question("Do you want to upload this video to YouTube? (Yes/No): ")
if upload_to_yt.lower() == "yes":
upload_success = youtube.upload_video()
if upload_success:
maybe_crosspost_youtube_short(