I built a Python bot that writes, edits & uploads YouTube Shorts — fully automated

alesiox94

Junior Member
Joined
Jul 22, 2014
Messages
192
Reaction score
57
I built a Python bot that generates a story, images, voiceover, word‑by‑word subtitles, assembles the video, and uploads the Short to YouTube with one click — almost zero budget.
Note: This is a personal project. I’m not selling anything, no plans to commercialize it.


Why?​


An end‑to‑end automation challenge to reuse in future AI projects, keeping costs as close to zero as possible.


Constraints / Stack​


  • Cost: near‑zero
  • LLMs & images: g4f client for GPT‑4 + Flux
  • TTS: edge-tts
  • ⏱️ Word timestamps/STT: Deepgram
  • Video/audio: OpenCV (cv2) + ffmpeg
  • ⬆️ Upload: YouTube Data API (auto refresh-token)
  • Language: Python

️ Pipeline highlights​


  1. Story generation (100–120 words) to stay <60s.
    • Mixtral needed in‑context examples to respect length (>90% success).
    • GPT‑4 did it natively → token savings.
  2. Unique plots via random sampling from arrays of events/roles/time periods.
  3. Structured output with a forced JSON schema:
    {
    "story": "..."
    }

  4. Image prompts: split story into 12 parts, detailed prompts incl. historical cues.
  5. Image processing/motion: 1024×1024 → 1500×1920 (cv2), padding + random pans/diagonals.
  6. Voiceover: neural voice via edge-tts.
  7. Word-by-word subtitles: Deepgram timestamps → .srt per parola.
  8. Background music: ~10 royalty‑free tracks (YouTube library), LLM picks the best fit.
  9. Compositing: ffmpeg to merge voice+music and hardcode subtitles (FFmpeg = ).
  10. Auto-upload: refresh token automation for the YouTube API.

✅ Takeaways​


  • JSON schemas, randomness and token mgmt = huge time savers.
  • Creative automation is doable on a shoestring.
  • Python + FFmpeg is a killer combo for media pipelines.

Video link: [
]
Happy to share snippets or a repo if there’s interest!
(Again: no sales, just sharing the journey.)
 
Isn't this the type of nonsense that YouTube is clamping down on, thankfully? Full automated, slideshow cookie cutter crap?
 
Isn't this the type of nonsense that YouTube is clamping down on, thankfully? Full automated, slideshow cookie cutter crap?
I get where you’re coming from—nobody wants low‑effort, cookie‑cutter spam on YouTube.
That’s not what I’m doing here.


This project was a technical challenge for me: controlling LLM output length/structure, generating word‑level captions, adding motion and audio mixing with FFmpeg, and handling YouTube API auth—on (almost) zero budget. I’m not selling anything, and I’m not cranking out mass slideshows; I just wanted to explore end‑to‑end automation.


If you’ve got ideas on how to push the creative side further, I’m all ears. Otherwise, thanks for checking it out.
 
Interesting setup, especially using Deepgram and ffmpeg together. Curious if you're seeing any issues with retention or strikes from YT side so far.
 
Interesting setup, especially using Deepgram and ffmpeg together. Curious if you're seeing any issues with retention or strikes from YT side so far.
retentions viewis about 30% only i have to make video shorter i guess nowadays keeping people attentions is harder day by day, and no strike from youtube because is all original
 
I have written about 10 scripts like that. The hardest part is convincing youtube you're not a spammer. It's possible, but you get plenty of complaints you have to appeal. If you want it to work, you need few hundred channels and you have to expect issues once you increase numbers.
 
Back
Top