Build an Auto YouTube Shorts Maker in Python (Text to Video, Voice, Captions) 2026 – Source Code
Build a Python tool that turns a plain text file into a finished 1080x1920 vertical video for YouTube Shorts, Reels or TikTok: a neural voice and word timings with edge-tts, a moving neon background made with NumPy, word-by-word highlighted captions drawn with Pillow, a title card and a subscribe card with MoviePy 2's TextClip, all put together with one command. Includes a batch mode that makes a Short for every script in a folder.
- Duration
- 15:14 (13 chapters)
- Tools
- Python 3.13, MoviePy 2.2.1, edge-tts 7.3.1, NumPy, Pillow, VS Code
Watch the tutorial
Chapters
- 0:0001. Intro: the finished Short
- 0:1902. The plan: text file to finished Short
- 1:2003. Setup: install MoviePy 2 and edge-tts
- 2:0604. Voice and word timings with edge-tts
- 3:4205. Moving neon background with NumPy
- 5:0706. Word-by-word captions with Pillow
- 6:1007. Title card and subscribe card with TextClip
- 6:5508. make_short.py: one command builds the Short
- 8:5809. Make your own Short and change the voice
- 10:1110. Bonus: batch mode, a Short for every script
- 11:4111. Customize the look: colours, captions and cards
- 12:5812. Common errors and quick fixes
- 14:0613. Recap and next steps
What's in the zip
python-auto-shorts-maker/.gitignorepython-auto-shorts-maker/HOW_TO_RUN.txtpython-auto-shorts-maker/LICENSEpython-auto-shorts-maker/MANIFEST.sha256python-auto-shorts-maker/PLAN.mdpython-auto-shorts-maker/README.mdpython-auto-shorts-maker/background.pypython-auto-shorts-maker/batch.pypython-auto-shorts-maker/captions.pypython-auto-shorts-maker/cards.pypython-auto-shorts-maker/fonts/DejaVuSans-Bold.ttfpython-auto-shorts-maker/fonts/LICENSE-DejaVu.txtpython-auto-shorts-maker/make_short.pypython-auto-shorts-maker/requirements.txtpython-auto-shorts-maker/script.txtpython-auto-shorts-maker/scripts/list_tip.txtpython-auto-shorts-maker/scripts/made_by_python.txtpython-auto-shorts-maker/voice.py
How to run
Python 3.10+ (tested with 3.13). Works on Windows, macOS and Linux. Run every command from the folder. The voice needs an internet connection.
python -m venv .venv
source .venv/bin/activate (Windows: .venv\Scripts\activate)
pip install -r requirements.txt
mkdir out
python make_short.py script.txt
python make_short.py script.txt --voice en-US-AvaNeural --out out/ava.mp4
python batch.pySee HOW_TO_RUN.txt for every step and the common errors, and README.md for the script format and options.
Media
No video, music or stock footage is bundled or needed. The background is generated with NumPy, the voice comes from edge-tts, and the DejaVu Sans Bold font is included under its own free licence.
Next step
New to MoviePy? The free MoviePy 2 Tutorial code is here too, and so is the Python for Data Engineering full course.
File: python-auto-shorts-maker-code.zip
Size: 357.3 KB (365,923 bytes)
SHA-256:4c89b4f0bf4d230f19f912bbd53effb793c94838fd85b8e0cee43abda9512e9a
Licence: code is released under the MIT licence, copyright PyInns. See LICENSE and README inside the zip. Free learning code, not production code.