To let friends use this without your computer being on, you need to host it on a cloud server. GitHub stores your code, and a service like Render (free tier available) runs it.
- Create a GitHub Account if you haven't.
- Create a New Repository named
ytdlp-web. - Upload Files:
- Upload ALL files in this folder to that repository.
- (Especially:
Dockerfile,Procfile,requirements.txt,app.py,downloader.py,templates/,static/). - Note: Do NOT upload the
downloadsfolder orytdlp.exeif present. The server uses Linux.
- Go to dashboard.render.com and Sign Up (you can use your GitHub account).
- Click New + -> Web Service.
- Select Build and deploy from a Git repository.
- Connect your
ytdlp-webrepository. - Configuration:
- Name:
my-downloader(or anything). - Runtime: Select Docker.
- Region: Choose one close to you (e.g. Frankfurt, Singapore, Oregon).
- Instance Type: Free.
- Name:
- Click Create Web Service.
Youtube blocks cloud servers. To fix this, provide cookies.txt.
Method: Secret File (Recommended) Since cookies can be large, use a "Secret File" instead of an Environment Variable to avoid errors.
- Get Cookies: Install "Get cookies.txt LOCALLY" extension and download
cookies.txt. - Add to Render:
- Go to Dashboard -> Your Service -> Environment.
- Scroll down to Secret Files.
- Click Add Secret File.
- Filename:
cookies.txt - File Content: Paste the content of your
cookies.txt. - Click Save.
- Delete the old Variable: If you added
COOKIES_CONTENTearlier, delete it to fix the "argument list too long" error. - Render will redeploy automatically.
- Render will take about 2-5 minutes to build.
- Once it says Live, you will get a URL like:
https://my-downloader.onrender.com. - Share this URL with your friends. They can use it from any phone or computer!
- Spin Down: On the free tier, if no one uses the site for 15 minutes, it goes to "sleep". When you visit it again, it might take 50 seconds to wake up.
- Cookie Expiry: Cookies eventually expire (usually after a few months or if you change password). If downloads fail again, just update the
COOKIES_CONTENTvariable with fresh cookies.