An open API service indexing awesome lists of open source software.

https://github.com/codingstark-dev/youtube-downloader-api

This API built using Flask allows users to retrieve video information from YouTube and download videos in specified resolutions or audio format.
https://github.com/codingstark-dev/youtube-downloader-api

flask flask-api python3 pytube ytdl

Last synced: 8 months ago
JSON representation

This API built using Flask allows users to retrieve video information from YouTube and download videos in specified resolutions or audio format.

Awesome Lists containing this project

README

          

## YouTube Downloader API

This API built using Flask allows users to retrieve video information from YouTube and download videos in specified resolutions or audio format.

### API Endpoints

#### Fetch Video Information

- **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.

#### Download Video/Audio

- **Endpoint**: `/api/download`
- **Method**: `GET`
- **Parameters**:
- `url` (required): The YouTube video URL
- `resolution` (required): Video resolution (use 'audio' for audio-only)
- **Response**:
- Downloads the requested video or audio file.

### Setup Instructions

1. Install Python.
2. Install dependencies:
```
pip install flask flask-cors pytube
```
3. Run the application:
```
python app.py
```
4. Access the API endpoints using `http://localhost:5000`.

### Usage

#### Fetch Video Information

```bash
GET /api/video_info?url=