The project is a Flask application that allows users to download videos from YouTube. The application exposes two API endpoints: /api/download
and /api/receive_url
.
The /api/download
endpoint enables users to download a video by specifying its URL and itag, while the /api/receive_url
endpoint retrieves the formats and information of a video based on its URL.
This API use the pytube library to interact with the YouTube API and download videos. It supports various video formats and also handles the downloading and merging of audio and video streams for non-progressive videos with FFMPEG.
The goal of this project is to provide an easy-to-use solution for downloading videos from YouTube.
Request for /api/receive_url
:
Request for /api/download
:
-
Clone this code repository to your local machine.
-
Ensure that Docker is installed on your machine.
-
Build the Docker image by running the following command at the root of the project:
docker build -t your_image_name .
-
Run the Docker container using the following command:
docker run -d -p 5000:5000 your_image_name
-
Access http://localhost:5000 in your browser.
-
Clone this code repository to your local machine.
-
Ensure that Python 3.x is installed.
-
Install the dependencies by running the following command:
pip install -r requirements.txt
-
Install FFMPEG from here: ffmpeg.org
-
Now let's remove the ";" in line 287 of the file cipher.py:
For Windows You can probably find it at this location:
C:\Users\username\AppData\Local\Programs\Python\Python311\Lib\site-packages\pytube\cipher.py
For Linux You can probably find it at this location:
/usr/local/lib/python3.11/site-packages/pytube/cipher.py
-
Now lets run our Flask api :
flask --app app run
-
Access http://localhost:5000 in your browser.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests appropriately.
The code in this project is licensed under the MIT License. See MIT for details.