This Python script allows you to download and trim YouTube videos.
Transparency: Most of this app was created with AI assistance, as I seek to find solutions to my problems in creative ways. After finding use of such a tool, it is only fair to share it with others who may benefit in the same way.
- Install the required libraries by running:
pip install pytube
- Run the script and follow the prompts.
Downloads a YouTube video from the provided URL and saves it to the specified directory.
Converts a time string in the format hh:mm:ss
to seconds.
Clips a video from the specified start time to the end time.
- Run the script.
- Enter the YouTube video URL.
- Enter the directory to save the video.
- The video will be downloaded if it doesn't already exist in the specified directory.
- Enter the start time (hh:mm:ss).
- Enter the end time (hh:mm:ss).
- The trimmed video will be saved in the same directory as
trimmed_video.mp4
.
Note: Sometimes the video lags for the first few seconds of a given clip. Acccount for this with the script by off-setting your range you want to clip by a few seconds.
WindowsTerminal_0MazKVYuD3.mp4
- Python 3.x
pytube
library
Feel like this has been useful? Donate toward my latest projects. https://www.poof.io/tip/@davidinfosec