Web app to trim and download Youtube Videos. Using Flask, Celery, Redis and Docker.
https://youtube-trim-dl.herokuapp.com/
You can trim and download Youtube Videos via app's frontend.
Trimming tasks are queued through Celery and Redis. Once the task is complete and the file is ready for download, download button becomes enabled.
Rate limited by ip address. There can only be one active task per ip.
-
docker-compose up --build
-
Clone the repo
git clone https://github.com/martymfly/youtube-trim-download
cd youtube-trim-download
-
Create virtual environment and activate
Windows
python -m venv venv cd venv & cd scripts & activate
Linux
python3 -m venv venv source venv/bin/activate
-
Install Python packages with pip and requirements.txt
Windows
pip install -r requirements.txt
Linux
pip3 install -r requirements.txt
-
Run Flask app within app root folder
python app.py
-
Run worker from worker folder
celery -A tasks worker --pool=solo -l info
-
Run Flower - Celery monitoring tool from worker folder
celery -A tasks flower
-
Install Heroku Redis add-on
-
Add ffmpeg build pack in Settings > Buildpacks - https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git
-
Add below environment variables in Settings > Config Vars
- ON_HEROKU = 1
- UPLOAD_SECRET_KEY = your_secret_key_change_this
- UPLOAD_URL = https://your-heroku-app-name.herokuapp.com/uploadfromworker
-
Run below command on heroku-cli
heroku ps:scale worker=1
If you have a suggestion that would make this better, please fork the repo and create a pull request.
You can also simply open an issue with the tag "enhancement".
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.