Skip to content

sanity17/shortsify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎬 YouTube Shorts Creator β€” Setup & Usage Guide

What It Does

Downloads viral clips β†’ cuts funniest moments β†’ crops to 9:16 vertical β†’ adds meme-style captions β†’ exports ready-to-upload YouTube Shorts MP4s. Bonus: auto-builds a Top-5 compilation video from all clips.


Step 1 β€” Install System Tools

macOS (Homebrew)

brew install ffmpeg yt-dlp

Ubuntu / Debian

sudo apt update
sudo apt install ffmpeg -y
sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp \
     -o /usr/local/bin/yt-dlp
sudo chmod a+rx /usr/local/bin/yt-dlp

Windows (PowerShell, as Admin)

# Install Scoop first: https://scoop.sh
scoop install ffmpeg yt-dlp

Verify:

ffmpeg -version
yt-dlp --version

Step 2 β€” Python Environment

# Create venv (recommended)
python3 -m venv venv
source venv/bin/activate      # macOS/Linux
# venv\Scripts\activate       # Windows

# Install Python packages
pip install moviepy pillow numpy yt-dlp

Optional β€” AI auto-captions (Whisper):

pip install openai-whisper

(Whisper integration can be added by calling whisper <clip.mp4> and piping the SRT into ffmpeg's subtitle filter.)


Step 3 β€” Project Layout

After running the script once, this structure is created automatically:

project/
β”œβ”€β”€ shorts_creator.py   ← the main script
β”œβ”€β”€ downloads/          ← raw downloaded videos
β”œβ”€β”€ clips/              ← intermediate cut/vertical clips
β”œβ”€β”€ output/             ← βœ… FINAL YouTube Shorts go here
β”‚   β”œβ”€β”€ video1.mp4
β”‚   β”œβ”€β”€ video2.mp4
β”‚   └── TOP5_compilation.mp4
└── fonts/              ← Roboto-Bold.ttf (auto-downloaded)

Step 4 β€” Run It

Default (uses the 5 hardcoded examples)

python3 shorts_creator.py

Add a custom clip via CLI

python3 shorts_creator.py \
    "https://www.youtube.com/watch?v=YOUR_VIDEO_ID" \
    12.5 \
    27.0 \
    "WAIT FOR IT πŸ˜‚" \
    my_funny_clip

Arguments: <url> <start_sec> <end_sec> <caption_text> <output_name>


Step 5 β€” Customize the Clip List

Edit the CLIPS_LIST section in shorts_creator.py:

CLIPS_LIST: list[ClipSpec] = [
    ClipSpec(
        url     = "https://www.youtube.com/watch?v=YOUR_VIDEO",
        start   = 10.0,    # start time in seconds
        end     = 23.0,    # end time in seconds (5–15 sec clips only)
        caption = "THIS IS INSANE πŸ˜‚πŸ”₯",
        title   = "my_clip_name",  # used for filenames
        zoom    = 1.15,    # subtle zoom-in (1.0 = none, 1.3 = big)
    ),
    # add more ClipSpec(...) entries here
]

Step 6 β€” Download Your Shorts

After the script finishes, collect everything from the output/ folder:

ls -lh output/
# video1.mp4    β†’ Short #1
# video2.mp4    β†’ Short #2
# ...
# TOP5_compilation.mp4  β†’ Bonus compilation

Upload directly to YouTube β†’ Create β†’ Upload Video β†’ select Shorts format.


Configuration Reference

Variable Default Description
SHORTS_W / H 1080Γ—1920 YouTube Shorts resolution
CAPTION_FONT_SIZE 72 Caption text size in pixels
CAPTION_STROKE_W 6 Black outline thickness
CAPTION_POSITION 0.72 Vertical position (0=top, 1=bottom)
TARGET_FPS 30 Output frame rate
CRF 23 Video quality (18=best, 28=smallest)
PRESET medium ffmpeg speed/quality tradeoff

Troubleshooting

Problem Fix
yt-dlp rate-limited / blocked Add --cookies-from-browser chrome to yt-dlp cmd in script
zoompan makes video slow Reduce clip zoom to 1.05 or 1.0
Captions look bad Increase CAPTION_FONT_SIZE or change CAPTION_POSITION
Audio out of sync Change CRF from 23 β†’ 18 for higher quality
moviepy ImportError pip install moviepy==1.0.3 (stable version)
Font not loading Place Roboto-Bold.ttf manually in fonts/ folder

Example URLs (Safe Public Domain / Well-Known)

# Rick Astley - Never Gonna Give You Up
https://www.youtube.com/watch?v=dQw4w9WgXcQ

# Me at the zoo (first YouTube video)
https://www.youtube.com/watch?v=jNQXAC9IVRw

# Charlie Bit My Finger
https://www.youtube.com/watch?v=FtutLA63Cp8

# Evolution of Dance
https://www.youtube.com/watch?v=e_DqV1xdf-Y

⚠️ Copyright notice: Only use clips you have rights to, or clips under Creative Commons license. Use yt-dlp --list-formats <url> to inspect available quality options.


Optional: Auto-Captions with Whisper

pip install openai-whisper

# Generate SRT for a clip:
whisper clips/my_clip_raw.mp4 --model base --output_format srt

# Then burn into video with ffmpeg:
ffmpeg -i clips/my_clip_vertical.mp4 \
       -vf "subtitles=clips/my_clip_raw.srt:force_style='FontSize=24,PrimaryColour=&Hffffff&'" \
       output/video1.mp4

About

🎬 YouTube Shorts auto-creator β€” download, crop, caption & export vertical videos with Python, yt-dlp, ffmpeg and moviepy.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages