There’s no shortage of tools for downloading YouTube videos. But when I tried to get a specific slice out of a 49-minute video, I hit a wall.
Most tools broke. Some split the video into chunks but didn’t stitch them back together. Others failed entirely once the video passed a certain length. A few more just threw vague errors. I paid $30 for an app that claimed it could let me download custom video segments. It didn’t work.
So I built TubeSlice.
The goal was simple: paste a YouTube link, choose start and end times, hit download. Get a clean, clipped video in one go. No watermarks or login—just the clip.

How it works
TubeSlice uses three moving parts:
- yt-dlp: a robust tool for downloading YouTube videos
- ffmpeg: a command-line tool for slicing, stitching, and encoding video
- moviepy: a Python wrapper that makes slicing simpler
The core idea is: download the full video, slice only the part you need, and name it using the original title.
You can use it two ways:
- Command line (for devs and tinkerers)
- Web UI (for regular users)
Here’s the CLI version in action:
$ tubeslice
Enter YouTube URL: https://youtu.be/H8NEekz1Ij4?start=2201&end=2945
Confirm cutting from 36:42 to 49:05? (y/n): y
Downloading video...
Slicing clip...
Clip saved to: How the internet became toxic.mp4
The web version looks like this:
- Paste your link
- Enter (or auto-detect) start and end
- Click one button
- Download your sliced clip
Why I had to build TubeSlice myself
Most YouTube clip cutting tools failed for one of three reasons:
Problem | What happens |
---|---|
Long videos | Tools crash or timeout when handling 30+ min videos |
Split downloads | Some tools download chunks, but don’t rebuild them into a single video |
No slicing | Most downloaders don’t support segmenting—you get the whole video or nothing |
I also found tools that did let you trim, but only after downloading (like Descript). That defeats the point. I didn’t want to download 2GB of footage to extract 90 seconds.
One app I tried, which charged a monthly fee, downloaded incomplete clips that couldn’t be opened. Others watermark everything or require logins. Some even break entirely when YouTube updates their internal structure.
What I learned
- Use yt-dlp. Pytube broke repeatedly.
- Don’t name your script the same as a library (e.g. moviepy.py)
- Stick with moviepy 1.0.3—it was more stable than 2.x
- Streamlit is great for quick web UIs, but won’t work on services that lack ffmpeg (e.g. Streamlit Cloud)
- Render.com was an easy place to deploy, but their free plan is incredibly slow (takes ~60s to build and deploy)
You can try TubeSlice live here (hosted on Render).
Or clone the repo and run it locally:
git clone https://github.com/shehuphd/tubeslice
cd tubeslice
pip install -r requirements.txt
streamlit run app.py
Next steps
I might add a preview option so you can watch before slicing. Maybe a waveform view. Or even upload your own video files.
But the core idea won’t change: take a YouTube link, clip exactly what you need, and get out.
If that’s something you’ve needed too, grab the code and use it however you want.