This project was build as an excuse to learn rust as a language first and foremost. I've ended learning way more about web development then I though I would this summer. This is a simple youtube downloader web server that is supposed to be ran on a machine to take request from clients and downloads youtube videos to the server.
[https://actix.rs/]
[https://www.postgresql.org/]
[https://www.python.org/]
[https://www.rust-lang.org/]
- Pytubefix
- Serde_json
- Tera
Simply run these commands
Start the databases
Docker compose up db1 db2 -dBuild the app images
Docker compose buildThe you can run by running
Docker compose upInstall these dependencies according to your operating system
- Rust
- Python 3.11
- Postgresql
Clone the github repo
git clone https://github.com/Gunth15/Yt-Downloader-web-app
Note
May want to change defaults for db if hosting this service for whatever reason
Create two databases one for the video api and the users login credentials in postgres
Create databse youtube_service
Create databse dl_users
Create credentials for each database
Create <User> with password <password>
Create <User> with password <password>
Run scripts in each database to create necessary tables
Note
If user was changed form the default, adjust script for changes
psql -d dbscript.sql -d <database_name>
where database_name is db_user for yt_web and youtube_service for yt_service unless changed from defaults.
Each directory has their own .env file where you can set the port and ip of the sever and clients they use. Aswell as set the db
Database host address and other addresses should be adjusted for any changes made from defaults
Here's a rundown of each .env file
-
Main directory .env, purely used for docker(WIP)
-
Yt_downloader_manager, only has a option to choose host address
-
yt_service, CLIENT_PORT=Yt_downloader_manager,
-
yt_web, CLIENT_PORT=yt_service
Everything else about the .env files should be self explanatory
Note
Can also set environment variables by declaring them in your terminal session like you would in a normal bash session
create a python3.11 virtual environment
python3.11 -m venv .penv && source .penv
install pytubefix
pip install pytubefix
If you compile as a binary, make sure to source .penv before starting Yt_downloader_manager
For a quick showcase, you can cargo run in each crate within the project directory except pytube_wrpr and interact with whole stack using yt_web host addr
If you plan to build the project using cargo build --release, make sure to include a /downloads folder with your yt_downloader_manager binary location
and all of /static with the yt_web binary
DON'T FORGET TO SOURCE .PENV BEFORE USING yt_downloader_manager
Compiling with docker is a WIP
- Jack Branch
- The Actix crew
- and you!


