✅ FULLY OPERATIONAL - Tested & working
## Infrastructure
- PO Token Provider (Docker bgutil, port 4416)
- SMS Receiver endpoint (Node.js, port 4417)
- Deno JavaScript runtime (signature decryption)
- Logged-in cookies system
## Features
- Anti-bot bypass (PO Token + cookies)
- Auto-login scripts with SMS forwarding
- Cookie extraction (Camoufox)
- Full automation ready
## Tested
- Multiple videos downloaded successfully
- Audio extraction to MP3 working
- Download speeds 15-30 MB/s
## Documentation
- YOUTUBE_SETUP_COMPLETE.md (full usage guide)
- SMS_FORWARDER_SETUP.md (SMS automation)
- QUICK_SETUP_COOKIES.md (cookie renewal)
## Scripts
- src/sms_receiver.js - SMS webhook endpoint
- src/python/auto_login_full_auto.py - Auto-login with SMS
- test_youtube_download.sh - Test script
Ready for production integration.
90 lines
1.9 KiB
Markdown
90 lines
1.9 KiB
Markdown
# 🍪 Quick Setup: YouTube Cookies
|
|
|
|
**YouTube bot detection requires logged-in cookies.**
|
|
|
|
---
|
|
|
|
## 🚀 Method 1: Extract from your local Firefox (EASIEST)
|
|
|
|
### On your local machine (PC/laptop):
|
|
|
|
```bash
|
|
# Install yt-dlp if needed
|
|
pip install yt-dlp
|
|
|
|
# Login to YouTube in Firefox first
|
|
# Then extract cookies:
|
|
yt-dlp --cookies-from-browser firefox --cookies youtube-cookies.txt 'https://youtube.com'
|
|
|
|
# Upload to server:
|
|
scp youtube-cookies.txt debian@vps-a20accb1.vps.ovh.net:/home/debian/videotomp3transcriptor/
|
|
```
|
|
|
|
### On server:
|
|
|
|
```bash
|
|
# Restart service
|
|
cd /home/debian/videotomp3transcriptor
|
|
pm2 restart music-service # or npm start
|
|
|
|
# Test
|
|
curl -X POST http://localhost:8889/download \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"url": "https://youtube.com/watch?v=fukChj4eh-Q"}'
|
|
```
|
|
|
|
**Duration**: Cookies last 2-4 weeks, then repeat.
|
|
|
|
---
|
|
|
|
## 🦊 Method 2: Camoufox with manual login (if you have VNC/X11)
|
|
|
|
Only works if you can open GUI on server (VNC, X11 forwarding).
|
|
|
|
```bash
|
|
cd /home/debian/videotomp3transcriptor
|
|
python3 src/python/extract_cookies_with_login.py
|
|
|
|
# Browser opens → Login to YouTube → Press Enter
|
|
# Cookies saved!
|
|
```
|
|
|
|
---
|
|
|
|
## ⚙️ Method 3: Browser extension (Alternative)
|
|
|
|
1. Install extension in Firefox:
|
|
- https://addons.mozilla.org/firefox/addon/cookies-txt/
|
|
|
|
2. Go to YouTube, login
|
|
|
|
3. Click extension → Export → Save as `youtube-cookies.txt`
|
|
|
|
4. Upload to server (see Method 1)
|
|
|
|
---
|
|
|
|
## ✅ Verify cookies work:
|
|
|
|
```bash
|
|
yt-dlp --cookies youtube-cookies.txt --skip-download "https://youtube.com/watch?v=dQw4w9WgXcQ"
|
|
```
|
|
|
|
If no error → Cookies work!
|
|
|
|
---
|
|
|
|
## 🔄 Auto-refresh (once initial cookies uploaded):
|
|
|
|
The service will:
|
|
- ✅ Use your logged-in cookies
|
|
- ✅ Validate them daily
|
|
- ✅ Work for 2-4 weeks
|
|
- ⚠️ Need manual refresh when expired
|
|
|
|
**Future improvement**: VNC-based auto-login script (not implemented yet).
|
|
|
|
---
|
|
|
|
**For now**: Use Method 1 (extract from local Firefox) - takes 2 minutes!
|