This API built using Flask allows users to retrieve video information from YouTube and download videos in specified resolutions or audio format.
- Endpoint:
/api/video_info
- Method:
GET
- Parameters:
url
(required): The YouTube video URL
- Response:
- JSON containing video title, available resolutions with download links, audio information, and thumbnail URL.
- Endpoint:
/api/download
- Method:
GET
- Parameters:
url
(required): The YouTube video URLresolution
(required): Video resolution (use 'audio' for audio-only)
- Response:
- Downloads the requested video or audio file.
- Install Python.
- Install dependencies:
pip install flask flask-cors pytube
- Run the application:
python app.py
- Access the API endpoints using
http://localhost:5000
.
GET /api/video_info?url=<YouTube_video_URL>