The YouTube Video Downloader and Info API is a Flask-based Python project that allows you to download YouTube videos and retrieve video information using Pytube. This versatile tool provides two main functionalities:
-
Download Video: You can specify the video URL and resolution to download YouTube videos directly to your local machine.
-
Get Video Info: You can retrieve detailed information about a YouTube video, including its title, author, length, views, description, and publish date.
This project is designed to simplify the process of interacting with YouTube content programmatically.
- Download YouTube videos in various resolutions.
- Retrieve comprehensive information about YouTube videos.
- Error handling for reliable performance.
- JSON API endpoints for easy integration into other applications.
- Python 3.x
- Flask for building the API.
- Pytube for interacting with YouTube content.
- re for URL validation.
- Clone this repository:
git clone https://github.com/zararashraf/youtube-video-downloader-api.git
- Install the required libraries:
pip install flask pytube
- Run the Flask application:
python main.py
- Access the API endpoints using HTTP requests (e.g., POST requests in Postman).
- Endpoint:
/download/<resolution>
- HTTP Method: POST
- Request Body: JSON
{ "url": "https://www.youtube.com/watch?v=VIDEO_ID" }
- Endpoint:
/video_info
- HTTP Method: POST
- Request Body: JSON
{ "url": "https://www.youtube.com/watch?v=VIDEO_ID" }
You can access the source code for this project on GitHub.
This project is licensed under the MIT License. You are free to use, modify, and distribute the code while providing appropriate attribution.