Skip to content

Gunth15/Yt-Downloader-web-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 

Repository files navigation

Yt-Downloader-web-app

About this project

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.

Built With

Easy Docker deployment method

Simply run these commands

Start the databases

Docker compose up db1 db2 -d

Build the app images

Docker compose build

The you can run by running

Docker compose up

DOCKER [https://www.docker.com/]

Getting Started

Prerequisites

Install these dependencies according to your operating system

  • Rust
  • Python 3.11
  • Postgresql

Installation

Clone the github repo git clone https://github.com/Gunth15/Yt-Downloader-web-app

Postgres setup

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.

.env files

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

  1. Main directory .env, purely used for docker(WIP)

  2. Yt_downloader_manager, only has a option to choose host address

  3. yt_service, CLIENT_PORT=Yt_downloader_manager,

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

Python script dependency

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

Running/building the rust binary

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

Docker

Compiling with docker is a WIP

Special thanks to

  • Jack Branch
  • The Actix crew
  • and you!

About

Rust web server that downlaods videos to host machine and takes queries from client

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published