Effortlessly download and trim specific parts of YouTube videos with this Python script developed by Osku. Designed for simplicity and modularity, it's ideal for educational purposes.
- Python 3.6 or higher
- pip
- pipenv
-
Install Pipenv:
pip install pipenv
-
Clone the Repository:
git clone https://github.com/ProgrammingWithOsku/youtube-trimmer.git cd youtube-trimmer
-
Set Up Environment and Dependencies:
pipenv install
-
Activate the Environment:
pipenv shell
-
Run the Main Script:
python main.py
-
Follow the Prompts:
- Input the YouTube URL.
- Input start and end times in "HH:MM" format.
- Input the output filename.
-
Exit the Environment:
exit
Download a video segment from "https://www.youtube.com/watch?v=27CGOLqp-to" between 23:00-24:00, saving it as "output.mp4".
- youtube_downloader.py: Downloads and trims videos.
- validation.py: Validates URLs and time inputs.
- main.py: Script entry point.
YouTube URLs must start with "https://www.youtube.com/". Start and end times should be in "HH:MM" format, with the end time later than the start.
Comply with YouTube's terms of service. For educational use.
Osku (Eng: Osamah Amer)