videotomp3transcriptor/test_youtube_download.sh
debian.StillHammer 3735ebdccf feat: YouTube download system complete
 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.
2026-01-31 08:21:47 +00:00

76 lines
1.9 KiB
Bash
Executable File

#!/bin/bash
# Final test: YouTube download with logged-in cookies + PO Token
echo "🧪 Testing YouTube Download (Cookies + PO Token)"
echo ""
COOKIES_FILE="/home/debian/videotomp3transcriptor/youtube-cookies.txt"
TEST_URL="https://www.youtube.com/watch?v=fukChj4eh-Q"
# Check cookies exist
if [ ! -f "$COOKIES_FILE" ]; then
echo "❌ Cookies file not found: $COOKIES_FILE"
echo " Waiting for upload from PC..."
exit 1
fi
echo "✅ Cookies file found"
echo " Size: $(wc -c < $COOKIES_FILE) bytes"
echo " Lines: $(wc -l < $COOKIES_FILE) lines"
echo ""
# Check for logged-in cookies
if grep -q "SID\|SSID\|HSID\|SAPISID" "$COOKIES_FILE"; then
echo "✅ Logged-in cookies detected!"
else
echo "⚠️ Warning: May be guest cookies"
fi
echo ""
echo "🎯 Test 1: Info extraction only"
echo "----------------------------------------"
yt-dlp \
--cookies "$COOKIES_FILE" \
--extractor-args "youtube:player_client=mweb" \
--skip-download \
--print "%(title)s [%(duration)s sec]" \
"$TEST_URL"
echo ""
echo "🎯 Test 2: List available formats"
echo "----------------------------------------"
yt-dlp \
--cookies "$COOKIES_FILE" \
--extractor-args "youtube:player_client=mweb" \
--list-formats \
"$TEST_URL" | head -20
echo ""
echo "🎯 Test 3: Download audio (best quality)"
echo "----------------------------------------"
yt-dlp \
--cookies "$COOKIES_FILE" \
--extractor-args "youtube:player_client=mweb" \
--format "bestaudio" \
--extract-audio \
--audio-format mp3 \
--output "/tmp/test_%(id)s.%(ext)s" \
"$TEST_URL"
if [ $? -eq 0 ]; then
echo ""
echo "=" * 60
echo "🎉 SUCCESS! YouTube download working!"
echo "=" * 60
echo ""
echo "✅ Cookies: Working"
echo "✅ PO Token: Active"
echo "✅ Download: Successful"
echo ""
echo "💡 Next: Integrate into music service API"
else
echo ""
echo "❌ Download failed"
echo " Check errors above"
fi