Youtube Downloader as a Service. This project is created as a companion service to Izuna, serving additional features for downloading Youtube file and converting into desired format, and hosting the final file to AWS S3
To use this project, you'll need:
- Python 3.9 and above
- If you don't have Python installed, download it from the official website: Python Downloads
- Poetry package manager
- If you don't have Poetry installed, you can install it using the following command:
For other installation methods, refer to the Poetry documentation.
curl -sSL https://install.python-poetry.org | python3 -
- Run
poetry install
- If you don't have Poetry installed, you can install it using the following command:
- Poe task runner
- Install via https://github.com/nat-n/poethepoet
- Python packages
As this project is using Poetry, the list of packages are already listed in
pyproject.toml
. Simply runpoetry install
to install the dependencies. ffmpeg
binary- Install it via package managers like
apt
(for Debian-based systems) or other means based on your operating system. - Example for Debian-based systems:
sudo apt install ffmpeg
- Install it via package managers like
- Setup pre-commit
- Run
poetry run pre-commit install
to setup pre-commit hooks.
- Run
Ensure that ffmpeg
is accessible in your system's PATH.
Once you have Python, Poetry, yt-dlp
, and ffmpeg
set up, you're ready to use this project.
The following command will run the web server that will accept requests.
poe run
As this will run a Flask web server, you can customize the arguments, or even use WSGI server like gunicorn
to run it. Further instruction for this will be released in next iteration.
Additionally, docker-compose.yaml
is provided for quickly running the project. Firstly build the docker image for this project with tag izuna-ytdl:latest
as it's referenced in compose file.
The following section describes the required environment variables to run this application.
Environment Variable | Description | Data Type | Required |
---|---|---|---|
YTDL_BUCKET_NAME | AWS S3 bucket name used in the service | String | Yes |
JWT_NO_HIMITSU | Secret key for JWT authentication | String | Yes |
KAKUSU_HIMITSU | Secret key used by Flask for session encryption | String | Yes |
AWS_ACCESS_KEY | Access Key used by boto3 to authenticate to AWS |
String | Yes |
AWS_SECRET_KEY | Secret key used by boto3 to authenticate to AWS |
String | Yes |
AWS_REGION | Region where the S3 bucket is hosted | String | Yes |
MAX_USER_TASK | Integer denoting the maximum download task a standard user can have | Integer | Yes |
MASTER_SIGNUP_CODE | Signup code used to register new user | String | Yes |
MASTER_TOKEN | Some weird token | String | No |
DB_CONNECTION_URL | PostgreSQL Database connection string | String | Yes |
Youtube Downloader as a Service
- Download a Youtube video and convert it into your desired format. Currently configured to produce mp3 audio only.
- Web Interface. If you want to deploy as a standalone application, then web interface is [COMING SOON]
- Upload the result to external destination. Currently targeting AWS S3
To contribute to this project, follow these steps:
- Fork the repository to your own GitHub account.
- Clone the forked repository to your local machine.
- Set up the development environment by installing the required dependencies. See the Installation section for details.
- Create a new branch for your contribution.
- Make your changes
- Commit your changes and push them to your forked repository. Submit a pull request to the master branch of this repository.
This project is licensed under the MIT License. See the LICENSE
file for more details.
- Arung Agamani (arung-agamani)
- Ridho Pratama (ridho9)
- ChatGPT for assisting on writing this README.md